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

View source: R/kriging.R

prior2posteriorR Documentation

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

Description

prior2posterior applies the gaussian conditioning theorem to an array of time series corresponding to the simulated responses to several external forcings (natural, anthropogenic or both) given observations (see equations 12 and 13 in Supplementary Material of Qasmi and Ribes, 2021).

Usage

prior2posterior(
  X_fit,
  Xo,
  Sigma_obs,
  Nres = NULL,
  centering_CX = T,
  ref_CX = "year_obs",
  S_mean = NULL,
  Sigma_mod = NULL,
  weights = NULL
)

Arguments

X_fit

a 3-D array of dimension [length(year), length(forcing), length(model)] returned by x_fit.

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.

weights

a vector of weights of the same length as the number of models to account for dependencies between models if needed.

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.