[R-sig-Geo] Error fitting separable space-time variogram model

d.g.rossiter at utwente.nl d.g.rossiter at utwente.nl
Sat Mar 8 10:15:55 CET 2014


I am developing a tutorial on space-time geostatistics, expanding on the nice st.pdf vignette. I can successfully fit a metric variogram model to an s-t empirical variogram, but when I try to fit a separable model I get an error which I can't solve nor interpret:

"Error in vgm(1 - par[4], as.character(model$time$model[2]), par[3], par[4],  : 
   range should be positive"

A reproducible example follows. I updated all packages immediately before running this example. Thanks for your help.

System info:

> version
platform       x86_64-apple-darwin10.8.0   
arch           x86_64                      
os             darwin10.8.0                
system         x86_64, darwin10.8.0        
status                                     
major          3                           
minor          0.2                         
year           2013                        
month          09                          
day            25                          
svn rev        63987                       
language       R                           
version.string R version 3.0.2 (2013-09-25)
nickname       Frisbee Sailing             
> help(package="sp")$info[[1]][2]
[1] "Version:            1.0-14"
> help(package="spacetime")$info[[1]][2]
[1] "Version:            1.0-9"
> help(package="xts")$info[[1]][4]
[1] "Version:            0.9-7"
> help(package="gstat")$info[[1]][2]
[1] "Version:            1.0-18"


## condensed and adapted from st.pdf, 13-Feb-2013
require(sp); require(xts); require(spacetime); require(gstat)
## Germany & neighbours air quality
data(air)
rr <- rural[, "2005::2010"]
na.stations <- which(apply(as(rr, "xts"), 2, function(x) all(is.na(x))))
r5to10 <- rr[-na.stations,]
vst <- variogram(PM10 ~ 1, r5to10[,1:200])
plot(vst, map=FALSE)
## code from p. 8 of st.pdf
vgm.sep <- vgmST(stModel="separable",
                 space=vgm(0.9,"Exp", 123,0.1),
                 time=vgm(0.9,"Exp", 2.9, 0.1),
                 sill=60)
vgmf.sep <- fit.StVariogram(vst, vgm.sep, method = "L-BFGS-B") ## gives an error
## "Error in vgm(1 - par[4], as.character(model$time$model[2]), par[3], par[4],  : 
##  range should be positive"

## my system and package info
version
help(package="sp")$info[[1]][2]
help(package="spacetime")$info[[1]][2]
help(package="xts")$info[[1]][4]
help(package="gstat")$info[[1]][2]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20140308/80d9c668/attachment.bin>


More information about the R-sig-Geo mailing list