calc_loglikelihood: Compute the log-likelihoods for each data point

Description Usage Arguments Details Value

View source: R/bayesian.R

Description

Match historical data to observations and compute the log-likelihood for each data point. This will be done for a variety of variance levels, so the result will be a table with an extra parameter xi and an output column ll_ that gives the log pointwise probability density.

Usage

1
calc_loglikelihood(obs, model, lpdf, varlvls)

Arguments

obs

Table of observational data (q.v. add_parameter_data)

model

Table of model outputs (q.v. get_scenario_land_data)

lpdf

Log probability density function (q.v. get_lpdf)

varlvls

Variance levels to run (see details).

Details

The variance levels ξ are used to calculate the scale parameter required by the lpdf. For each grouping of region, land type (i.e., GCAM commodity), and variable (e.g., land area), we calculate a variance \varsigma^2_g for the grouping. Then, the scale factor for all of the data points in the grouping is calculated as σ_g = √{ξ \varsigma^2_g}. If multiple ξ values are passed, this process is repeated for each one, and the results are combined into a single table.

Value

Data frame containing xi and ll_


JGCRI/gcamland documentation built on Oct. 6, 2020, 5:30 p.m.