simOpenSCRsex: Simulate data from a Open population SCR study with sex (or...

Description Usage Arguments Value Author(s)

View source: R/simOpenSCRsex.R

Description

This function simulates data from an open population SCR model.

Usage

1
2
3
4
5
6
simOpenSCRsex(N = cbind(c(30, 30), c(35, 45, 55)), psex = 0.5,
  pIDsex = 0.75, gamma = NULL, phi = rep(0.8, 2), lam0 = rep(0.2,
  2), sigma = rep(0.5, 2), K = rep(10, 3), X = X, t = 3, M = M,
  sigma_t = NULL, buff = 3, obstype = "bernoulli",
  ACtype = "fixed", vertices = NA, maxprop = 10000, dSS = NA,
  primary = NA)

Arguments

N

a 1 x 2 vector or t x 2 matrix indicating the number of individuals to simulate. Column 1 is males, column 2 is females. If only the first primary period is entered, provide one gamma (or two if sex-specific) to determine E[N] in subsequent primary periods to simulate realized N, a random variable. Otherwise, nrow(N)=t, with t being the number of primary periods. Do not enter a gamma if N for all primary periods is specified.

psex

a numeric indicating the probability a row of z (M x t) used for simulation will be male. This does not determine the sex ratio, but may be needed to simulate data from very sex-skewed populations without increasing M. For most populations, the default psex=0.5 should work fine.

pIDsex

a numeric indicating the probability that the sex of a captured individual is identified.

gamma

a vector containing the per capita recruitment rates between primary periods. If length 1, gamma is the same for each sex. If length 2, sexes differ (order is male, then female). Note, this is the number of males recruited per total N and number of females recruited per total N and each will be smaller than the (sex agnostic) number of individuals recruited per total N.

phi

a vector containing the survival probabilities between primary periods. If length 1, no sex difference. If length 2, sexes differ (order is male, then female).

lam0

a vector containing the detection function expected number of captures at distance 0. If length 1, no sex difference. If length 2, sexes differ (order is male, then female).

sigma

a vector containing the detection function spatial scale parameter. If length 1, no sex difference. If length 2, sexes differ (order is male, then female).

K

a vector containing the number of capture occasions in each primary period

X

a list of trap locations in each primary period. Each list element is a J[l] x 2 matrix of trap locations, with J[l] being the number of traps in each primary period.

M

an integer indicating the level of data augmentation to use during simulation. This should be larger than the total number of individuals ever alive.

sigma_t

a vector indicating the between primary period spatial scale parameter for ACtypes "metamu" "metamu2", "markov", and "markov2". If size 1, no sex difference. Otherwise, sexes differ (order is male, then female). In "markov2", sigma_t is the exponential scale parameter

buff

a numeric indicating the distance to buffer the trapping array in the X and Y dimensions to produce the state space if using a square or rectangular, continuous state space.

obstype

a character string indicating the observation model, either "bernoulli" or "poisson"

ACtype

A character indicicating the type of activity centers. "fixed" activity centers do not move between primary periods, "metamu" assumes there is a meta activity center around which the primary period activity centers distributed following a bivariate normal distribution with spatial scale parameter sigma_t. Primary period activity centers are required to stay inside the state space. "metamu2" is identitcal to "metamu" except primary period activity centers are allowed to leave the state space. markov" assumes activity centers in primary period 1 are distributed uniformly across the state space and the activy centers in primary period l+1 are a bivariate normal draw centered around the activity center in primary period l (but must stay within the state space). "markov2" is the same as "markov" except each dispersal considers the available distances to disperse to in a use vs. availability framework. Discrete state space is required. Finally, "independent" assumes animals randomly mix between primary periods. (spatial uniformity in all primary periods with independence between primary periods).

vertices

an optional list of polygon vertices to use for the state space. Each list element should be a matrix with 2 columns, corresponding to the X and Y coordinates of polygon vertices. The vertices must close the polygon (e.g. the first and last vertices should be the same). Cannot enter both vertices and dSS.

dSS

an optional (N_SS x 2) matrix of discrete state space locations. The matrix should have 2 columns corresponding to the X and Y coordinates of each state space element. Cannot enter both vertices and dSS.

primary

a vector of length T with entries 1 if the population is to be observed in primary period l and 0 otherwise.

Value

a list containing the capture history, activity centers, trap object, and several other data objects and summaries.

Author(s)

Ben Augustine


benaug/OpenPopSCR documentation built on Feb. 3, 2022, 10:04 a.m.