retro-methods            package:FLAssess            R Documentation

_R_e_t_r_o_s_p_e_c_t_i_v_e _s_t_o_c_k _a_s_s_e_s_s_m_e_n_t _i_n _F_L_R

_D_e_s_c_r_i_p_t_i_o_n:

     WARNING: This method has now been deprecated and is no longer
     maintained. Users are encouraged to perform retrospective analysis
     using tapply. See below for an example.

     Performs a retrospective stock assessment for the desired years
     using the stock assessment method specified in the control object
     (see 'FLAssess' and extended classes)

_A_r_g_u_m_e_n_t_s:

 FLStock: An object of type 'FLStock' that contains information (catch
          data, natural mortality etc.) on the stock that is to be
          assessed

FLIndices: An object of type 'FLIndices' that contains the tuning data

 control: A control object of the desired extended 'FLAssess' assesment
          method class, e.g. 'FLXSA.control'

year.range: Numeric vector of years to perform the assessment

   retro: An integer that specifies the number of retrospective years.
          Default value = 0.  Only used if year.range is not specified.

_D_e_t_a_i_l_s:

     The type of assessment method used is determined by the control
     object, e.g. 'FLXSA.control', 'FLICA.control' etc.  In this way
     retrospective analysis using different assessment methods can be
     easily carried out on the same stock and tuning data by using
     different control classes.

     The argument 'year.range' is a numeric vector of years for which
     the assessment is to be performed.  If this is not specified the
     integer ''retro'' is used (default value = 0).  If retro = 0 the
     assessment is run for final year only. If retro = 1, the
     assessment is run for the penultimate and final year and so on.

     The results of the restrospective analysis can be plotted using
     the generic FLStocks 'plot()' method.

     NOTE: This function supercedes the previous 'retro()' function
     which returned an object of type 'FLAssess.retro'.  The
     'FLAssess.retro' class is now obsolete and will not be present in
     future releases.  Users are advised to update their scripts to use
     this new function.  The original function is still in the
     'FLAssess' package with the name 'retro.old()'.

_V_a_l_u_e:

     Returns an object of type 'FLStocks'.  Each component 'FLStock'
     object contains the result of each of the retrospective
     assessments.

_G_e_n_e_r_i_c _f_u_n_c_t_i_o_n:

     retro(stock,indices,control,retro,...)

_M_e_t_h_o_d_s:


      _s_i_g_n_a_t_u_r_e(_s_t_o_c_k=_F_L_S_t_o_c_k,_i_n_d_i_c_e_s=_F_L_I_n_d_e_x,_c_o_n_t_r_o_l=_A_N_Y,_r_e_t_r_o=_n_u_m_e_r_i_c) : 
          Takes a single index as an 'FLIndex' object.

      _s_i_g_n_a_t_u_r_e(_s_t_o_c_k=_F_L_S_t_o_c_k,_i_n_d_i_c_e_s=_F_L_I_n_d_i_c_e_s,_c_o_n_t_r_o_l=_A_N_Y,_r_e_t_r_o=_n_u_m_e_r_i_c) : 
          Takes an 'FLIndices' object for multiple indices.

_A_u_t_h_o_r(_s):

     Laurence Kell

_S_e_e _A_l_s_o:

     'FLAssess-class', 'FLICA', 'FLXSA'

_E_x_a_m_p_l_e_s:

     # Using the deprecated retro method
     # library(FLXSA)
     # data(ple4)
     # data(ple4.indices)
     # retro(ple4,ple4.indices,FLXSA.control(),4)

     # Example using ''tapply'' and specifying the range of years.
     # This example uses FLXSA
     #ple4 <- ple4+FLXSA(ple4,ple4.indices,FLXSA.control())
     #retro.years <- 2004:2008
     #ple4.retro  <-tapply(retro.years,1:length(retro.years),function(x)
     #return(window(ple4,end=x)+FLXSA(window(ple4,end=x),ple4.indices)))

     # coerce into FLStocks object
     # ple4.retro <- FLStocks(ple4.retro)
     # full retrospective summary plot
     # plot(ple4.retro)

     # SPECIFIC RETROSPECTIVE PATTERNS
     # SSB
     #ylab <- 'SSB'
     #xlab <- 'Year'
     #mainttl <- 'SSB retrospective'
     #xyplot(data~year,groups=qname,data=lapply(ple4.retro,ssb),xlab=xlab,ylab=ylab,main=mainttl,type="l")
      
     # FBAR
     #ylab <- expression(bar(F))
     #xlab <- 'Year'
     #mainttl <- 'mean F retrospective'
     #xyplot(data~year,groups=qname,data=lapply(ple4.retro,fbar),xlab=xlab,ylab=ylab,main=mainttl,type="l")
      
     # RECRUITS
     #ple4.retro.rec <- list()
     #for(i in 1:length(ple4.retro))
     #   ple4.retro.rec[[i]] <- stock.n(ple4.retro[[i]])[1,]
     #ple4.retro.rec <- FLQuants(mcf(ple4.retro.rec))
     #ylab <- 'Recruits'
     #xlab <- 'Year'
     #mainttl <- 'Recruitment retrospective'
     #xyplot(data~year,groups=qname,data=ple4.retro.rec,xlab=xlab,ylab=ylab,main=mainttl,type="l")

