Skip to contents

WishartMoments: means, inverse means and expected log-determinant of the Wishart or inverse-Wishart distribution. PartitionedCovariance: Bartlett decomposition of a partitioned covariance and Gaussian conditioning. SeparablePrewhiten: temporal prewhitening of a separable matrix-normal field. NormalGammaDlm: West-Harrison normal-gamma dynamic linear model filter with unknown observation variance. HarmonicOzoneDlm: Huerta et al. multi-site harmonic DLM (Kalman filter). CarrollStCorrelation: Carroll et al. space-time correlation with its smallest eigenvalue. ProcessConvolutionCovariance: Higdon process-convolution covariance with location-specific Gaussian kernels. ArmaAcf: theoretical ARMA autocorrelation function. Identical to the Python arm morie.fn.stblocks.

Usage

WishartMoments(scale, df, inverse_wishart = FALSE)

PartitionedCovariance(sigma, k, x2 = NULL, mean = NULL)

SeparablePrewhiten(z, rho_t)

NormalGammaDlm(y, F, G, W, m0, C0, n0, S0)

HarmonicOzoneDlm(y, times, coords, a, lam, sigma2, w, m0 = NULL, c0 = 1e+06)

CarrollStCorrelation(coords, times, a, b)

ProcessConvolutionCovariance(coords, kernels, sigma2 = 1, normalize = FALSE)

ArmaAcf(ar = numeric(0), ma = numeric(0), lag_max = NULL)

Arguments

scale

Scale matrix.

df

Degrees of freedom.

inverse_wishart

Moments of the inverse Wishart instead.

sigma

Covariance matrix.

k

Size of the first block.

x2

Optional values of the second block.

mean

Optional mean vector.

z

Sites by times data matrix.

rho_t

Temporal correlation matrix.

y

Observations (vector, or times by sites matrix).

F

Observation vector.

G

Evolution matrix.

W

Scale-free evolution covariance.

m0, C0, n0, S0

Prior mean, scale-free covariance, degrees of freedom and variance estimate.

times

Times (hours for the ozone model).

coords

Site coordinates, one row per site or point.

a

Harmonic coefficients (ozone model) or the three log-psi coefficients (Carroll).

lam

Range of the exponential measurement-error correlation.

sigma2

Variance.

w

Evolution variances of the level and the two amplitude sets.

c0

Prior variance of the state.

b

The three log-phi coefficients.

kernels

One kernel covariance matrix per location (array) or one matrix.

normalize

Return correlations.

ar, ma

AR and MA coefficients.

lag_max

Largest lag.

Value

A list, or a numeric vector for ArmaAcf.

References

Shaddick, G., Zidek, J. V. and Schmidt, A. M. (2023). Spatio-Temporal Methods in Environmental Epidemiology with R, 2nd edn. CRC Press.

West, M. and Harrison, J. (1997). Bayesian Forecasting and Dynamic Models, 2nd edn. Springer.

Huerta, G., Sanso, B. and Stroud, J. R. (2004). A spatiotemporal model for Mexico City ozone levels. Applied Statistics 53, 231-248.

Higdon, D., Swall, J. and Kern, J. (1999). Non-stationary spatial modeling. Bayesian Statistics 6, 761-768.

Examples

WishartMoments(matrix(c(2, 0.5, 0.5, 1), 2), 6)$mean_logdet
#> [1] 3.571851
ArmaAcf(ar = c(0.5, 0.2), lag_max = 3)
#> [1] 1.00000 0.62500 0.51250 0.38125