[R] issues with krige function

Adrienne Wootten amwootte at ncsu.edu
Tue Oct 30 18:35:32 CET 2012


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



More information about the R-help mailing list