# specifiyng the diffeq problem using DifferentialEquations.jlfunctionlynx_hare!(dP, P, θ, t) H, L = P bh, mh, bl, ml = θ dP[1] = (bh - L * mh) * H dP[2] = (bl * H - ml) * Lend# run a simulation based on the lynx_hare! solutionfunctionlh_sim(params, N) H₁, L₁ = params[end-1:end] prob =ODEProblem(lynx_hare!, [H₁, L₁], N-1, params[1:end-2]) sol =solve(prob, saveat=1) H =map(first, sol.u[1:N]) L =map(last, sol.u[1:N])return (H, L)endparams = (0.54, 0.005, 0.005, 0.8, 190, 30)H, L =lh_sim(params, nrow(lh_obs))plot(lh_obs[!, :Year], H, label="Hare", linewidth=3, xlabel="Year", ylabel="Population (thousands)", title="Simulated Population Dynamics", color=:blue)plot!(lh_obs[!, :Year], L, label="Lynx", linewidth=3, color=:red)plot!(size=(1100, 450))
Figure 9: Synthetic data from predator-prey model
What Is A Generative Process For Pelts?
Initial population changes according to predator-prey model;
Some fraction of population are trapped;
Trap rates differ by species and can vary by year.
Think generatively about probability models for calibrating models:
Discrepancy: corrects for mismatches between model output and “state” of system
Observation errors: Probability distribution for observations given discrepancy adjustment
Choice of probability model (including discrepancy) can impact projections even if hindcast (“validation”) does not appear very different.
Discussion of Shmueli (2010)
Questions To Seed Discussion
What do you think are the differences between predictive and explanatory modeling?
What can go wrong when we conflate the two?
Can you think of approaches or workflows which bridge the two paradigms?
Upcoming Schedule
Next Classes
Monday: Feb Break!
Wednesday: Bayesian Statistics
Assessments
Homework 2 available; due next Friday (2/21).
No quiz or reading this week!
References
References (Scroll for Full List)
Brynjarsdóttir, J., & O’Hagan, A. (2014). Learning about physical parameters: the importance of model discrepancy. Inverse Problems, 30, 114007. https://doi.org/10.1088/0266-5611/30/11/114007
Palmer, M. D., Harris, G. R., & Gregory, J. M. (2018). Extending CMIP5 projections of global mean temperature change and sea level rise due to thermal expansion using a physically-based emulator. Environ. Res. Lett., 13, 084003. https://doi.org/10.1088/1748-9326/aad2e4