R/cost_likelihood_biomee.R
cost_likelihood_biomee.Rd
Cost function for parameter calibration, which computes the log-likelihood for the biomee model fitting several target variables for a given set of parameters.
cost_likelihood_biomee(par, obs, drivers, targets)
A vector containing parameter values for 'phiRL',
'LAI_light', 'tf_base', 'par_mort'
in that order, and for the error terms
corresponding to the target variables, e.g. 'err_GPP'
if GPP is a target.
Make sure that
the order of the error terms in par
coincides with the order provided in
the targets
argument.
A nested data frame of observations, following the structure of biomee_validation
,
for example.
A nested data frame of driver data, for example biomee_gs_leuning_drivers
.
A character vector indicating the target variables for which the
optimization will be done. This should be a subset of c("GPP", "LAI",
"Density", "Biomass")
.
The log-likelihood of the simulated targets by the biomee model versus the observed targets.
The cost function performs a BiomeE model run for the value of
par
given as argument. The likelihood is calculated assuming that the
predicted targets are independent, normally distributed and centered on the observations.
The optimization
should be run using BayesianTools
, so the likelihood is maximized.