View source: R/gboot_variogram.R
gboot_variogram | R Documentation |
Perform a boostrap based on error from the fitted model of the variogram.
gboot_variogram(data,var,model,B)
data |
object of the class geodata. |
var |
object of the class variogram. |
model |
object of the class variomodel. |
B |
number of the bootstrap that will be performed (default B=1000). |
The algorithm for the bootstrap variogram is the same presented for
Davison and Hinkley (1997) for the non linear regression. We can write the
variogram as \hat \gamma(h) = \gamma_{mod}(h)+\epsilon
, where \gamma_{mod}(h)
is the fitted model. The steps of the algorithm are:
Set h^*=h
;
Sample with replacement \epsilon^*
from \epsilon - \bar \epsilon
;
The new variogram will be \gamma^*(h^*) = \gamma_{mod}(h)+\epsilon^*
;
Calculate and save the statistics of interest;
Return to step 2 and repeat the process at least 1000 times.
variogram_boot gives the variogram of each bootstrap.
variogram_or gives the original variogram.
pars_boot gives the estimatives of the nugget, sill, contribution, range and practical range for each bootstrap.
pars_or gives the original estimatives of the nugget, sill, contribution, range and practical range.
Invalid arguments will return an error message.
Diogo Francisco Rossoni dfrossoni@uem.br
Vinicius Basseto Felix felix_prot@hotmail.com
DAVISON, A.C.; HINKLEY, D. V. Bootstrap Methods and their Application. [s.l.] Cambridge University Press, 1997. p. 582
# Example 1
## transforming the data.frame in an object of class geodata
data<- as.geodata(soilmoisture)
points(data) ## data visualization
var<- variog(data, max.dist = 140) ## Obtaining the variogram
plot(var)
## Fitting the model
mod<- variofit(var,ini.cov.pars = c(2,80),nugget = 2,cov.model = "sph")
lines(mod, col=2, lwd=2) ##fitted model
## Bootstrap procedure
boot<- gboot_variogram(data,var,mod,B=10)
## For better Confidence interval, try B=1000
gboot_CI(boot,digits = 4) ## Bootstrap Confidence Interval
gboot_plot(boot) ## Bootstrap Variogram plot
# Example 2
## transforming the data.frame in an object of class geodata
data<- as.geodata(NVDI)
points(data) ## data visualization
var<- variog(data, max.dist = 18) ## Obtaining the variogram
plot(var)
## Fitting the model
mod<- variofit(var,ini.cov.pars = c(0.003,6),nugget = 0.003,cov.model = "gaus")
lines(mod, col=2, lwd=2) ##fitted model
## Bootstrap procedure
boot<- gboot_variogram(data,var,mod,B=10)
## For better Confidence interval, try B=1000
gboot_CI(boot,digits = 4) ## Bootstrap Confidence Interval
gboot_plot(boot) ## Bootstrap Variogram plot
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.