estimateBetaFields: Regression Estimates of beta-Fields

Description Usage Arguments Value Author(s) See Also Examples

View source: R/STdata_processing.R

Description

Estimates the latent-beta fields for a STdata/STmodel object by regressing the observations for each site on the temporal trends.

Usage

1

Arguments

STdata

A STdata/STmodel object containing observations. Use either this or the obs, date, and ID inputs.

subset

A subset of locations for which to estimate the beta-fields. A warning is given for each name not found in ID.

Value

A list with two matrices; the estimated beta-coefficients and standard deviations of the estimates.

Author(s)

Johan Lindstrom

See Also

Other data matrix: SVDmiss, SVDsmooth, createDataMatrix, mesa.data.raw

Other STdata functions: c.STmodel, createDataMatrix, createSTdata, createSTmodel, detrendSTdata, removeSTcovarMean, updateTrend.STdata

Other STmodel functions: createCV, createDataMatrix, createSTmodel, dropObservations, loglikeSTdim, loglikeST, predictNaive, processLUR, processLocation, updateCovf, updateTrend.STdata

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
28
29
30
31
32
33
34
35
36
37
38
require(plotrix)

##load data
data(mesa.model)

##Regression based estimate of the beta-fields
beta <- estimateBetaFields(mesa.model)

##check regression coefficients
summary(beta$beta)

##or plot as a function of distance to coast,
##with uncertainties
par(mfrow=c(2,2))
for(i in 1:3){
  plotCI(mesa.model$LUR[[1]][,"log10.m.to.a1"], beta$beta[,i],
         uiw=1.96*beta$beta.sd[,i],
         ylab=colnames(beta$beta)[i])
}

##or compare to the fields from predict.STmodel
data(pred.mesa.model)

##Study the results
##Start by comparing beta fields
par(mfcol=c(1,1), mar=c(4.5,4.5,2,.5), pty="s")
plotCI(x=beta$beta[,1], y=pred.mesa.model$beta$EX[,1],
       uiw=1.96*sqrt(pred.mesa.model$beta$VX[,1]),
       main="Temporal Intercept",
       xlab="Empirical estimate",
       ylab="Spatio-Temporal Model")
plotCI(x=beta$beta[,1], y=pred.mesa.model$beta$EX[,1],
       uiw=1.96*beta$beta.sd[,1], add=TRUE, err="x")
abline(0,1,col="grey")

##or just the regression part of the beta fields
points(x=beta$beta[,1], y=pred.mesa.model$beta$mu[,1],
       col=2, pch=19)

SpatioTemporal documentation built on June 25, 2018, 9:03 a.m.