util_module_file: C++ module for computation of V = U + b*EV(0)

Description Usage Arguments Value Author(s) Examples

Description

computes value functions for m discrete labor supply choices when there is no savings choice. 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_file(cashR, EVR, hsizeR, laborR, par)

Arguments

cashR

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

EVR

numeric matrix (n,1) representing expected future value at tomorrow's assets = 0

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

quad

boolean of whether neg cons quadratically approximated or not

borrconst

boolean of whether there are borrowing constraints built into the savings matrix

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.

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
n = 5    # number of states
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)
EV     <- log(1:n)
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,quad=FALSE,borrconst=FALSE,myNA=-1e9,tau=1)
res <- util_module_file(cashR=cash, EVR=EV, hsizeR=hsize, laborR=labo, par=pars)

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