View source: R/internal-gaussian_aggregation.R
agaussian | R Documentation |
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")
.
agaussian(data, precision.scale = NULL)
data |
Gaussian data, must be a numeric vector. |
precision.scale |
Scales for the precision of each Gaussian observation. |
Aggregated Gaussian data, in an inla.mdata
object, which is compatible with the agaussian
family in INLA.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.