cost_likelihood_biomee: Log-likelihood cost function for BiomeE with different...

View source: R/cost_likelihood_biomee.R

cost_likelihood_biomeeR Documentation

Log-likelihood cost function for BiomeE with different targets

Description

Cost function for parameter calibration, which computes the log-likelihood for the biomee model fitting several target variables for a given set of parameters.

Usage

cost_likelihood_biomee(par, obs, drivers, targets)

Arguments

par

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.

obs

A nested data frame of observations, following the structure of biomee_validation_2, for example.

drivers

A nested data frame of driver data, for example biomee_gs_leuning_drivers.

targets

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").

Details

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.

Value

The log-likelihood of the simulated targets by the biomee model versus the observed targets.

Examples


# Compute the likelihood for a set of
# BiomeE model parameter values
# and the example data
cost_likelihood_biomee(
 par = c(3.5, 3.5, 1, 1,    # model params
         0.5),              # err_GPP
 obs = biomee_validation_2,
 drivers = biomee_gs_leuning_drivers,
 targets = c("GPP")
)


stineb/rsofun documentation built on April 29, 2024, 1:29 p.m.