Class 9


Review from previous class

Random number generation
LispStat includes generators for all of the familiar distributions, along with the associated density, CDF, and inverse CDF (or quantile) functions.

The *random-state* variable allows you to control the simulation, and be able to reproduce your results at a subsequent time.

Simulation
Simulation background... numerical evaluation of integrals...

We were able to assemble a "simulator", a function that simulates statistics using function arguments to generate samples from various distributions. Analysis of the simulation results convey notions of bias, standard error, and dependence.

Bootstrap resampling
Rather than sample from a hypothetical distribution, one draws samples with replacement from the observed data. These so-called bootstrap replicates of the statistic of interest allow you to compute bias, standard error, and even confidence intervals. The code for bootstraping is a trivial modification of the code for our simulator.


Tools for the Day

Now that you have done some programming, you will appreciate learning more about the debugging features that are in Lispstat. They are not as fancy as those in the commercial (ie, expensive) programming environments, but do most of what is needed.
Tracing
You can trace a function, seeing when it is called and what arguments it returns. This is particularly useful with recursive functions.

Stepping
Stepping through the evaluation of an expression shows the intermediate results, one at a time.

Interrupting execution
When put into "debug" mode, LispStat halts at an error, describes the error, and maintains the state of the system at the time the error occurred. That is, you can see the values of all the variables involved in the calculation at the time the error occurred. The accompanying function baktrace can then be used to see the sequence of calculations leading the error.


Status of Projects


The EM algorithm

Genetics example
A clever use of EM to see that you can find a sequence of simple problems that solve this nasty multinomial estimation.

Mixtures
My favorite use of the EM, but watch out for identification problems...

Lisp script for today's class
class9.lsp


Next time

More on the EM algorithm and some further simulation examples.