splineMPST: Median polish Spline.

Description Usage Arguments Value References Examples

Description

The "splineMPST" is designed to represent the variability of spatio - temporal effects on a surface, from robust median polish algorithm and planar interpolation.

Usage

1
splineMPST(Grid,Ef_t,MPST,eps, maxiter)

Arguments

Grid

grid with the coordinates in space "x", "y", "z", where will be viewed trend.

Ef_t

temporal scenary to look trend.

MPST

object of class ConstructMPst.

eps

real number greater than 0, default 0.01. A tolerance for convergence.

maxiter

the maximum number of iterations, default 10.

Value

Data frame, where columns show the trend in each spatio - temporal location.

References

Martínez, W. A., Melo, C. E., & Melo, O. O. (2017). Median Polish Kriging for space–time analysis of precipitation Spatial Statistics, 19, 1-20. [link]

Berke, O. (2001). Modified median polish kriging and its application to the wolfcamp - aquifer data. Environmetrics, 12(8):731-748.[link]

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
## Not run:
library(zoo)
library(sp)
library(spacetime)
data(Metadb)
#records of monthly precipitation from january 2007 to january 2010
Metadb<-Metadb[,c(1:4,89:125)]
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")
length(time)

MPST<-ConstructMPst(Metadb[,-c(1:4)],time,pts=Metadb[,2:4],Delta=c(7,6,5))

MpSTData<-MedianPolishM(MPST,eps=0, maxiter=2, na.rm=TRUE)
plot(MpSTData)
data(DemMeta)
xy = SpatialPoints(Metadb[,2:4],CRS(proj4string(DemMeta)))

data(HZRMeta)

polygon1 = polygons(HZRMeta)
Gridxy<- spsample(polygon1, cellsize=3000, n=300,"regular")

Grid<-data.frame(Gridxy,over(Gridxy,DemMeta))
colnames(Grid)<-c("East", "North","height")

TendenciaGrilla<-splineMPST(Grid,Ef_t=time[16:21],MPST,eps=0.01, maxiter=2)

IDs = paste("ID",1:nrow(TendenciaGrilla))
mydata = data.frame(values = TendenciaGrilla[,5], ID=IDs)
wind.ST1 = STFDF(SpatialPixels(Gridxy),time[16:21],mydata)
stplot(wind.ST1,col.regions=bpy.colors(40),par.strip.text = list(cex=0.7)
      ,main="Spline median polish: Monthly Precipitation")
## End(Not run)

STMedianPolish documentation built on May 2, 2019, 10:14 a.m.