lmspar: fit a linear model with spatial CAR and SAR covariances using...

Description Usage Arguments Value Author(s)

View source: R/lmspar.R

Description

fit a linear model with spatial CAR and SAR covariances using maximum likelihood

Usage

1
2
3
lmspar(formula, data, indComp = FALSE, Nmat = NULL, distMat = NULL,
  crsStk = NULL, indSamp, model = NULL, rowStand = TRUE,
  rhoBound = c(-1, 1))

Arguments

formula

an R formula

data

a data.frame containing the data

indComp

should an independent component be added to the model

Nmat

neighborhood matrix of binary values, with a 1 indicating a neighbor, 0 otherwise

distMat

Euclidean distance matrix among polygon centroids

crsStk

indicator matrix of whether locations cross stock boundaries

indSamp

indicator vector for wheter location was sampled. Zero indicates missing value

model

either 'CAR' or 'SAR'. Only used if one of Nmat, distMat, or crsStk are not NULL.

rowStand

should row-standardization be used on CAR or SAR models? Default is TRUE.

Value

a list with parmEst as the estimated covariance parameters (with overall variance profiled out), sigma2 as the estimate of the overall variance parameter, m2LL as the minimized negative 2 times the log-likelihood, bHat as the fitted fixed effect parameters, covb as the estimated covariance matrix of the fitted fixed effect parameters, Vi is the inverse of the covariance matrix, Vi.oo as the inverse of the covariance matrix of the observed locations only, X returns the design matrix, and y returns the data vector.

Author(s)

Jay Ver Hoef


jayverhoef/SpAReco documentation built on May 18, 2019, 5:58 p.m.