stFit: Fit the remote effects spatial process (RESP) model

Description Usage Arguments Examples

View source: R/stFit.R

Description

Fit the remote effects spatial process (RESP) model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
stFit(
  stData = NULL,
  priors,
  maxIt,
  X = stData$X,
  Y = stData$Y,
  Z = stData$Z,
  coords.s = stData$coords.s,
  coords.r = stData$coords.r,
  rw.initsd = NULL,
  returnll = T,
  miles = T,
  C = 1,
  alpha = 0.44,
  localOnly = F,
  varying = F,
  remoteOnly = F,
  coords.knots
)

Arguments

stData

Object with class 'stData' containing data needed to fit this model. The data need only be manually entered if not using a stData object.

priors

A list containing parameters for the prior distributions. The list needs to contain the following values

beta

list(Lambda=matrix) specifying the prior covariance matrix for the local effects if varying==F, otherwise list(Psi=matrix, nu=double) specifying the Inverse wishart prior distribution for the spatially varying coefficient process if varying==T.

cov.s

list(smoothness=double, range=c(min, max), variance=c(shape, rate), nugget=c(shape, rate))

cov.r

list(smoothness=double, range=c(min, max), variance=c(shape, rate), nugget=c(shape, rate))

maxIt

number of iterations to run the MCMC chain for

X

[ns, p, nt] array of design matrices with local covariates

Y

[ns, nt] matrix with response data

Z

[nr, nt] matrix with remote covariates

coords.s

matrix with coordinates where responses were observed (lon, lat)

coords.r

matrix with coordinates where remote covariates were observed (lon, lat)

rw.initsd

A list containing initial standard deviation parameters for the MCMC parameters requiring random walk updates

cov.s

list(range=double, nugget=double)

cov.r

list(range=double, variance=double, nugget=double)

returnll

TRUE to compute the model log-likelihood at each iteration

miles

TRUE if covariance matrix distances should be in miles, FALSE for kilometers

C

scaling factor used in adapting random walk proposal variances.

alpha

target acceptance rate for random walk proposals.

localOnly

TRUE to fit the model without the teleconnection effects (typically for evaluating impact of teleconnection effects)

varying

(depreceated) TRUE to fit the model with spatially varying local coefficients

remoteOnly

TRUE to fit the model without local effects. This will fit a local intercept, but will not incorporate local covariates.

coords.knots

matrix with coordinates where remote teleconnections will be based (lon, lat)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(dplyr)
library(foreach)
library(itertools)

set.seed(2018)

data("coprecip")
data("coprecip.fit")
attach(coprecip)

coprecip.fit = stFit(stData = coprecip, priors = coprecip.fit$priors, 
                     maxIt = 10, coords.knots = coprecip.fit$coords.knots)

jmhewitt/telefit documentation built on Feb. 9, 2020, 7:15 p.m.