[R] issues with krige function

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Wed Oct 31 15:28:57 CET 2012


Dear Adrienne,

What is the output of summary(casestudy) and summary(gridmeta)?

What happens if you set nmax to 10?
krige(formula=bias~1,locations=~lon+lat,data=casedata,newdata=gridmeta ,model=v.fit, nmax = 10)

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx at inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey


-----Oorspronkelijk bericht-----
Van: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Namens Adrienne Wootten
Verzonden: dinsdag 30 oktober 2012 18:36
Aan: r-help at r-project.org
Onderwerp: [R] issues with krige function

Greetings all,

Ran into a strange problem with the krige function from geoR.  The problem that I am having is that while the krige function seems to work well, the resulting predicted values are all NAs.  Given the size of the datasets I am working with can't attach it, but I can provide snippets of the datasets.

> casedata
   station year month day  obs         mpe        bias type      lat       lon
140  319147 2011     8  28 0.00 0.000000000  0.00000000 COOP 35.48667 -82.96833
141  319354 2011     8  28 0.02 0.001305799 -0.01869420 COOP 34.25722 -78.68722
142  319357 2011     8  28 0.00 0.045194085  0.04519409 COOP 34.40944 -78.79139
143  319440 2011     8  28 6.92 5.530313974 -1.38968603 COOP 35.85278 -77.03056
144  319461 2011     8  28 0.98 0.949224103 -0.03077590 COOP 34.14250 -77.87861
145  319467 2011     8  28 0.30 1.492852601  1.19285260 COOP 34.32083 -77.92056
146  319476 2011     8  28 2.95 3.284362345  0.33436235 COOP 35.69389 -77.94556
147  319555 2011     8  28 0.00 0.000000000  0.00000000 COOP 36.13083 -81.22750
148  319667 2011     8  28 0.00 0.014472943  0.01447294 COOP 35.85583 -80.36083
149  319675 2011     8  28 0.00 0.000000000  0.00000000 COOP 36.13056 -80.54806

> v.fit =
> vgm(phi=1.2914,model="Mat",range=14.1611,nugget=0.23,kappa=83.1047)
> krige.pred.out =
> krige(formula=bias~1,locations=~lon+lat,data=casedata,newdata=gridmeta
> ,model=v.fit)
[using ordinary kriging]

> krige.pred.out
   lon      lat var1.pred var1.var
1  -86.28771 33.91335       NaN      NaN
2  -86.27388 33.94722       NaN      NaN
3  -86.26003 33.98111       NaN      NaN
4  -86.24615 34.01500       NaN      NaN
5  -86.23225 34.04890       NaN      NaN
6  -86.21835 34.08280       NaN      NaN
7  -86.20441 34.11672       NaN      NaN
8  -86.19045 34.15064       NaN      NaN
9  -86.17648 34.18457       NaN      NaN
10 -86.16249 34.21851       NaN      NaN

>  summary(krige.pred.out)
      lon              lat                 var1.pred        var1.var
 Min.   :-86.29   Min.   :30.51   Min.   : NA     Min.   : NA
 1st Qu.:-82.38   1st Qu.:33.73   1st Qu.: NA     1st Qu.: NA
 Median :-79.88   Median :35.22   Median : NA     Median : NA
 Mean   :-79.91   Mean   :35.26   Mean   :NaN     Mean   :NaN
 3rd Qu.:-77.48   3rd Qu.:36.76   3rd Qu.: NA     3rd Qu.: NA
 Max.   :-73.16   Max.   :40.16   Max.   : NA     Max.   : NA
                                               NA's   :44408   NA's   :44408


Any ideas are greatly appreciated, I'm not getting any warnings or errors from krige, so this is perplexing to me.

--
Adrienne Wootten
Graduate Research Assistant
State Climate Office of North Carolina
Department of Marine, Earth and Atmospheric Sciences North Carolina State University

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
* * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * *
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.




More information about the R-help mailing list