Learn R Programming

Stem (version 1.0)

Stem.Estimation: ML Estimation

Description

The function computes the maximum likelihood estimates of the unknown parameters of a hierarchical spatio-temporal model of class “Stem.Model”. The estimates are obtained using Kalman filtering and EM algorithm.

Usage

Stem.Estimation(StemModel, precision = 0.01, max.iter = 50, flag.Gdiag = TRUE, flag.Sigmaetadiag = TRUE, cov.spat = Sigmastar.exp)

Arguments

StemModel
an object of class “Stem.Model” given as output by the Stem.Model function.
precision
a small positive number used for the algorithm convergence. Default is equal to 0.01. See DETAILS below.
max.iter
maximum number of iterations for the EM algorithm. Default is equal to 50.
flag.Gdiag
logical, indicating whether the transition matrix $G$ is diagonal.
flag.Sigmaetadiag
logical, indicating whether the variance-covariance matrix of the state equation $\Sigma_\eta$ is diagonal.
cov.spat
type of spatial covariance function. For the moment only the exponential function is implemented.

Value

The function returns an object of class “Stem.Model” which is a list given by:
skeleton
As the skeleton component of the StemModel object given in input.
data
As the data component of the StemModel object given in input.
estimates
A list of four objects: phi.hat, y.smoothed, loglik, convergence.par here described.phi.hat is a list with the parameter ML estimates (sigma2omega, beta, G, Sigmaeta, m0, C0, theta, sigma2eps). y.smoothed is a ts object ($n$ by $p$) which is the output of the Kalman filtering procedure. loglik is the log-likehood value. convergence.par is a list of 4 objects with some information about the convergence of the algorithm: conv.log and conv.par are logical values for the two convergence criteria described above; iterEM is the number of iterations for the EM algorithm and iterNR is the number of Newton-Raphson iterations for each EM algorithm iteration.

Details

This function estimates the vector parameter phi of the hierarchical spatio-temporal model of class “Stem.Model” using Kalman filtering and EM algorithm. The algorithm details and formulas are given in Fasso' and Cameletti (2007, 2009). Note that some parameters (beta, sigma2omega, G, Sigmaeta and m0) are updated using closed form solutions while theta and sigma2epsilon using the Newton-Raphson algorithm.

For initializing the algorithm the values contained in StemModel$skeleton$phi are used as initial values. The algorithm converges when the following convergence criteria (named in the output as conv.par and conv.log respectively) are jointly met

$$\frac{\left\|\phi^{\left(i+1\right)}-\phi^{\left(i\right)} \right\|}{\left\|\phi^{\left(i\right)}\right\|} < \pi $$

$$\frac{\left\|\log L\left( \phi^{\left(i+1\right)}\right)-\log L\left( \phi^{\left(i\right)}\right)\right\|}{\left\|\log L\left( \phi^{\left(i\right)}\right)\right\|}<\pi$$< p="">

where $\pi$ is given by the precision option and $i$ is the number of iteration. The use of these relative criteria instead of some other absolute ones makes it possible to correct for the different parameter scales.

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

See Also Stem.Model and pm10

Examples

Run this code
#load the data
data(pm10)

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

#build the parameter list 
#(the phi list is used for the algorithm starting values)
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)

#mod1 is given as output by the Stem.Model function
mod1.est <- Stem.Estimation(mod1)
phi.estimates <- unlist(mod1.est$estimates$phi.hat)
 

Run the code above in your browser using DataLab