mimiframework / Mimi.jl

Integrated Assessment Modeling Framework
https://www.mimiframework.org
Other
68 stars 34 forks source link

Add n option to compute_scc #536

Open davidanthoff opened 5 years ago

davidanthoff commented 5 years ago

This is not strictly a Mimi issue, but given that it affects multiple models, seems easier to track here.

The idea would be that we add a named keyword argument to compute_scc called n. If n=nothing the function returns the SCC as computed today, if n is some integer, it would run a monte carlo simulation with that many runs and return a vector of SCCs.

corakingdon commented 5 years ago

@davidanthoff Just checking the intended functionality: this would break the rule that compute_scc always returns the same type, right? Depending on the value of n, it might return a Float64 or a Vector. If we are okay with this, then I would propose also deleting the additional compute_scc_mm functions we created and instead add a keyword option for return_mm = true for returning a NamedTuple of (scc, MarginalModel). We originally created the additional function in order to not have the function return different types.

davidanthoff commented 5 years ago

Good point... Maybe we should instead add a compute_mc_scc function instead? I kind of like the idea that each function returns the same thing always...

corakingdon commented 5 years ago

@davidanthoff is there a reason that you want the default n to be nothing instead of just 1? Would you want n=1 to still prompt a simulation to run with a random sample, but only one trial?

davidanthoff commented 5 years ago

Yes, I think if it is a number, then it should sample, even if the number is 1. If it is nothing, it uses the best guess value.