spatial - How to fit model with semivariogram using gstat in R? -


i have csv file file contains atmospheric pm10 concentration data of 1 march,12.00 pm.please, download. want draw semivariogram using gstat package in r. tried write these code in r. these data, cant fit model.

    library(sp)     library(gstat)      seoul3112<-read.csv("seoul3112.csv")     seoul3112<-na.omit(seoul3112)      g<-gstat(id="pm10",formula=pm10~lon+lat,location=~lon+lat,              data=seoul3112)     seoul3112.var<-variogram(g,width=0.04,cutoff=0.6)     seoul3112.var     plot(seoul3112.var, col="black", pch=16,cex=1.3,          xlab="distance",ylab="semivariance",          main="omnidirectional variogram seoul 3112")  model.3112<- fit.variogram(seoul3112.var,vgm(700,"gau",0.5,200), fit.method = 2)     plot(seoul3112.var,model=model.3112, col="black", pch=16,cex=1.3,          xlab="distance",ylab="semivariance",          main="omnidirectional variogram seoul 3112") 

actually beginner in r , statistics. so, ignorant variogram. have query :

a)when plot data semivariogram, looks different not typical semivariogram! why happening? should other thing data transforming?

b)how can fit model data? have tried different model "sph","exp" linear! why?

c)how can understand initial value of sill,range,nugget should use in vgm() function?

d)how can understand model fits data properly?

e)for using kriging, kind of semivariogram should plot? omnidirectional semivariogram? or should plot directional semivariogram?

f)and how can interpret semivariogram? mean can understand data semivariogram?

thanks in advance.

i'll provide answers code related questions. rest of questions (d, e, , f) more theory related.

first, in comment, when changed proj4string, distance units should have changed on plot. did they? based on comment, sounds did not happen.

a) in addition playing around cutoff distance, careful of np (point-pairs) have supporting each bin on semivariogram. example, using updated proj4string information, tried cutoff=80 , width=80/10 (10 bins instead of 15) see how semivariogram shape changed. decreasing 15 10 bins not change point-pairs exist, increases distance each bin represents. also, approach not should use, it's example of how change bins smoother sample semivariograms (but smoother not mean better).

comparison of 10 bins 15 bins

b) using code, "sph" , "exp" models return warning: singular model in variogram fit. warning indicates there not enough data fit parameters of spherical , exponential empirical models. see gstat user manual guidance on each of empirical equations , parameters.

c) vgm() function can used, example, eye-fit sample semivariograms. if you're confused how plot vgm() model sample data, try like

eye_vgm = vgm(psill=1200,model="gau",range=60,nugget=350) plot(seoul3112.var,model=eye_vgm, col="black", pch=16,cex=1.3) 

you're using vgm() in call fit.variogram(), long parameters give vgm() reasonable (e.g. based on sample data) , empirical model can have parameters fitted, fit.variogram() find fit according fit.method.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -