[R-sig-Geo] optimize idw power

Jon Olav Skoien jon.skoien at jrc.ec.europa.eu
Tue Aug 13 15:38:50 CEST 2013


Dominik,

The brute force approach shown in the link from Tom has in the mean time 
been implemented in the intamap package. See the example for the 
function "estimateParameters".

Cheers,
Jon

On 13-Aug-13 1:54, Thomas Adams wrote:
> Dominik,
>
> Look here:
> http://r-sig-geo.2731867.n2.nabble.com/GSTAT-Optimize-power-value-for-IDW-td2765918.html
>
> Tom
>
>
> On Mon, Aug 12, 2013 at 5:17 PM, Dominik Schneider <
> Dominik.Schneider at colorado.edu> wrote:
>
>> Hi,
>> I'd like to optimize the IDW power, similar to what ArcGIS does. I found
>> this old thread
>> http://www.mail-archive.com/r-sig-geo@stat.math.ethz.ch/msg04011.html but
>> was hoping someone could help adapt the solution. I am using
>>
>>
>> idw(residuals(mdl.stepaic[[j]])~1,locations=swe.nozeros[swe.nozeros$mth==mth
>> & swe.nozeros$yr==yr,],newdata=swe.grid)
>>
>> where mdl.stepaic[[j]] is a list of 39 regression equations. swe.nozeros is
>> a spatialpointsdataframe of observations. swe.grid is a grid where I want
>> new values predicted. I currently run this idw command through a loop of j
>> with no problems but I'd like to optimize both within each equation
>> represented by j and for the whole data set (so across the 39 timesteps).
>>
>> Below is what I'm starting with but I don't really understand how to get it
>> working. I appreciate your help.
>>
>> f= function(idp,formula,locations,newdata,...) {
>>
>> sum(idw(formula,locations,newdata),set=list(debug=0,idp=idp),...)$residuals**2
>> }
>>
>> optimize(f,interval=seq(1.4,1.7,by=0.1),formula=residuals(mdl.stepaic[[j]])~1,locations=swe.nozeros[swe.nozeros$mth==mth
>> & swe.nozeros$yr==yr,],newdata=swe.grid)
>>
>>          [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo


-- 
Jon Olav Skøien
Joint Research Centre - European Commission
Institute for Environment and Sustainability (IES)
Land Resource Management Unit

Via Fermi 2749, TP 440,  I-21027 Ispra (VA), ITALY

jon.skoien at jrc.ec.europa.eu
Tel:  +39 0332 789206

Disclaimer: Views expressed in this email are those of the individual and do not necessarily represent official views of the European Commission.



More information about the R-sig-Geo mailing list