JoeyBernhardt / p-temp

temperature and nutrient effects on productivity
MIT License
0 stars 1 forks source link

Update on fitting by grouped treatments #29

Open marcus-campbell opened 7 years ago

marcus-campbell commented 7 years ago
  1. The previous code was modified in order to group the observational data by treatment group (8 combinations of different temperatures and phosphorus treatments)

  2. A bug was found (which was also present in the previous, non-grouped script), which caused the initial model conditions to be set incorrectly. This likely reduced the accuracy of the density estimates, but also probably negatively affected the quality of parameter estimation for r. This bug has since been resolved, and also corrected in older scripts.

  3. Currently the code is configured to provide parameter estimates for both r and K, as well as to show how the simulated dynamics compare to the actual experimental data. The latter is a new feature, and is useful for judging the quality of the fitting.

  4. I feel much more confident about the quality of the parameter estimates for the grouped treatments. The fitting algorithm "has much more to work with", and having multiple observations at each time point also allows us to employ a few additional functions that could possibly aid with the fittings.

However, when trying to estimate the activation energies, this method suffers from having a small "sample size". Using the old method, we had 24 parameter estimates per resource treatment, whereas now we have 4. Consequently the confidence intervals are very large. I'd like to discuss this issue further in person.

  1. The fits still need to be calibrated; this consists of simulating the data with different parameter settings, overlaying the simulated curves over the actual data, and playing with the parameters until the fit looks correct. Basically, we must calibrate each fit visually. Previously, this was arguably intractable with 48 different replicates, but now I only need to do it with 8, which is another advantage of the grouped method.

The initial commit is below; further optimization has occurred since then. SHA: b304e77513f94b44bee27619adbf51513c718950

Most recent commit: SHA: c3be60e60129675c8ad7e5eb5467bd018e3c54bc

JoeyBernhardt commented 7 years ago

great -- thanks @marcus-campbell! I hear you w/r/t the problem of having only one estimate per temperature and nutrient level. I agree it would be good to discuss that later...

Do the relative magnitudes of the r and K estimates across temperatures and nutrient levels make sense to you?

image

image