[R-sig-Geo] predict() LDL error
Matevž Pavlič
matevz.pavlic at gi-zrmk.si
Mon Jul 18 08:46:32 CEST 2011
Hi Edzer, thanks for the help,
i managed to use the predict() function now. But when I try to plot the predictions using spplot() i get this error :
"Error in parse(text = x) : <text>:1:3: unexpected symbol 1: 0.pred"
Where 0.pred is the the prediction to plot.
Does anyone has any ideas to what this could mean? I've searcehd the forum, but failed to get any answers.
(attached is the code I use).
Thanks for your time, m
-----Original Message-----
From: r-sig-geo-bounces at r-project.org [mailto:r-sig-geo-bounces at r-project.org] On Behalf Of Edzer Pebesma
Sent: Friday, July 15, 2011 11:15 AM
To: r-sig-geo at r-project.org
Subject: Re: [R-sig-Geo] predict() LDL error
to remove duplicates in DF you need to replace it:
DF = remove.duplicates(DF, zero=0, remove.second = TRUE)
zerodist(DF)
On 07/15/2011 10:23 AM, Matevž Pavlič wrote:
> Hi, thanks for your time....
>
> I am sure the problem is in same locations...but i dont know why remove.duplicates() does not remove duplicates...
> When i try this :
>
>> coordinates(DF)<-~X+Y
>> zerodist(DF)
> [,1] [,2]
> [1,] 83 84
> [2,] 242 243
> [3,] 266 267
> [4,] 431 432
> [5,] 439 440
> [6,] 731 732
> [7,] 817 818
> [8,] 820 821
>
>> remove.duplicates(DF, zero=0, remove.second = TRUE)
> ...
> 1113 (99447.1, 459012) 7019 290.17 286.57 6
> 1114 (99465.2, 458975) 7022 291.97 287.27 0
> 1115 (99410, 458997) 7015 291.04 288.74 6
> 1116 (99495, 458978) 7016 290.62 288.72 6
> 1117 (99438.3, 458992) 7018 291.28 288.38 6
> 1118 (99813, 458891) 7021 290.08 285.58 0
>
>> zerodist(DF)
> [,1] [,2]
> [1,] 83 84
> [2,] 242 243
> [3,] 266 267
> [4,] 431 432
> [5,] 439 440
> [6,] 731 732
> [7,] 817 818
> [8,] 820 821
>
> it stays the same...shouln't it remove the duplicates?
>
>
> thanks, m
>
> -----Original Message-----
> From: r-sig-geo-bounces at r-project.org
> [mailto:r-sig-geo-bounces at r-project.org] On Behalf Of Edzer Pebesma
> Sent: Thursday, July 14, 2011 11:25 PM
> To: r-sig-geo at r-project.org
> Subject: Re: [R-sig-Geo] predict() LDL error
>
> The error message is an indication that you're predicting (kriging) with a singular covariance matrix. The most frequent reasons for this are duplicate observations [1] or perfect correlation in the coregionalization model [2]. For [1], see ?remove.duplicates, for [2] see argument correct.diagonal in ?fit.lmc.
>
> On 07/14/2011 06:18 PM, Matevž Pavlič wrote:
>> Hi all,
>>
>>
>>
>> i am trying to use categorical kriging for prediction of soil classes in an area. I am pretty new to using cat. kriging in R soI probably am making some beginers mistakes. Attached is a reproducable sample with sample data.
>>
>>
>>
>> When i try to use predict() i geta n error- I am pretty sure because some points are duplicated....in krige() function i use zerodist() which eliminates the LDL error, but i can't find a way to use it here....
>>
>>
>>
>> I got this code (mostly) from the net, so i have some trouble understanding it...
>>
>>
>>
>> thanks for any help and info about categorical kriging,
>>
>>
>>
>> m
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> --
> Edzer Pebesma
> Institute for Geoinformatics (ifgi), University of Münster Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251 8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de
> http://www.52north.org/geostatistics e.pebesma at wwu.de
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
--
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251 8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de
http://www.52north.org/geostatistics e.pebesma at wwu.de
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
More information about the R-sig-Geo
mailing list