ls_criteria: Criteria to optimize

ls_criteriaR Documentation

Criteria to optimize

Description

Provide several least squares criteria to estimate parameters by minimizing the difference between observed and simulated values of model output variables.

Usage

crit_ols(sim_list, obs_list)

crit_wls(sim_list, obs_list, weight)

crit_log_cwss(sim_list, obs_list)

crit_log_cwss_corr(sim_list, obs_list)

Arguments

sim_list

List of simulated variables

obs_list

List of observed variables

weight

Weights to use in the criterion to optimize. A function that takes in input a vector of observed values and the name of the corresponding variable and that must return either a single value for the weights for the given variable or a vector of values of length the length of the vector of observed values given in input.

Details

The following criteria are proposed ( see html version for a better rendering of equations):

  • crit_ols: ordinary least squares
    The sum of squared residues for each variable:

    \sum_{i,j,k} [Y_{ijk}-f_{jk}(X_i;\theta)]^2

    where Y_{ijk} is the observed value for the k^{th} time point of the j^{th} variable in the i^{th} situation, f_{jk}(X_i;\theta) the corresponding model prediction.
    Using this criterion, one assume that all errors (model and observations errors for all variables, dates and situations) are independent, and that the error variance is constant over time and equal for the different variables j.

  • crit_wls: weighted least squares
    The weighted sum of squared residues for each variable:

    \sum_{i,j,k} [\frac{Y_{ijk}-f_{jk}(X_i;\theta)}{w_{i,j,k}}]^2

    where Y_{ijk} is the observed value for the k^{th} time point of the j^{th} variable in the i^{th} situation, f_{jk}(X_i;\theta) the corresponding model prediction,
    and w_{i,j,k} a weight.
    Using this criterion, one assume that all errors (model and observations errors for all variables, dates and situations) are independent, and that the error variances are equal to w_{i,j,k}^2 j.

  • crit_log_cwss: log transformation of concentrated version of weighted sum of squares
    The concentrated version of weighted sum of squares is:

    \prod_{j} {(\frac{1}{n_j} \sum_{i,k} [Y_{ijk}-f_{jk}(X_i;\theta)]^2 )} ^{n_j/2}

    where Y_{ijk} is the observed value for the k^{th} time point of the j^{th} variable in the i^{th} situation, f_{jk}(X_i;\theta) the corresponding model prediction, and n_j the number of measurements of variable j.
    crit_log_cwss computes the log of this equation.
    Using this criterion, one assume that all errors (model and observations errors for all variables, dates and situations) are independent, and that the error variance is constant over time but may be different between variables j. These error variances are automatically estimated. More details about this criterion are given in Wallach et al. (2011), equation 5.

  • crit_log_cwss_corr: log transformation of concentrated version of weighted sum of squares with hypothesis of high correlation between errors for different measurements over time
    The original criterion is:

    \prod_{j} {(\frac{1}{N_j} \sum_{i} [ \frac{1}{n_{ij}} \sum_{k} (Y_{ijk}-f_{jk}(X_i;\theta))^2 ] )} ^{N_j/2}

    where Y_{ijk} is the observed value for the k^{th} time point of the j^{th} variable in the i^{th} situation, f_{jk}(X_i;\theta) the corresponding model prediction, N_j the number of situations including at least one observation of variable j, and n_{ij} the number of observation of variable j on situation i. .
    crit_log_cwss_corr computes the log of this equation.
    Using this criterion, one still assume that errors in different situations or for different variables in the same situation are independent. However, errors for different observations over time of the same variable in the same situation are assumed to be highly correlated. In this way, each situation contributes a single term to the overall sum of squared errors regardless of the number of observations which may be useful in case one have situations with very heterogeneous number of dates of observations. More details about this criterion are given in Wallach et al. (2011), equation 8.

sim_list and obs_list must have the same structure (i.e. same number of variables, dates, situations, ... use internal function intersect_sim_obs before calling the criterion functions).

Value

The value of the criterion given the observed and simulated values of the variables.


SticsRPacks/CroptimizR documentation built on Dec. 16, 2024, 11:54 a.m.