# ufun_Atta_L: Calculates Utility function with labor supply and housing In floswald/ArmaUtils: Rcpp Helper Functions

## Description

Calculates CRRA utility from u(Resources, wage, hsize, params )

## Usage

 `1` ```ufun_Atta_L(Resources, wage, hsize, params) ```

## Arguments

 `Resources` a numeric matrix `wage` either a scalar or a vector of length `nrow(Resources)` of wage `hsize` either a scalar or a vector of length `nrow(Resources)` of current house size `params` list of scalar parameters: theta: elasticity of substitution c,h alpha: exponent of consumption in cobb-douglas of period utility gamma: coefficient of relative risk aversion phival: fraction of house-utility derived from flat mu: ownership premium cutoff: minimal consumption level c*. quadratic approximation for c

## Details

computes CRRA utility of u(c,l,h,params).

u(c,l,h) = (c^alpha * l^1-alpha)^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

Computes a quadratic approximation to u() for values of consumption such that c < c*, where c* > 0. Resoures can be a scalar, a vector or a matrix. Utility is computed on all elements. Some care needs to be taken when supplying a matrix of consumption values: the corresponding vector of house sizes needs to be either a scalar (same house size at all cons values) or of length `nrow(Resources)`

## Value

List with three components:

 `utility` Numeric matrix of CRRA utility values. quadratic approximation for c

## Examples

 ```1 2 3 4``` ```## Not run: examples ## End(Not run) ```

floswald/ArmaUtils documentation built on May 16, 2019, 1:23 p.m.