Re: [R-sig-Geo] R: GSTAT: Optimize power value for IDW (Paul Hiemstra approach)

2008-12-02 Thread Edzer Pebesma
Hi Zev, There's no need to brute force, as optimize is there to help you -- my guess is that the function is convex. The following takes a while: > f = function(idp, formula, data,...) sum(krige.cv(formula,data,set=list(debug=0,idp=idp),...)$residual**2) > optimize(f, interval=c(0.01,4), for

Re: [R-sig-Geo] R: GSTAT: Optimize power value for IDW (Paul Hiemstra approach)

2008-12-02 Thread Zev Ross
Hi All, Thanks to Paul and Alessandro for their suggestions. Paul's code (brute force) worked well for me and the results match up well with ArcGIS. I'm not using a large dataset so the speed isn't an issue but with a larger dataset it would be. In ArcGIS the optimization is instantaneous so c

[R-sig-Geo] R: GSTAT: Optimize power value for IDW (Paul Hiemstra approach)

2008-12-02 Thread Alessandro
Hi Normally I use the R+SAGA to calculate the IDW and create a raster, with this follow code. I change the radius input with a loop formula to create several raster and after check the best result (I am studying a oak forest with low density) radii.list <- as.list(c(5, 10, 15, 20, 25, 30)) for