sim.SCR.ms: Simulate Multi-Session SCR data

View source: R/sim.SCR.ms.R

sim.SCR.msR Documentation

Simulate Multi-Session SCR data

Description

This function will simulate multi-session SCR encounter history data and also allows for simulation of individual sex data.

Usage

sim.SCR.ms(sessions = 1, sex = F, sex.ratio = 0.5, N = 100, K = 5, alpha0 = -2.5, sigma = 0.5, discard0 = TRUE, array3d = FALSE, ssRes = 0.5)

Arguments

sessions

Number of session to simulate dats for

sex

Whether of not each individual is assigned a sex. The default is no sex data.

sex.ratio

If simulating sex data, you can specify the sex ration. This is either a single value, in which case all session have the same sex ratio, or it can be a vector containing session specific sex ratios.

N

Abundance. This is either a single value, in which case all sessions have the same number of individuals, or it can be a vector containing session specific abundances.

K

Number of sampling occasion. This is either a single value, in which case all session have the same number of visits, or it can be a vector containing session specific number of occasions.

alpha0

The baseline encounter probability.

sigma

The parameters describing the spatial scale of detection.

discard0

If TRUE, indivuduals with "all-zero" encounter histtories will be removed. If FALSE, the encounter histroy data will contain th e"all-zero" encounter histories and therefore have N rows.

array3d

The encounter history data can be returned as either an individual-bytrap-by-occasion 3-D array (array3d=TRUE), or a "flat" individual-by-trap encounter frequency matrix.

ssRes

The resolution of the state-space (pixel/grid size). This value is the length of the side of a square pixel.

Examples

simdat <- sim.SCR.ms(sessions = 2, sex = F, sex.ratio = 0.5, N = 100, K = 5, alpha0 = -2.5, sigma = 0.5, discard0 = TRUE, array3d = FALSE, ssRes = 0.5)
sf <- simdat$sf
ssDF <- make.ssDF(sf,buffer=1.5,res=0.25)
out <- oSCR.fit(sf,list(~1,~1,~1,~1),ssDF)


jaroyle/oSCR documentation built on Sept. 23, 2023, 12:46 p.m.