tilbud / rCMEM

GNU General Public License v3.0
2 stars 4 forks source link

Brute Force Solver #25

Open HolmquistJ opened 4 years ago

HolmquistJ commented 4 years ago

Kathe had the idea to build in a brute force solver for key parameters, maybe some of the more abstract ones like setteling velocity for mineral input, and recalcitrant fraction or turnover rate for organic input.

@ktoddbrown I think you mentioned you had an idea for the type of solver you like?

The package and/or paper could have an example using Meagan's public data.

ktoddbrown commented 4 years ago

So this is relatively simple code to role on your own. Something like:

bruitForce <- expand.grid(list(param1 = 1:10, param2 = 30:45)) %>% group_by_all() %>% mutate(fit = fit_function(.)) %>% filter(rel_tol < (fit-perfectFit)/perfectFit)

Of course the devil is in the details.

  1. What are the parameter bound?
  2. How dense do you want to sample the parameter space?
  3. What is the fit function? (RSME, linear regression (slope+intercept+R2), log-likelihood, Taylor score, ...)

The trick with this brute force approach is to balance sampling the parameter space with run time. It's very easy to explode the number of parameter combinations you run very very quickly. You can address this by a coarse sampling, treating some of the parameters as constant, and doing a second iteration after the first once you narrow down your parameter ranges (if you have reason to believe the model is well behaved which I think this model is).