constrain: Derive the posterior distribution of time series from a prior...

View source: R/kriging.R

constrainR Documentation

Derive the posterior distribution of time series from a prior given observations

Description

constrain applies the gaussian conditioning theorem to a prior distribution for several external forcings (natural, anthropogenic or both) given observations (see equations 12 and 13 in Supplementary Material of Qasmi and Ribes, 2021).

Usage

constrain(
  S_mean,
  Sigma_mod,
  Xo,
  Sigma_obs,
  Nres,
  centering_CX = T,
  ref_CX = NULL
)

Arguments

S_mean

a vector accounting for the multi-model mean.

Xo

a vector or a matrix. If a vector, Xo is a time series of observations over a given period, and must have names corresponding to the years of observations (eg 1850:2020). If a matrix, lines correspond to the years of observations and columns to different type of observations, which sample measurement uncertainty.

Sigma_obs

a sum of a matrix sampling observed internal variability (tipically returned by Sigma_mar2) + a matrix sampling error measurements in observations (see Methods in Qasmi and Ribes, 2021).

Nres

the whished number of realisations in the posterior gaussian sample

centering_CX

a logical value indicating whether the constrained time series must be in anomalies relative to a given period (see ref_CX)

ref_CX

a vector containing the years corresponding to the reference period if centering_CX = TRUE. models to account for dependencies between models if needed.

S_mod

a covariance matrix accounting for model uncertainty.

Value

a list of two lists containing the parameters of the unconstrained (prior) and constrained (posterior) gaussian distributions for the responses to the forcings in X_fit. The first (second) list named uncons (cons) contains two other lists, namely mean and var. mean is a concatenation of time series corresponding to the mean of the distribution for the different forcings. The name of each element follows the pattern: year_forcing, eg 1850_nat for the mean natural response in 1850. var is the covariance matrix associated with mu, sampling the model uncertainty.


saidqasmi/KCC documentation built on July 8, 2022, 6:02 a.m.