famuvie / geoRcb

An extension of package geoR that works with cost-based distances
GNU General Public License v3.0
4 stars 2 forks source link

Possible divergence of the method krige.conv ? #5

Closed pierromond closed 7 years ago

pierromond commented 7 years ago

Hi,

I am using your very useful code, and thank you for it !

Nevertheless, when I am using the krige.conv method, I have some problem of divergence that I don't observe using the standard krige.conv method of GeoR with the same parameters.

Adding the distance matrices give me very diverging results when the geodata set increase. For one or two points to krige on my network I don't have any problem, but when there are more than 500 points to "merge", very extreme values appear.

Did you already observe this phenomenon ? Do you have any idea about which parameters could be badly given in my function ?

krige.conv(geodata= Obs, locations = PT_gd$coords, krige=krige.control(cov.model="spherical",cov.pars=c(30,500), nugget=0), dd.dists.mat=distances, dl.dists.mat=distances_to_obs )

Thank you.

Kind regards,

Pierre

P.S. I checked my distance matrices and they seems to be ok.

famuvie commented 7 years ago

Hi Pierre, thanks for your comments. It is hard to say without looking at the data. I have not observed the problem you report. Here are some questions/things to check:

Best wishes ƒacu.-

pierromond commented 7 years ago

You are alright,

I will try to precise my question.

Maybe could I share some part of code and data with you ?

Greetings,

Pierre

famuvie commented 7 years ago

Strange, since no matter the number of observations, any prediction ends up being a weighted average of your observations. Are you sure there are no errors in you larger set of measurements?

I can have a look if you want, but I don't guarantee anything, since I am very short of time these days.

pierromond commented 7 years ago

I tried to find errors in my set but I didn't. And because it works with the standard Krige.conv, it lets me think that it come from another source of errors. Maybe distance matrices, but I can't find.

Joined you can find a extract of my data set and script with my comments (Test.R and test.Rdata). If you can find some time, it could be great, I tried to send you the more condensed version of my script! By the way, I will continue to check my code, and read again your publication to find my mistake.

R.zip

Thank you again,

Pierre Best wishes,

Pierre

pierromond commented 7 years ago

Hi,

Finally, I used exactly the same data format than you and now it works.

Thank you a lot for your work ! and I will close the issue.

Best wishes,

Pierre

famuvie commented 7 years ago

Ops, you were faster than me :) What do you mean by data format? What was the problem then?

pierromond commented 7 years ago

I don't really understand where was my mistake, because I am using exactly the same datas. But for example, I was not using the function coordinates() to give my locations, and maybe my data frame was not the good one, or sthg like that...