I am working to add a new damage sector to MimiGIVE and account for uncertainty. I understand the steps taken in the How To Guide, but curious how to implement given more than one uncertainty parameter, and dependence between parameters.
For example, say in addition to “a”, new_sector_damages.jl contains some parameter “b” which is not independent from “a”. In mcs.jl, I see how “a” is added with some normal distribution and then connected back to new sector damages.
How would I incorporate “b” here? Would I sample from its own normal distribution using the expected value and standard error of that parameter? How do I account for parameter variance-covariance to jointly sample more than one parameter?
Hi @naomishimberg the Mimi documentation on Monte Carlo Simulations here and here will likely help with questions about uncertainty and MCS. I believe you can define correlations between random variables with the Latin Hypercube approach to sampling, or if you have presampled data you can consider using the SampleStore type to provide presampled data for the parameters.
Hi @naomishimberg. Just so I understand, are you asking about sampling a and b from a joint distribution? If so, perhaps the template used for the Howard and Sterner random parameters might be useful to build on? These stem from a multivariate distribution (e.g., parameters in the same regression equation).
yeah, we went back and forth about what the best method was. We were leaning towards providing presampled draws (as reference data), which might be better in the case of many parameters since your covariance matrix will get quite large. The H&S parameter set was right on the margin of this tradeoff, and since it was already coded we just stuck with it. Researcher preference I think at that point!
It would probably be a good addition to Mimi to have a way to have the MCS functionality draw these on each trial, building it into the more typical @defsim structure that we generally use for other IAMs, instead of having to create a SampleStore, I can open an Issue to do that but probably won’t have time to do it on your timeline @naomishimberg so the approach there might be wisest.
For background @naomishimberg if you take a look at other models we often just use the @defsim macro which abstracts away some of these details, but for MimiGIVE the combination of multivariate distributions, resampled data, and other nuances meant we wrote a more verbose construction of the Monte Carlo object.
Thank you for your responses! This all makes sense to me. Could you point me to some guidance on how to create presampled draws for the SampleStore? I’ve read the Monte Carlo + SA page on Mimi.jl but it doesn’t go into specifics. I’m only working with 3 parameters in one function and 4 parameters in another, so the covariance matrix is not too large.
Mimi.SampleStore is a type defined in Mimi that extends the Distributions package type PseudoDistribution as shown here. The extension involves defining the type, and a few methods including rand, quantile, length`, and a few others.
It is defined such that when rand is called on the SampleStore type the function returns the next value in the provided vector of values.
So if you create a SampleStore
d = SampleStore([1,2,3,4,5])
and then call rand you get
rand(d)
1
rand(d)
2
rand(d)
3
etcetera. You can therefore use the SampleStore type to define a Distribution that is assigned to a random variable, just like you would with any other Distribution (Normal, etc.). This is useful for presampled draws, or in the case we point out above draws that are sampled in a function when creating the Monte Carlo Simulation object.
The main_mcs.jl file in MimiGIVE uses these quite a bit, I’m not sure which other models take advantage of them yet although I’m sure a few do.