sp: Defining spatially varying coefficients in the formula

Description Usage Arguments See Also Examples

View source: R/useful_commands.R

Description

This function is used to define spatially varying coefficients within the formula for the Gaussian process spatio-dynamic and spatially varying coefficient process models.

Usage

1
sp(x)

Arguments

x

The variable/covariate for which spatially varying coefficient is defined.

See Also

GibbsDyn, tp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
##

###########################
## Attach library spTimer
###########################

library(spTDyn)

###########################
## The GP models:
###########################

##
## Model fitting
##

# Read data 
data(NYdata); 

# Define the coordinates
coords<-as.matrix(unique(cbind(DataFit[,2:3])))

# MCMC via Gibbs using default choices
set.seed(11)
post.gp <- GibbsDyn(formula=o8hrmax ~cMAXTMP+WDSP+sp(RH),   
         data=NYdata, coords=coords, scale.transform="SQRT")
print(post.gp)

spTDyn documentation built on Nov. 17, 2017, 5:04 a.m.