util_module: C++ module for computation of V = max_s U + b*EV(s)

Description Usage Arguments Value Author(s) Examples

Description

computes value functions for m discrete labor supply choices. no time separability assumed, i.e. labor supply is not implied by current resources. computes V on n states. The current implementation computes the following functional form for the utility function:

u(c,l,h) = (c * exp(alpha * l) )^1-gamma / (1-gamma) * exp( theta * phi(h) ) + mu * phi(h), phi(h) = 0 if h=0, phi(h) = phival if h=1, phi(h) = 1 if h=2

Usage

1
  util_module(cashR, saveR, EVR, hsizeR, laborR, par)

Arguments

cashR

numeric matrix (n,m) of cash holdings conditional on labor supply (that's why m columns)

saveR

numeric matrix (n,k) of savings options. k < n.

EVR

numeric matrix (n,k) representing expected future value at each state,choice combination

hsizeR

vector (n,1)

laborR

vector (m,1), basically seq(from=0,to=1,length=m)

theta

elasticity of substitution between c and h

phival

value of relative utility difference flat vs house

mu

weight on additive utility premium

gamma

coefficient of relative risk aversion

cutoff

minimum level of consumption. below cutoff, u(c) is quadratically approximated.

alpha

coefficient on labor

myNA

numerical value to be assigned to values with negative consumption (if quad == FALSE)

tau

numerical value of proportional consumption scaling. a value in [0,infty). used in welfare experiments

Value

list with elements

values

(n,m) matrix of conditional value functions. column i is V_i.

saving

(n,m) matrix of conditional savings functions. column i is save_i.

cons

(n,m) matrix of conditional value functions. column i is cons_i.

dchoiceL

(n,1) vector indexing discrete choice at each state.

maxL

(n,1) vector of maximal value. maxL = max_d V_d.

Author(s)

Florian Oswald <florian.oswald@gmail.com>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
n = 25000    # number of states
k = 50       # number of savings choices by state
m = 3    # number of discrete labor choices by state
cash   <- matrix(1:n,n,m)
cash   <- cash + matrix(0:2,n,m,byrow=TRUE)
labo   <- seq(from=0,to=1,length=m)
saving <- matrix(seq(from=0,to=8,length=k),n,k,byrow=TRUE)
EV     <- log(outer(1:n,1:k))
hsize  <- sample(0:2,size=n,replace=TRUE)
pars   <- list(theta=0.2,phival=0.9,mu=0.6,gamma=1.4,cutoff=0.1,alpha=-0.6,myNA=-1e9,tau=1)
res <- util_module(cashR=cash, saveR=saving, EVR=EV, hsizeR=hsize, laborR=labo, par=pars)

floswald/umod documentation built on May 16, 2019, 1:24 p.m.