13.07.2015 Views

LIAM 2 User Guide

LIAM 2 User Guide

LIAM 2 User Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>LIAM</strong> 2 <strong>User</strong> <strong>Guide</strong>, Release 0.7.0missing: the value to return for individuals which were not present in the period. By default, it returns themissing value corresponding to the type of the expression: -1 for an integer expression, nan for a float orFalse for a boolean.examplevalue_for_period(inwork and not male, 2002)• duration(expr): number of consecutive period the expression was Trueexamplesduration(inwork and (earnings > 2000))duration(educationlevel == 4)• tavg(expr): average of an expression since the individual was createdexampletavg(income)• tsum(expr): sum of an expression since the individual was created5.5.7 random functions• uniform: random numbers with a uniform distribution [0,1)• normal: random numbers with a normal distribution• randint: random integers between boundsexample# a random variable with the stdev derived from errsalnormal(loc=0.0, scale=std(errsal))randint(0, 10)choiceMonte Carlo or probabilistic simulation is a method for iteratively evaluating a deterministic model using setsof random numbers as inputs. In microsimulation, the technique is used to simulate changes of state dependentvariables. Take the simplest example: suppose that we have an exogenous probability of an event happening,P(x=1), or not P(x=0). Then draw a random number u from an uniform [0,1) distribution. If, for individual i, ui

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!