Aniso_fit {convoSPAT}R Documentation

Fit the stationary spatial model

Description

Aniso_fit estimates the parameters of the stationary spatial model. Required inputs are the observed data and locations. Optional inputs include the covariance model (exponential is the default).

Usage

Aniso_fit(
  sp.SPDF = NULL,
  coords = NULL,
  data = NULL,
  cov.model = "exponential",
  mean.model = data ~ 1,
  fixed.nugg2.var = NULL,
  method = "reml",
  fix.tausq = FALSE,
  tausq = 0,
  fix.kappa = FALSE,
  kappa = 0.5,
  local.pars.LB = NULL,
  local.pars.UB = NULL,
  local.ini.pars = NULL
)

Arguments

sp.SPDF

A "SpatialPointsDataFrame" object, which contains the spatial coordinates and additional attribute variables corresponding to the spatoal coordinates

coords

An N x 2 matrix where each row has the two-dimensional coordinates of the N data locations.

data

A vector or matrix with N rows, containing the data values. Inputting a vector corresponds to a single replicate of data, while inputting a matrix corresponds to replicates. In the case of replicates, the model assumes the replicates are independent and identically distributed.

cov.model

A string specifying the model for the correlation function; defaults to "exponential". Options available in this package are: "exponential", "matern", or "gaussian".

mean.model

An object of class formula, specifying the mean model to be used. Defaults to an intercept only.

fixed.nugg2.var

Optional; describes the variance/covariance for a fixed (second) nugget term (represents a known error term). Either a vector of length N containing a station-specific variances (implying independent error) or an NxN covariance matrix (implying dependent error). Defaults to zero.

method

Indicates the estimation method, either maximum likelihood ("ml") or restricted maximum likelihood ("reml").

fix.tausq

Logical; indicates whether the default nugget term (tau^2) should be fixed (TRUE) or estimated (FALSE). Defaults to FALSE.

tausq

Scalar; fixed value for the nugget variance (when fix.tausq = TRUE).

fix.kappa

Logical; indicates if the kappa parameter should be fixed (TRUE) or estimated (FALSE). Defaults to FALSE (only valid for cov.model = "matern" and cov.model = "cauchy").

kappa

Scalar; value of the kappa parameter. Only used if fix.kappa = TRUE.

local.pars.LB, local.pars.UB

Optional vectors of lower and upper bounds, respectively, used by the "L-BFGS-B" method option in the optim function for the local parameter estimation. Each vector must be of length five, containing values for lam1, lam2, tausq, sigmasq, and nu. Default for local.pars.LB is rep(1e-05,5); default for local.pars.UB is c(max.distance/2, max.distance/2, 4*resid.var, 4*resid.var, 100), where max.distance is the maximum interpoint distance of the observed data and resid.var is the residual variance from using lm with mean.model.

local.ini.pars

Optional vector of initial values used by the "L-BFGS-B" method option in the optim function for the local parameter estimation. The vector must be of length five, containing values for lam1, lam2, tausq, sigmasq, and nu. Defaults to c(max.distance/10, max.distance/10, 0.1*resid.var, 0.9*resid.var, 1), where max.distance is the maximum interpoint distance of the observed data and resid.var is the residual variance from using lm with mean.model.

Value

A list with the following components:

MLEs.save

Table of local maximum likelihood estimates for each mixture component location.

data

Observed data values.

beta.GLS

Vector of generalized least squares estimates of beta, the mean coefficients.

beta.cov

Covariance matrix of the generalized least squares estimate of beta.

Mean.coefs

"Regression table" for the mean coefficient estimates, listing the estimate, standard error, and t-value.

Cov.mat

Estimated covariance matrix (N.obs x N.obs) using all relevant parameter estimates.

Cov.mat.chol

Cholesky of Cov.mat (i.e., chol(Cov.mat)), the estimated covariance matrix (N.obs x N.obs).

aniso.pars

Vector of MLEs for the anisotropy parameters lam1, lam2, eta.

aniso.mat

2 x 2 anisotropy matrix, calculated from aniso.pars.

tausq.est

Scalar maximum likelihood estimate of tausq (nugget variance).

sigmasq.est

Scalar maximum likelihood estimate of sigmasq (process variance).

kappa.MLE

Scalar maximum likelihood estimate for kappa (when applicable).

fixed.nugg2.var

N x N matrix with the fixed variance/covariance for the second (measurement error) nugget term (defaults to zero).

cov.model

String; the correlation model used for estimation.

coords

N x 2 matrix of observation locations.

global.loglik

Scalar value of the maximized likelihood from the global optimization (if available).

Xmat

Design matrix, obtained from using lm with mean.model.

fix.kappa

Logical, indicating if kappa was fixed (TRUE) or estimated (FALSE).

kappa

Scalar; fixed value of kappa.

Examples

## Not run: 
# Using iid standard Gaussian data
aniso.fit <- Aniso_fit( coords = cbind(runif(100), runif(100)),
data = rnorm(100) )

## End(Not run)


[Package convoSPAT version 1.2.7 Index]