FohmAnalys / SEIR-model-Stockholm

Skattning av peakdag och antal infekterade i covid-19-utbrottet i Stockholms län februari-april 2020.
GNU General Public License v2.0
58 stars 32 forks source link

For bootstrap CIs, use estimated covariance matrix #5

Open ghost opened 4 years ago

ghost commented 4 years ago

The function Estimate_function_Stockholm_only_local outputs the Hessian matrix, which you convert to an estimated covariance matrix for the parameters on line 362 (referenced below). This information should be used when you simulate values for the parameters, as you do on lines 458-461, I think. You can draw simulations from a multivariate normal distribution using MASS::mvrnorm(n = 1000, mu = Est$par, Sigma = NeginvH2), for example.

https://github.com/FohmAnalys/SEIR-model-Stockholm/blob/bb616e970d6cb3f8b01edfe735b1a418480c6af2/Script/Estimate_SEIR_for_sharing_new_incidence.R#L362