Closed amael-ls closed 3 years ago
The first test (only two variances) did not pass, even when keeping all the data. It is likely that there is an error in the code because this version of the model is almost equivalent to the toy model of Auger-Méthé et. al. (2021) A guide to state–space modelling of ecological time series
. The only difference is that Auger-Méthé has one long time series, while I have 75 medium time series (75 being the number of individuals).
Next step, try with one individual measured many times (i.e., a single long time series). This model should be equivalent to the one in Auger-Méthé. The only differences are the values of the parameters, the length of the time series (mine is 418 measurements and hers 200) and the initial condition to start the chain.
There is actually no bug in the scripts (at least proved for one individual, see the scripts related to this bug). The main problem is described by Auger-Méthé et al. 2016: State-space models’ dirty little secrets: even simple linear Gaussian models can have estimation problems. See also the first release to have access to the scripts of that time that showed and solved my problem
The script
dummyData_toy.R
generates dummy data and then try to fit them with the three parameters (+ states) modeltoyPara_GPUs.stan
. The three parameters are theslope_dbh
,processError
, andmeasureError
, i.e., one coefficient and two variances. Note that the states are also to be estimated (but are not considered parameters per se)Even when keeping all the data (i.e., nothing missing), the two variances are biased. Plan to debug: