Learn R Programming

MAPCtools (version 0.1.0)

agaussian: Aggregate Gaussian data

Description

Aggregates Gaussian data using sufficient statistics for Gaussian samples. For a sample \(\boldsymbol{y} = \{y_1, \dots, y_n\}\) with \(y_i \sim \mathcal{N(\mu, (s_i \tau)^{-1})}\), \(i=1, \dots, n\), the sample is aggregated into the sufficient statistic

\((v, \frac{1}{2} \sum_{i=1}^n \log(s_i), m, n, \bar{y})\),

with

\(m = \sum_{i=1}^n s_i\) \(\quad\) \(\bar{y} = \frac{1}{m} \sum{i=1}^n s_iy_i\) \(\quad\) \(v = \frac{1}{m} \sum_{i=1}^n s_i y_i^2 - \bar{y}^2\).

For a short derivation of the sufficient statistic, attach the INLA package (library(INLA)) and run inla.doc("agaussian").

Usage

agaussian(data, precision.scale = NULL)

Value

Aggregated Gaussian data, in an inla.mdata object, which is compatible with the agaussian family in INLA.

Arguments

data

Gaussian data, must be a numeric vector.

precision.scale

Scales for the precision of each Gaussian observation.
Defaults to vector of 1s (no scaling).