simulate_stacking_data: Simulate data for unit testing

Description Usage Arguments Value

Description

Simulate data to test stacking functions

Usage

1
2
3
4
simulate_stacking_data(seed = 1, n_ntv = 2, n_tv = 5, n_cells = 10000,
  n_datapoints = length(years) * 100, years = 2000:2016,
  year_weights = rep.int(1/length(years), length(years)),
  family = "gaussian", fraction_weighted = 0.2)

Arguments

seed

numeric. to be a random seed

n_tv

numeric. number of time varying covariates to include

n_cells

numeric. number of cells in the underlying rasters. sqrt(n_cells) must return an integer

n_datapoints

numeric. number of datapoints to return

years

numeric. vector of the years to be represented

year_weights

numeric. Vector of weights (with length(year_weights) == to length(years)) for stratified sampling of datapoints. NULL implies no year based stratification, while the value implies the number of data points (e.g. weight * n_datapoints) for a given year.

family

character. Statistical family of the output. Currently only biomial and gaussian are supported

fraction_weighted

numeric. Specifies the fraction of the dataset should have a weight 0<x<1

n_ntc

numeric. number of non time varying covariates

Value

a data set and corrosponding rasters


dahcase/mbgstacking documentation built on May 20, 2019, 4:08 p.m.