Lab1.txt

Revision 1 - 5/31/07 at 3:42 pm by e2holmes

Back to revision history for Lab1.txt
This file is part of the project Teaching code for State-space models
Lab 1

Lab 1 introduces you to the concept of ML estimates of the true population size given particular parameter values.  This lab uses the kalman filter to fit the CDA to the data.  You'll explore how the fit changes when you assign the variability to process versus non-process error.

At the matlab prompt, type 'Lab1'.
You'll be asked to enter a data code.  Type 0 and see the available data.  Now, you'll pick an animal.
Next you'll be asked to enter mu, process error, and non-process error.  You'll be asked for this 3 times; this will produce 3 plots with your 3 inputed parameter sets.

FYI: Biologically reasonable values of pe and npe are 0.000001 to 0.3 (or so).



Exercise 1:  Effect of non-process error (it helps here to think of it as measurement error)

Type 'Lab1' at matlab prompt.
When asked for data code, type 3 (this is a White-capped albatross time series).

Param set 1: set mu = 0; pe = 0.01; npe = 0.1
Param set 2: set mu = 0; pe = 0.01; npe = 0.01
Param set 3: set mu = 0; pe = 0.01; npe = 0.001

Questions for Exercise 1:

1. Why is the fit closer to the observations as the npe parameter is lowered?




Exercise 2:  Effect of process error

Type 'Lab1' at matlab prompt.
When asked for data code, type 3 again.

Param set 1: set mu = 0; pe = 0.1; npe = 0.01
Param set 2: set mu = 0; pe = 0.01; npe = 0.01
Param set 3: set mu = 0; pe = 0.001; npe = 0.01

Questions for Exercise 2:

1. Why is the fit closer to the observations as the pe parameter is raised?




Exercise 3: Effect of putting the variance in process versus non-process error.

Type 'Lab1' at matlab prompt.
When asked for data code, type 5 (this is a Sharp-tailed grouse time series).

Param set 1: set mu = 0.2; pe = 0.00001; npe = 0.3
Param set 2: set mu = 0.2; pe = 0.3; npe = 0.00001
Param set 3: set mu = 0; pe = 0.3; npe = 0.00001

Questions for Exercise 3:

1.  (1st panel) The model doesn't fit the data at all.  How can this be the ML fit of the CDA to the data?

2.  (2nd panel) Why does the model fit the data perfectly now?   What does setting npe really small mean?  Why did the negative log likelihood go down?

3.  (3rd panel) The CDA fit looks like the same as in the 2nd panel.  Why did the negative log likelihood go down?

4.  (4th panel) This is the fit using the parameters with the lowest -log L.  How can this be the parameter set with the lowest -log L when the fit doesn't look very good?




Exercise 3: Expected log N versus conditional expected log N

Type 'Lab1' at matlab prompt.
When asked for data code, type 1 (this is a Grey-headed albatross time series).

Param set 1: set mu = 0; pe = 0.00001; npe = 0.2
Param set 2: set mu = 0.1; pe = 0.00001; npe = 0.2
Param set 3: set mu = -0.1; pe = 0.00001; npe = 0.2

Questions for Exercise 3

1. (1st panel) With mu = 0, that equals zero growth, and you set process error close to zero also.  So why isn't the ML fit of the CDA a straight line across?

2. (2nd and 3rd panels)  With mu = +/- 0.1 and process error close to zero, the expected change in log N in the CDA is 35 * mu = (3.5 or -3.5).  So why are we seeing only a 2.5 (or -2.5) change?  The answer is basically the same as for question 1 now were seeing a larger difference between the expected CDA versus the ML fit. 



Sculpin 0.2 | xhtml | problems or comments? | report bugs