[R-sig-Geo] spatio-temporal kriging

Saman Monfared samanmonfared1 at gmail.com
Mon Aug 6 13:15:02 CEST 2012


Dear all.
I try to perform spatio-temporal kriging.
I calculate empirical variogram in 9 spatial and 5 temporal lags.
I have fitted a non-seperable (Gneithing-model) spatio-temporal
covariance function as below:


h<-1:9
u<-1:5
B<-matrix(fit$variogramst,nrow=9,ncol=5)
f<-function(theta){
A<-matrix(1,length(h),length(u))
for(i in 1:length(h)){
for(j in 1:length(u)){
A[i,j]<-((theta[1]^2)/((1+theta[2]*abs(u[j])^(2*theta[3]))^(theta[4]*theta[5]/2))
*exp((-theta[6]*h[i]^(2*theta[7]))/((1+theta[2]*abs(u[j])^(2*theta[3]))^(theta[4]*theta[7]))))

}
}
z<-sum((A-B)%*%var(B)%*% t(A-B))
return(z)
}
theta1<-c(1,1,1,1,.5,.5,.5)
f(theta1)
ss<-optim(theta1,f,method ="L-BFGS-B",lower =c(0,0,0,0,0,0,0), upper
=c(Inf,Inf,1,1,Inf,Inf,1) )
theta<-ss$par
x<-h
y<-u
f1<-function(x,y){
sig<-(theta[1]^2)
r<-((theta[1]^2)/((1+theta[2]*abs(y)^(2*theta[3]))^(theta[4]*theta[5]/2))
*exp((-theta[6]*x^(2*theta[7]))/((1+theta[2]*abs(y)^(2*theta[3]))^(theta[4]*theta[7]))))
}
z<-outer(x,y,f1)
persp(x,y,z,theta=45,phi=45,nticks =10,,r = sqrt(16),d =2,expand=.5,
col = "lightblue",shade = 0.75,ltheta =20)

I have some problems:
1.How can I make a spatio-temporal grid for prediction in new space
time locations?
2.How can I perform krigimg methods?
indeed I don't know how calculate weight and covariance matrix for prediction.

thanks for your help.

-- 
Saman Monfared
Msc, Department of Statistics, Shiraz University,
Shiraz 71454, Iran
Email: Samanmonfared1 at gmail.com

Tel: +98 917 5305167



More information about the R-sig-Geo mailing list