irm_h(relyrs = NULL, recapyrs = NULL, N = NULL, recapharv = NULL, lambda = NULL,phi = NULL,
Fyr = NULL, Myr = NULL, initial = NULL, lower = c(0.0001,0.0001),upper = c(5,5), maxiter = 10000)tag_model_avg function.optim routine is used to find the parameters that minimize the -1*negative
log-likelihood. The variance of instantaneous total mortality (Z) is calculated by varF + varM + 2cov(F,M), and
the variance of survival (S) is estimated from the variance of Z using the delta method.
The program allows the configuration of different model structures (biological realistic models) for the estimation of
fishing and natural mortalities.  Consider the following examples:
Example 1
Release years range from 1991 to 2003 and recovery years from 1991 to 2003.  One model structure might be constant fishing mortality estimates 
over the recovery years of 1991-1994 and 1995-2003, and one constant estimate of natural mortality for the entire recovery period.  To specify this model structure, the beginning year of each interval is 
assigned to the Fyr vector (e.g.,Fyr<-c(1991, 1995)), and the beginning year of the recovery period is assigned to the Myr vector 
 (e.g.,Myr<-c(1991)).  The first value of each vector must always be the beginning year of the recovery period regardless of the model structure.
Example 2
Release years range from 1991 to 2003 and recovery years from 1991 to 2003.  One model might be fishing mortality estimates 
for each year of recovery years and two constant estimates of natural mortality for 1991-1996 and
1997-2003.  To specify this model structure, one value for each year is assigned to the Fyr vector 
(e.g., Fyr<-c(1991, 1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003) and the beginning years of the natural mortality intervals
 are assigned to the Myr vector (e.g.,Myr<-c(1991,1997)).
Averaging of model results can be accomplished using the function tag_model_avg.irm_cr tag_model_avg# Data come from Table 4 and model structure from Table 5 under "year-specific F, constant M" in Hoenig et al. (1998)  
data(Hoenig)
model1<-irm_h(relyrs = Hoenig$relyrs, recapyrs = Hoenig$recapyrs, N = Hoenig$N, recapharv = Hoenig$recapharv,
lambda = Hoenig$lambda,phi = Hoenig$phi, Fyr = Hoenig$Fyr, Myr = Hoenig$Myr, initial = c(0.1,0.1), 
lower = c(0.0001,0.0001),upper = c(5,5), maxiter = 10000)Run the code above in your browser using DataLab