[R-sig-Geo] How to use gstat 'variogram' function for nonlinear formulae?

Edzer Pebesma edzer@pebe@m@ @ending from uni-muen@ter@de
Wed Jul 4 18:28:21 CEST 2018



On 07/04/2018 06:14 PM, Joelle k. Akram wrote:
> Dear all,
> 
> 
> For a linear model I use the 'variogram' function in gstat as follows:
> 
> 
> coordinates(data) <- c('x','y')
> myvario <- variogram(dep~var1+var2+var3, data)
> 
> Now, I have the following Nonlinear formula that I want to use in variogram.
> 
> dep~ var1*var2^3

This is still a linear model.

> 
> 
> My 2 questions are:
> 
> i) Can the variogram function in gstat handle nonlinear models as this formula?
> 
> ii) What is the syntax to use this nonlinear formulae within the variogram function? is it simply :
> 
> myvario <- variogram(dep~ var1*var2^3, data)

I think that like in other areas of R you'll have to use

myvario <- variogram(dep~ var1*I(var2)^3, data)

Note that the * will be interpreted as indicating you want main effects
and an interaction, not simply the product of var1*var3^3; see ?formula

> 
> Any advice is appeciated.
> 
> 
> cheers
> 
> Chris Akram
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Edzer Pebesma
Institute for Geoinformatics
Heisenbergstrasse 2, 48151 Muenster, Germany
Phone: +49 251 8333081



More information about the R-sig-Geo mailing list