Learn R Programming

phenology (version 10.1)

Tagloss_fit: fit a model of tag loss using a CMR database.

Description

This function fits a model of tag loss using a CMR database.
The names of parameters can be:
Model Pfaller et al. (2019):

Left tag lost when 2 are present

D1_L2, D2D1_L2, D3D2_L2, A_L2, B_L2, C_L2, delta_L2

Right tag lost when 2 are present

D1_R2, D2D1_R2, D3D2_R2, A_R2, B_R2, C_R2, delta_R2

Left tag lost when 1 is present

D1_L1, D2D1_L1, D3D2_L1, A_L1, B_L1, C_L1, delta_L1

Right tag lost when 1 is present

D1_R1, D2D1_R1, D3D2_R1, A_R1, B_R1, C_R1, delta_R1

One tag lost when 2 are present

D1_2, D2D1_2, D3D2_2, A_2, B_2, C_2, delta_2

One tag lost when 1 is present

D1_1, D2D1_1, D3D2_1, A_1, B_1, C_1, delta_1

pA, pB and pC are the daily probabilities of tag loss with pA=-logit(A), pB=-logit(B) and pC=-logit(C) .
delta is used as: p = p + delta. Nothe that delta can be negative
Tag loss rate is pA at day 1
Tag loss rate changes gradually from pA to pB that is reached at day D1
Tag loss rate is pB from day D1 to day D2=D1+D2D1
Tag loss rate changes gradually from pB to pC that is reached at day D3=D2+D3D2

When parameters from Rivalan et al. (2005) are used:

One tag lost when 2 are present

a0_2, a1_2, a2_2, a3_2, a4_2, delta_2

One tag lost when 1 is present

a0_1, a1_1, a2_1, a3_1, a4_1, delta_1

When parameters from Casale et al. (2017) are used:
Model I

One tag lost when 2 are present

CasaleModelIc_2

One tag lost when 1 is present

CasaleModelIc_1

Model II

One tag lost when 2 are present

CasaleModelIIa0_2, CasaleModelIIa1_2, CasaleModelIIa4_2

One tag lost when 1 is present

CasaleModelIIa0_1, CasaleModelIIa1_1, CasaleModelIIa4_1

Model III

One tag lost when 2 are present

CasaleModelIIIa0_2, CasaleModelIIIa1_2, CasaleModelIIIa4_2

One tag lost when 1 is present

CasaleModelIIIa0_1, CasaleModelIIIa1_1, CasaleModelIIIa4_1

Model IV

One tag lost when 2 are present

CasaleModelIVa0_2, CasaleModelIVa1_2, CasaleModelIVa2_2, CasaleModelIVa3_2, CasaleModelIVa4_2

One tag lost when 1 is present

CasaleModelIVa0_1, CasaleModelIVa1_1, CasaleModelIVa2_1, CasaleModelIVa3_1, CasaleModelIVa4_1

Model V

One tag lost when 2 are present

CasaleModelVa0_2, CasaleModelVa1_2, CasaleModelVa2_2, CasaleModelVa3_2, CasaleModelVa4_2

One tag lost when 1 is present

CasaleModelVa0_1, CasaleModelVa1_1, CasaleModelVa2_1, CasaleModelVa3_1, CasaleModelVa4_1

If only one parameter is fitted, method must be "Brent" and upper and lower parameters must be set up with finite values.

model_before can be ""par['a0_1']=par['a0_2'];par['a1_1']=par['a1_2']". model_after can be "p1=p2"

Usage

Tagloss_fit(
  data = stop("A database formated using Tagloss_format() must be used"),
  fitted.parameters = NULL,
  fixed.parameters = NULL,
  model_before = NULL,
  model_after = NULL,
  control = list(trace = 1, maxit = 10000),
  method = "Nelder-Mead",
  lower = -Inf,
  upper = Inf,
  hessian = FALSE,
  mc.cores = detectCores(all.tests = FALSE, logical = TRUE),
  groups = NULL
)

Value

Return a list object with the model describing tag loss.

Arguments

data

An object formated using Tagloss_format

