# \donttest{
### Projecting through catch with no environmental information
# Then, create the data frame containing the selected catch for the projected
# years. In this illustration, within each scenario, the catch values are
# constant through the projected years. Three scenarios are considered:
# (i) catch value equal to the last historical catch multiplied by 1,
# (ii) last historical catch multiplied by 1.2 and
# (iii) last historical catch multiplied by 0.8.
catch<-rep(knobi_results$df$C[length(knobi_results$df$C)],5)
C<-data.frame(catch=catch,
catch08=0.8*catch,
catch12=1.2*catch)
# Then, knobi_proj function can be applied
knobi_proj(knobi_results, c=C)
### With environmental information
# In this case, in addition to the previous example, the 'knobi_env' example
# has to be run at first, where AMO variable was selected in the fit
# We include the future values of the environmental variable(s) in a data
# frame containing the environmental covariable values for the projected
# years. Three scenarios are considered:
# (i) Constant AMO equal to last year's AMO,
# (ii) Constant AMO equal to last year's AMO with a 50% increment
# (iii) Constant AMO equal to last year's AMO with a 50% decrease
last_AMO <- Env$AMO[length(Env$AMO)]
env <- data.frame( AMOi=rep(last_AMO,5),
AMOii=rep(last_AMO*1.5,5),
AMOiii=rep(last_AMO*0.5,5))
# Based on the previous objects we can apply the projection function.
knobi_proj(knobi_results, knobi_environmental, c=C, env=env)
### Through fishing mortality without environmental information
# Alternatively, projections can be based on fishing mortality.
# The scenarios presented below have been created from the estimated F_msy of
# knobi_fit analysis.
fmsy<-knobi_results$BRPs['F_MSY']
ff<-rep(fmsy,8)
f<-data.frame(f=ff,f12=ff*1.2,f08=ff*0.8)
knobi_proj(knobi_results, f=f)
### Through fishing mortality with environmental information
knobi_proj(knobi_results, f=f[1:5,], env_results=env_results, env=env)
# In case of multicovar<-TRUE in knobi_env, a list is required in which
# each item is a data frame for each environmental scenario
env<-list(climate_1=data.frame(AMO=c(0.2,0.2,0.3,0.3,0.4),
NAO=c(0.2,0.2,0.3,0.3,0.4)),
climate_2=data.frame(AMO=c(0.2,0.3,0.4,0.5,0.6),
NAO=c(0.2,0.2,0.3,0.3,0.4)))
knobi_proj(knobi_results, knobi_environmental2, c=C, env=env)
# }
Run the code above in your browser using DataLab