amael-ls / treeGrowth_eu

Estimating tree growth in Europe
0 stars 0 forks source link

Biased results #1

Closed amael-ls closed 3 years ago

amael-ls commented 3 years ago

The script dummyData_toy.R generates dummy data and then try to fit them with the three parameters (+ states) model toyPara_GPUs.stan. The three parameters are the slope_dbh, processError, and measureError, 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:

  1. Try to fit an even simpler model with only two variances (i.e., the slope is known and fixed to one)
  2. If (1) is working, try to fit the model with the slope only (the variances are fixed)
  3. If (1) &(2) are working, try with the slope and one variance
  4. Depending on the result in (3) try the slope and the other variance, and then maybe with everything (which should not work...)
amael-ls commented 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.

amael-ls commented 3 years ago

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