Learn R Programming

spTDyn (version 1.0)

tp: Defining dynamic time-series coefficients in the formula

Description

This function is used to define dynamic time-series coefficients within the formula for the Gaussian process spatio-dynamic and spatio-temporal DLM.

Usage

tp(x)

Arguments

x

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

See Also

GibbsDyn, sp

Examples

Run this code
# NOT RUN {
##

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

library(spTDyn)

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

##
## Model fitting
##

# Read data 
data(DataFit); 

# 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+tp(RH),   
         data=DataFit, coords=coords, scale.transform="SQRT")
print(post.gp)

##
# }

Run the code above in your browser using DataLab