Learn R Programming

STMedianPolish (version 0.1)

removetrendMPst: Median polish trend

Description

Direct method to remove trend of spatio - temporal data througth median polish.

Usage

removetrendMPst(MPST,eps=0.01, maxiter=10L)

Arguments

MPST
object of class ConstructMPst
eps
real number greater than 0, default 0.01. A tolerance for convergence of median polish.
maxiter
the maximum number of iterations. Default 10.

Value

  • data.frame with the following fields:
  • ETindicate the time of a observation
  • xspatial coordinates x
  • yspatial coordinates y
  • zspatial coordinates z
  • Trendtrend calculated through median polish space - time
  • Valueobserved values
  • Residual$Residual = Value-Trend$

Details

Robust method introduced for Cressie(1993) and enhanced by Berke(2001) to remove trend of a space - time process with data $\left{y(\mathbf{s}_{abc},t), a=1,...,U; b=1,...,V; c=1,...,W, t=1,...,n \right}$ $$Y(\mathbf{s}_{abc},t)= \mu_{y}(\mathbf{s}_{abc},t) + \delta _{abct}$$ where $$\mu _{y}(\mathbf{s}_{abc},t)= \mu +\alpha _{a} + \beta _{b} + \xi _{c} + \tau _{t}$$ and $\delta _{abct}$ is a fluctuation arising from natural variability and from the measurement process. Additionally, $\mu$ is an overall mean, $\alpha_{a}$ is the $a$-th row effect, $\beta_{b}$ is the effect $b$-th column effect, $\xi_{c}$ is the $c$-th layer effect, $\tau _{t}$ is the $t$-th time effect.

References

Berke, O. (2001). Modified median polish kriging and its application to the wolfcamp - aquifer data. Environmetrics, 12(8):731-748.http://onlinelibrary.wiley.com/doi/10.1002/env.495/abstract{[link]} Cressie, N. (1993). Statistics for spatial data. Wiley series in probability and statistics.http://www.wiley.com/WileyCDA/WileyTitle/productCd-1119115183.html{[link]}

Examples

Run this code
## Not run:
data(Metadb)
x<-matrix(0,1,37)
for(i in 1:37){
 x[,i] <- 2007 + (seq(0, 36)/12)[i]
}
x<-as.Date (as.yearmon(x), frac = 1)
time = as.POSIXct(x, tz = "GMT")

MPST<-ConstructMPst(Metadb[,-c(1:4)],time,pts=Metadb[,2:4],Delta=c(7,6,5))
residuals<-removetrendMPst(MPST,eps=0.01, maxiter=2)
## End(Not run)

Run the code above in your browser using DataLab