calib_sofun | R Documentation |
This is the main function that handles the calibration of SOFUN model parameters.
calib_sofun(drivers, obs, settings, optim_out = TRUE, ...)
drivers |
A data frame with driver data. See |
obs |
A data frame containing observational data used for model
calibration. See |
settings |
A list containing model calibration settings. See the 'P-model usage' vignette for more information and examples.
|
optim_out |
A logical indicating whether the function returns the raw output of the optimization functions (defaults to TRUE). |
... |
Optional arguments passed on to the cost function specified as
|
A named list containing the calibrated parameter vector 'par' and the output object from the optimization 'mod'. For more details on this output and how to evaluate it, see runMCMC (also this post) and GenSA.
# Fix model parameters that won't be calibrated
params_fix <- list(
kphio_par_a = 0,
kphio_par_b = 1.0,
soilm_thetastar = 0.6*240,
soilm_betao = 0.01,
beta_unitcostratio = 146,
rd_to_vcmax = 0.014,
tau_acclim = 30,
kc_jmax = 0.41
)
# Define calibration settings
settings <- list(
method = "BayesianTools",
par = list(
kphio = list(lower=0.04, upper=0.09, init=0.05),
err_gpp = list(lower = 0.01, upper = 4, init = 2)
),
metric = rsofun::cost_likelihood_pmodel,
control = list(
sampler = "DEzs",
settings = list(
nrChains = 1,
burnin = 0,
iterations = 50 # kept artificially low
)
)
)
# Run the calibration for GPP data
calib_output <- rsofun::calib_sofun(
drivers = rsofun::p_model_drivers,
obs = rsofun::p_model_validation,
settings = settings,
# extra arguments for the cost function
par_fixed = params_fix,
targets = c("gpp")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.