uhcdatasimulator: uhcdatasimulator

Description Usage Arguments Details Value See Also Examples

Description

uhcdatasimulator simulates the data used in Fieberg et al. (In Review)

Usage

1
uhcdatasimulator(nused, navail, betas, corx, ntemp, example)

Arguments

nused

The number of used locations in training/test data set

navail

The number of background locations in training/test data set

betas

The vector of length 2 for *true* probability of use

corx

The correlation between elevation and precipitation in training/test dataset. For missing predictor example only.

ntemp

A large number of available points.

example

The name of the example. Options include "missing predictor" or "non-linear".

Details

This is a function that creates a dataframe based on the example chosen from the manuscript (Fieberg et al. 2018). In the first example, ("missing predictor") the distribution of a species is related to elevation (x_1) and precipitation (x_2), where x_1 and x_2 are normally distributed with mean 0 and variance 4. We considered 3 different data-generating scenarios in which we varied the correlation of x_1,x_2 (corx) in the training and test data sets. In the second example ("non-linear"), the distribution of a species is non-linearly related to temperature (x_3 \sim N(0,4)).

Value

A dataframe of simulated data

See Also

Full archive of the data and code necessary to replicate the manuscript at http://doi.org/10.13020/D6T590.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Simulate training or test data for the non-linear example
nonlinear.data <- uhcdatasimulator(nused = 100,
   navail = 10000,
   betas = c(2,-1),
   ntemp = 1000000,
   example = "non-linear")

# Simulate training or test data for the missing predictor example
   #   Where corr(x1,x2) = 0
missingpredictor.0.data <- uhcdatasimulator(nused = 100,
   navail = 10000,
   betas = c(0.5,-1),
   corx = 0,
   ntemp = 1000000,
   example = "missing predictor")

   #   Where corr(x1,x2) = -0.3
missingpredictor.N.data <- uhcdatasimulator(nused = 100,
   navail = 10000,
   betas = c(0.5,-1),
   corx = -0.3,
   ntemp = 1000000,
   example = "missing predictor")

   #   Where corr(x1,x2) = 0.3
missingpredictor.P.data <- uhcdatasimulator(nused = 100,
   navail = 10000,
   betas = c(0.5,-1),
   corx = 0.3,
   ntemp = 1000000,
   example = "missing predictor")

aaarchmiller/uhcplots documentation built on May 10, 2019, 2:05 a.m.