CovarianceM {StempCens} | R Documentation |
Covariance matrix for spatio-temporal model
Description
It computes the spatio-temporal covariance matrix for balanced data, i.e., when we have the same temporal indexes per location. To compute the spatial correlation it provides 5 functions: exponential, gaussian, matern, spherical and power exponential. To compute the temporal correlation is used an autocorrelation function of an AR(1) process.
Usage
CovarianceM(phi, rho, tau2, sigma2, distSpa, disTemp, kappa, type.S)
Arguments
phi |
value of the spatial scaling parameter. |
rho |
value of the time scaling parameter. |
tau2 |
value of the the nugget effect parameter. |
sigma2 |
value of the partial sill. |
distSpa |
|
disTemp |
|
kappa |
parameter for all spatial covariance functions. In the case of exponential, gaussian and spherical function |
type.S |
type of spatial correlation function: ' |
Value
The function returns the nT x nT
spatio-temporal covariance matrix for balanced data.
Author(s)
Katherine L. Valeriano, Victor H. Lachos and Larissa A. Matos
Examples
set.seed(1000)
# Parameter values
phi <- 5
rho <- 0.45
tau2 <- 0.80
sigma2 <- 2
# Coordinates and time points
coords <- matrix(runif(20, 0, 10), ncol=2) # Cartesian coordinates without repetitions
time <- as.matrix(1:5) # Time index without repetitions
Ms <- as.matrix(dist(coords)) # Spatial distances
Mt <- as.matrix(dist(time)) # Temporal distances
# Covariance matrix
Cov <- CovarianceM(phi, rho, tau2, sigma2, distSpa=Ms, disTemp=Mt,
kappa=0, type.S="exponential")