Page 1 of 1

[SOLVED] Kriging: mean and CV is NA

PostPosted: Mon Feb 22, 2016 2:40 pm
by carolang
Hello,
I have participated in the course of geostatistics and I am recently using the package and running an example code for estimation biomass, my problen is when I run the follow line:

### Kriged mean
global.mk=global(db.c1, model = vg.fit, uc=c("1"), polygon = db.poly,
calcul = "krige", flag.polin=T, flag.wgt=T, ivar = 1)
cat("Kriged.mean= ",round(global.mk$zest,2),"; CV.geo= ",round(global.mk$cv,3),"\n")

Results show me an error in the mean and CV giving a value of NA, I have checked the data, the function, etc. and I donĀ“t find answer for this problem.
Another question is: Does The package RGeostats have some constraints on number of samples to estimate the kriging mean and variances as do EVA software???

Any suggestions I will appreciate so much,

Re: Kriging: mean and CV is NA

PostPosted: Mon Feb 22, 2016 9:17 pm
by Didier Renard
Hello

I checked that the procedure gives a correct result. There must be a slight problem in the input.
Please check the contents of:
- db.c1: check that the data (the Z-locator variable) is correctly defined. Does it contain any NA value. Are the coordinates all defined
- Could db.c1 contain samples located at the same location (duplicates)
- Could the polygon be mis-located (so as no data point sits within the polygon).

Sorry but this are the only tracks that I can figure out. Otherwise send us the data (db.c1, vg.fit and db.poly).
For this you can run db.write(db.c1) or poly.write(poly.data) and model.write(vg.fit). These commands will create ASCII files that you can simply send by mail.

Cheers

Re: Kriging: mean and CV is NA

PostPosted: Tue Feb 23, 2016 12:54 pm
by carolang
Didier Hi, Nice to hear from you!!
Well I checked all the answers and you were right!! I had duplicated coords, maybe it could be good make a function in RGeostats to identify these points, or Message that say "duplicated coords".....

Cheers,

Re: Kriging: mean and CV is NA

PostPosted: Wed Feb 24, 2016 9:07 am
by Fabien Ors
Hello

This function exists already :-)
Please, have look here :
http://rgeostats.free.fr/html/duplicate.html

Cheers,