vg_calc: Perform variogram analysis on 'bfastSpatial()' shift and...

Description Usage Arguments Details Value Examples

View source: R/vg_calc.R

Description

This function uses the gstat package to compute variogram statistic for the shift and slope output from bfastSpatial output. This function uses the exponential variogram model.

Usage

1
2
vg_calc(bfast_in, boundary = NULL, template, cutoff_dist = NULL,
  mc.cores = 6)

Arguments

bfast_in

A data frame generated by bfastSpatial().

boundary

A SpatialPolygons object defining the boundary of the variogram analysis. If this argument is not supplied, all records in bfast_in will be used.

template

A Raster object with the same resolution, extent, and projection as the raster dataset used to generate bfast_in. Alternatively, an XML file generated by create_raster_metadata().

cutoff_dist

An optional data frame containing the output of pcf_calc() for the same study area.

mc.cores

A numeric indicating the number of cores to be used in parallel computing.

Details

This function returns a data frame with the following fields:

  1. year: The year of the observation.

  2. month: The month of the observations.

  3. stat: The BFAST statistics ("slope" or "shift")

  4. model: The variogram model ("Nug" or "Exp")

  5. psill: The partial sill.

  6. range: The range parameter of the model. Only valid for Exp model.

  7. effective_range: The effective range of the model (within 5 sill). Only valid for Exp model.

  8. SSerr: The sum of squared errors of the model from the sample variogram.

  9. n: The number of points in the sample variogram.

If the variogram model is singular or does not converge after 200 iterations, no model is fit and NAs are returned for the entire row. Since this function tries to fit a large number of models, it may fail to fit a substantial proportion of models if the sample variograms do not match the model well (or require transformation).

Value

A data frame with variogram results.

Examples

1
2
3
4
## Not run: 
vg_calc(bf_df, boundary=rgdal::readOGR(dsn="C:/Desktop/shapefiles", layer="Mojave"), template="C:/Desktop/raster_metadata.xml", cutoff_dist=pcf_results, mc.cores=6)

## End(Not run)

jnghiem/bfasttools documentation built on Nov. 4, 2019, 3:02 p.m.