spVariofit: Fit a variogram model

Description Usage Arguments Details Value See Also Examples

View source: R/spVariofit.R

Description

Fit a parametric model to a variogram created by the function spVariog.

Usage

1

Arguments

x

an object of class spVariog.

...

further arguments to be passed to variofit function.

Details

This function is a wrapper to variofit and can be used to fit a parametric model to a variogram using either ordinary least squares or weighted least squares. It takes as the main argument a spVariog object and others arguments should be passed to ... such as "cov.model" and so on.

Value

an object of class SpVariofit which is a list containing the following components:

mod

an object of class variofit

data.geo

an object of class geodata

des.mat

the design matrix

trend

a character specifying the type of spatial trend

See Also

variofit

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data("crd_simulated")
dados <- crd_simulated

#Geodata object
geodados <- as.geodata(dados, coords.col = 1:2, data.col = 3,
                      covar.col = 4)
h_max <- summary(geodados)[[3]][[2]]
dist <- 0.6*h_max

# Computing the variogram
variograma <- spVariog(geodata = geodados,
                      trend = "cte", max.dist = dist, design = "crd",
                      scale = FALSE)

plot(variograma, ylab = "Semivariance", xlab = "Distance")

# Spherical Model
ols1 <- spVariofit(variograma, cov.model = "spherical", weights = "equal",
                  max.dist = dist)
lines(ols1)

lrcastro/spANOVA documentation built on Aug. 21, 2019, 11:45 a.m.