diff --git a/Rsrc/R/plot-sizetransition.R b/Rsrc/R/plot-sizetransition.R index d9e6f354..32058ff9 100644 --- a/Rsrc/R/plot-sizetransition.R +++ b/Rsrc/R/plot-sizetransition.R @@ -20,3 +20,22 @@ plot_sizetransition <- function(replist){ pSizeTransition <- p return(pSizeTransition) } + +# THis routine includs the molting probability +plot_growthtransition <- function(replist){ + A <- replist + df <- data.frame(stm = A$size_transition %*% A$P) + colnames(df) <- A$mid_points + nrow <- dim(A$size_transition)[2] + df$sex <- c(rep(1,length=nrow),rep(2,length=nrow)) + df$col <- A$mid_points + mdf <- melt(df,id=c("sex","col")) + + p <- ggplot(mdf) + p <- p + geom_point(aes(variable,col,size=value),alpha=0.4,col="red") + p <- p + scale_size_area(max_size=10) + p <- p + labs(x="Post-molt carapace width",y="Pre-molt carapace width",size="Probability") + p <- p + facet_wrap(~sex) + pGrowthTransition <- p + return(pGrowthTransition) +} diff --git a/docs/manuscript/GLBAM.pdf b/docs/manuscript/GLBAM.pdf index 236dfe53..ff733abb 100644 Binary files a/docs/manuscript/GLBAM.pdf and b/docs/manuscript/GLBAM.pdf differ diff --git a/docs/manuscript/GLBAM.tex b/docs/manuscript/GLBAM.tex index 3ce8aa48..f97777b5 100644 --- a/docs/manuscript/GLBAM.tex +++ b/docs/manuscript/GLBAM.tex @@ -87,8 +87,9 @@ \usepackage{tikz-uml} -\title{A generalized size-structured assessment model for hard-to-age species} -\author{Athol Whitten, Andre Punt, Dave Fournier, James Ianelli, and Steve Martell} +\title{A generalized size-structured assessment model for Crustaceans} +\author{Athol Whitten, Andre Punt, Dave Fournier, James Ianelli, John Levitt, and Steve Martell} + % Andre should probably be on here too, check with others. % I understand the problem with using the name Gmacs, and thus the relationship with Alaskan Crab stocks, % but it's probably too late to change. Thus Gmacs is now written as a name, not an acronym. diff --git a/examples/bbrkc/bbrkc.ctl b/examples/bbrkc/bbrkc.ctl index f3d31ecd..b104497c 100644 --- a/examples/bbrkc/bbrkc.ctl +++ b/examples/bbrkc/bbrkc.ctl @@ -15,8 +15,8 @@ # —————————————————————————————————————————————————————————————————————————————————————— # 0.18 0.01 1 -2 2 0.18 0.04 # M 7.0 -10 20 -1 1 3.0 5.0 # logR0 - 7.0 -10 20 2 1 3.0 5.0 # logR1 - 7.0 -10 20 2 1 3.0 5.0 # logRbar + 7.0 -10 20 1 1 3.0 5.0 # logR1 + 7.0 -10 20 1 1 3.0 5.0 # logRbar 72.5 55 100 -4 1 72.5 7.25 # Recruitment Expected Value 0.40 0.1 5 -3 0 0.1 5 # Recruitment scale (variance component) -0.51 -10 0.75 -4 0 -10 0.75 # ln(sigma_R) @@ -88,10 +88,10 @@ ## ———————————————————————————————————————————————————————————————————————————————————— ## ## Trap Trawl NMFS BSFRF ## Mean_F STD_PHZ1 STD_PHZ2 PHZ - 0.20 0.10 1.10 1 - 0.10 0.10 1.10 1 - 0.00 2.00 2.00 -1 - 0.00 2.00 2.00 -1 + 0.10 0.10 1.10 1 #TRAP + 0.05 0.10 1.10 1 #Trawl + 0.00 2.00 2.00 -1 #NMFS trawl survey (0 catch) + 0.00 2.00 2.00 -1 #BSFRF (0) ## ———————————————————————————————————————————————————————————————————————————————————— ## ## ———————————————————————————————————————————————————————————————————————————————————— ## diff --git a/src/gmacs.tpl b/src/gmacs.tpl index 12ee8882..a3e55f31 100644 --- a/src/gmacs.tpl +++ b/src/gmacs.tpl @@ -685,14 +685,14 @@ PARAMETER_SECTION END_CALCS // Fishing mortality rate parameters - init_number_vector log_fbar(1,nfleet,f_phz); - init_vector_vector log_fdev(1,nfleet,1,nFparams,f_phz); - init_number_vector log_foff(1,nfleet,foff_phz); - init_vector_vector log_fdov(1,nfleet,1,nYparams,foff_phz); ///> WTF + init_number_vector log_fbar(1,nfleet,f_phz); ///> Male mean fishing mortality + init_vector_vector log_fdev(1,nfleet,1,nFparams,f_phz); ///> Male f devs + init_number_vector log_foff(1,nfleet,foff_phz); ///> Female F offset to Male F + init_vector_vector log_fdov(1,nfleet,1,nYparams,foff_phz); ///> Female F offset to Male F // Recruitment deviation parameters - init_bounded_dev_vector rec_ini(1,nclass,-7.0,7.0,rdv_phz); ///> initial size devs - init_bounded_dev_vector rec_dev(syr+1,nyr,-7.0,7.0,rdv_phz); ///> recruitment deviations + init_bounded_dev_vector rec_ini(1,nclass,-7.0,7.0,rdv_phz); ///> initial size devs + init_bounded_dev_vector rec_dev(syr+1,nyr,-7.0,7.0,rdv_phz);///> recruitment deviations // Time-varying natural mortality rate devs. init_bounded_dev_vector m_dev(1,nMdev,-3.0,3.0,Mdev_phz); @@ -1010,6 +1010,7 @@ FUNCTION calc_fishing_mortality if(fhit(i,k)) { log_ftmp = log_fbar(k) + log_fdev(k,ik++); + if(yhit(i,k)) { log_ftmp += (h-1) * (log_foff(k) + log_fdov(k,yk++)); @@ -1021,7 +1022,7 @@ FUNCTION calc_fishing_mortality sel = exp(log_slx_capture(k)(h)(i)); ret = exp(log_slx_retaind(k)(h)(i)) * slx_nret(h,k); tmp = elem_prod(sel,ret + (1.0 - ret) * lambda); - + F(h)(i) += ft(k,h,i) * tmp; } } @@ -1138,7 +1139,7 @@ FUNCTION calc_size_transition_matrix At(l)(l,nclass) = At(l)(l,nclass) / sum(At(l)); } size_transition(h) = At; - + } @@ -1224,6 +1225,8 @@ FUNCTION calc_natural_mortality * @details \f$ S = exp(-Z) \f$ * @return NULL * + * ISSUE, for some reason the diagonal of S goes to NAN if linear growth model is used. + * Due to F. * */ FUNCTION calc_total_mortality @@ -1241,7 +1244,7 @@ FUNCTION calc_total_mortality S(h)(i)(l,l) = mfexp(-Z(h)(i)(l)); } } - + //COUT(F(h)); } @@ -2369,6 +2372,7 @@ REPORT_SECTION REPORT(pMoltInc); } REPORT(survey_q); + REPORT(P);