fitted.parameters

Set of parameters to be fitted

fixed.parameters

Set of fixed parameters

model_before

Transformation of parameters before to use Tagloss_model()

model_after

Transformation of parameters after to use Tagloss_model()

control

Control parameters to be send to optim()

method

optim() method

lower

Lower value for parameter when Brent method is used

upper

Upper value for parameter when Brent method is used

hessian

Does the hessian matrix should be estimated

mc.cores

Number of cores to use for parallel computing

groups

Number of groups for parallel computing

Author

Marc Girondot marc.girondot@gmail.com

Details

Tagloss_fit fits a model of tag loss using a CMR database.

References

Rivalan, P., Godfrey, M.H., Prévot-Julliard, A.-C., Girondot, M., 2005. Maximum likelihood estimates of tag loss in leatherback sea turtles. Journal of Wildlife Management 69, 540-548.

Casale, P., Freggi, D., Salvemini, P., 2017. Tag loss is a minor limiting factor in sea turtle tagging programs relying on distant tag returns: the case of Mediterranean loggerhead sea turtles. European Journal of Wildlife Research 63.

Pfaller JB, Williams KL, Frick MG, Shamblin BM, Nairn CJ, Girondot M (2019) Genetic determination of tag loss dynamics in nesting loggerhead turtles: A new chapter in “the tag loss problem”. Marine Biology 166: 97 doi 10.1007/s00227-019-3545-x

See Also

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

Examples

Run this code
if (FALSE) {
library(phenology)
# Example
data_f_21 <- Tagloss_format(outLR, model="21")

# model fitted by Rivalan et al. 2005
par <- c(a0_2=-5.43E-2, a1_2=-103.52, a4_2=5.62E-4, 
         delta_1=3.2E-4)
pfixed <- c(a2_2=0, a3_2=0, a2_1=0, a3_1=0)
model_before <- "par['a0_1']=par['a0_2'];par['a1_1']=par['a1_2'];par['a4_1']=par['a4_2']"
o <- Tagloss_fit(data=data_f_21, fitted.parameters=par, fixed.parameters=pfixed, 
                 model_before=model_before)
plot(o, t=1:1000, model="cumul")
plot(o, t=1:1000, model="1")
plot(o, t=1:1000, model="2", add=TRUE, col="red")

# Same data fitted with new model
par <- c(D1_1 = 100.15324837975547, A_1 = 5.9576927964120188, 
         B_1 = 8.769924225871069, B_2 = 8.2353860179664125)
pfixed <- c(D2D1_1 = 2568, D3D2_1 = 2568, D2D1_2 = 2568, D3D2_2 = 2568)
o_4p_p1p2 <- Tagloss_fit(data=data_f_21, fitted.parameters = par, 
                         fixed.parameters = pfixed, 
                         model_before = "par['C_1']=par['B_1'];
                         par['A_2']=par['A_1'];
                         par['C_2']=par['B_2'];
                         par['D1_2']=par['D1_1']", hessian=TRUE)
                         
# Without the N20 the computing is much faster
data_f_21_fast <- subset(data_f_21, subset=(is.na(data_f_21$N20)))
par <- c('D1_2' = 49.78891736351531, 
         'D2D1_2' = 1059.3635769732305, 
         'D3D2_2' = 12.434313273804602, 
         'A_2' = 5.2238379144659683, 
         'B_2' = 8.0050044071275543, 
         'C_2' = 8.4317863609499675, 
         'D1_1' = 701.80273287212935, 
         'D2D1_1' = 0.010951749100596819, 
         'D3D2_1' = 3773.6290607434876, 
         'A_1' = 205.42435592344776, 
         'B_1' = 9.9598342503239863, 
         'C_1' = 6.7234868237164722)
o <- Tagloss_fit(data=data_f_21_fast, fitted.parameters=par, hessian = TRUE)
plot(o, model="1", col="red")
plot(o, model="2", col="blue", add=TRUE)
legend("topright", legend=c("2->1", "1->0"), lty=1, col=c("blue", "red"))
}

Run the code above in your browser using DataLab