Learn R Programming

Stem (version 1.0)

Stem.Model: Create a Stem Model

Description

The function Stem.Model is used to create an object of class “Stem.Model”.

Usage

Stem.Model(...)
is.Stem.Model(x)

Arguments

...
List with named elements: phi, K, z, coordinates, covariates and, optionally, p (default equal to 1). See the model details and notation below.
x
an object of class Stem.Model

Value

The function returns a list which is given by:
skeleton
a list with components phi, p, K as given in the input.
data
a list with components z, coordinates, covariates, as given in the input, r, n and d.

Warning

No missing values are admitted in the observation matrix z, in the covariates matrix covariates and in the coordinates matrix.

Details

The hierarchical spatio-temporal model is given by $$z_t = X_t \beta + K y_t + e_t , e_t \sim N(0, \Sigma_e )$$ $$y_t = G y_{t-1} + \eta_t , \eta_t \sim N(0,\Sigma_{\eta})$$ for $t=1,...,n$. The initialization is given by $ y_0 ~ N(m0,C0).$ Note that $z_t$ has dimension $d$ by 1, where $d$ is the number of spatial locations and $y_t$ has dimension $p$ by 1, where $p$ is the dimension of the latent process. The matrix $X_t$ is the known covariate matrix and has dimension $d$ by $r$, where $r$ is the number of covariates. Moreover, the $d$-dimensional square matrix $\Sigma_e$ is given by $\sigma^2_\epsilon+\sigma^2_\omega$ in the diagonal (for spatial distance $h$ equal to 0), while the off-diagonal entries are given by $\sigma^2_\omega * C(h,\theta)$, where $C(h,\theta)$ is the spatial covariance function. Using the default exponential spatial covariance function, it is $C(h,theta)=\exp(-\theta* h)$. So the parameter vector $\phi$ is composed by $\beta$, $\sigma^2_\epsilon$, $\sigma^2_\omega$, $\theta$, $G$, $\Sigma_\eta$ and $m0$ ($C0$ is supposed fixed).

The elements required by the function must have the following characteristics:

phi
is a list composed by: beta (matrix $r * 1$), sigma2eps (scalar), sigma2omega (scalar), theta (scalar), G (matrix $p * p$), Sigmaeta (matrix $p * p$), m0 (matrix $p * 1$), C0 (matrix $p*p$). Note that these values will be used as the true parameter values in the Stem.Simulation function and as initial values for the EM algorithm in the Stem.Estimation function
.
K
loading matrix $d$ by $p$.

z
observation matrix $n$ by $d$.

coordinates
matrix $d$ by 2 with UTMX-UTMY or LAT-LON coordinates.

covariates
matrix $(n * d)* r$. It is recommended to build the covariate matrix stacking the data by station. This means that you consider the $n$ by $r$ matrices related to each spatial location and stack them until you get a $(n * d)* r$ matrix.

References

Amisigo, B.A., Van De Giesen, N.C. (2005) Using a spatio-temporal dynamic state-space model with the EM algorithm to patch gaps in daily riverflow series. Hydrology and Earth System Sciences 9, 209--224.

Fasso', A., Cameletti, M., Nicolis, O. (2007) Air quality monitoring using heterogeneous networks. Environmetrics 18, 245--264.

Fasso', A., Cameletti, M. (2007) A general spatio-temporal model for environmental data. Tech.rep. n.27 Graspa - The Italian Group of Environmental Statistics - http://www.graspa.org .

Fasso', A., Cameletti, M. (2009) A unified statistical approach for simulation, modelling, analysis and mapping of environmental data. Accepted for publication by Simulation: transaction of the Society for Modeling and Simulation International.

Mc Lachlan, G.J., Krishnan, T. (1997) The EM Algorithm and Extensions. Wiley, New York.

Shumway, R.H., Stoffer, D.S. (2006) Time Series Analysis and Its Applications: with R Examples. Springer, New York.

Xu, K., Wikle, C.K. (2007) Estimation of parameterized spatio-temporal dynamic models. Journal of Statistical Inference and Planning 137, 567--588.

See Also

pm10

Examples

Run this code
#load the data
data(pm10)
names(pm10)

#extract the data
coordinates <- pm10$coords
covariates <- pm10$covariates
z <- pm10$z

#build the parameter list
phi <- list(beta=matrix(c(3.65,0.046,-0.904),3,1),
				sigma2eps=0.1,
				sigma2omega=0.2,
				theta=0.01,
				G=matrix(0.77,1,1),
				Sigmaeta=matrix(0.3,1,1),
				m0=as.matrix(0),
				C0=as.matrix(1))

K <-matrix(1,ncol(z),1)

mod1 <- Stem.Model(z=z,covariates=covariates,
coordinates=coordinates,phi=phi,K=K)

class(mod1)
is.Stem.Model(mod1)

Run the code above in your browser using DataLab