Tagloss_simulate: Return a list with the number of days different kinds of...

View source: R/Tagloss_simulate.R

Tagloss_simulateR Documentation

Return a list with the number of days different kinds of individuals are seen.

Description

Generate data with known features.
model_before is applied to par parameter.
model_after is applied after par is separated in p1, p2, pL1, pL2, pR1 and pR2 parameters.
pobservation can be a vector of daily probabilities to be captured. The last value is repeated if necessary.
The maximum number of days of observation is exp(LengthObservation["max"]).
If model="12" then par must have _1 and _2 parameters.
if model="LR" then par must have _L2, _L1, _R2, R1 parameters.

Usage

Tagloss_simulate(
  n = 500,
  par,
  pobservation = c(rep(0.05, 70), 0.01),
  LengthObservation = c(min = 0, max = 9),
  dailysurvival = 0.999,
  model = "12",
  model_before = NULL,
  model_after = NULL,
  progressbar = TRUE
)

Arguments

n

Number of individuals to simulate

par

Set of parameters

pobservation

Probability of daily observation

LengthObservation

The log of number of days of observations is a random number between min and max

dailysurvival

Daily probability of survival

model

Must be "12" or "LR"

model_before

Transformation of parameters before to use Tagloss_model()

model_after

Transformation of parameters after to use Tagloss_model()

progressbar

Is a progressbar should be shown?

Details

Tagloss_simulate returns a list with the number of days different kinds of individuals are seen.

Value

Return a list with the number of days different kinds of individuals are seen.

Author(s)

Marc Girondot marc.girondot@gmail.com

See Also

Other Model of Tag-loss: Tagloss_LengthObs(), Tagloss_L(), Tagloss_cumul(), Tagloss_daymax(), Tagloss_fit(), Tagloss_format(), Tagloss_mcmc_p(), Tagloss_mcmc(), Tagloss_model(), logLik.Tagloss(), o_4p_p1p2, plot.TaglossData(), plot.Tagloss()

Examples

library(phenology)
## Not run: 
# Example
par <- structure(c(49.5658922243074, 808.136085362158, 106.283783786853, 
5.22150592456511, 8.00608716525864, 8.32718202233396, 150.612916258503, 
715.865805125223, 2242.06574225966, 119.212383120678, 10.1860735529433, 
7.14231725937626), .Names = c("D1_2", "D2D1_2", "D3D2_2", "A_2", 
"B_2", "C_2", "D1_1", "D2D1_1", "D3D2_1", "A_1", "B_1", "C_1"))
cmr <- Tagloss_simulate(n=500, 
                        par=par, model="12")
cmr_f <- Tagloss_format(cmr, model="12")

## End(Not run)

phenology documentation built on Oct. 16, 2023, 9:06 a.m.