[R-sig-Geo] formula understanding

Anna Gretschel ana-lee at web.de
Thu Feb 24 23:38:19 CET 2011


Am 24.02.2011 23:19, schrieb Edzer Pebesma:
>
> On 02/24/2011 09:40 PM, Anna Gretschel wrote:
>> Dear List,
>>
>> The following formula is given for a spherical model in variofit (geoR).
>>
>> /rho(h) = 1 - 1.5 * (h/phi) + 0.5(h/phi)^3 if h<  phi , 0 otherwise
>>
>> /Could anyone explain what the term "if h<phi, 0 otherwise" means? Which
>> part of the equation becomes 0 if h>phi?
> rho(h)
>
>> And shouldn't there be a * between 0.5 and (h/phi)?
> That would have been consistent, but as this is documentatation, I don't
> think it is wrong.
>
>> Thanks in advance,
>> Anna
>>
>> 	[[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
Thank you! If you don't mind I would like to ask you another question:
I want to use this function to calculate a rmse (root mean square error) 
for my fitted models.

obs beeing the observed data (in my case variog$v) and pred beeing the 
predicted data I use the following formula:

rmse <- function(obs, pred) sqrt(mean((obs-pred)^2))

pred I calculated like this:

pre<- 1 - 1.5 * (h/phi) + 0.5(h/phi)^3 if h<  phi , 0 otherwise
with phi beeing the range and h beeing the distances (variog$u)



The output however is not reliable so I think I made a mistake but 
cannot figure out what is wrong. Do you have an idea what I where the 
error is in reasoning?

Thank you so much for allways replying to my beginners questions :)
Anna



More information about the R-sig-Geo mailing list