Description Usage Arguments Details Value Author(s) Examples
Calculates CRRA utility of u(Resources, hsize, age, params, xi, own ) at each entry of Resources. Not used in Li, Meghir, Oswald.
1 | utilfun(Resources, hsize, age, params, xi, own )
|
Resources |
a numeric matrix |
hsize |
either a scalar or a vector of length |
age |
integer age of individual |
params |
list of scalar parameters:
|
xi |
list of vector parameters |
own |
boolean value for ownership |
computes CRRA utility of u(c,h,H,theta,t). see doc/ufun.pdf. Computes a quadratic approximation to u() for values of consumption such that c < c*, where c* > 0.
Numeric matrix of CRRA utility values
<florian.oswald@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
pars <- list(alpha=0.6,sigma=1.6,cutoff=0.05,theta=1.1)
maxage <- 10
fsize <- seq(1,3,le=maxage)
xi <- list()
xi[[1]] <- fsize^(pars$sigma -1)
xi[[2]] <- xi[[1]] / (1-pars$sigma)
xi[[3]] <- pars$alpha*(1-pars$sigma)
xi[[4]] <- (1-pars$alpha)*(1-pars$sigma)
xi[[5]] <- pars$alpha*(1-pars$sigma) -1
Res <- Res <- outer(1:5,-4:8,FUN="+")
utilfun(Resources=Res,hsize=2,age=4,params=pars,xi=xi,own=TRUE)
utilfun(Resources=Res,hsize=2,age=4,params=pars,xi=xi,own=FALSE)
utilfun(Resources=Res,hsize=1:5,age=4,params=pars,xi=xi,own=FALSE)
utilfun(Resources=Res,hsize=1:6,age=4,params=pars,xi=xi,own=FALSE) # error message: too many house sizes.
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.