Skip to content

Commit

Permalink
call select
Browse files Browse the repository at this point in the history
  • Loading branch information
mkapur-noaa committed Dec 17, 2024
1 parent 45463df commit 04482c0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions R/refit_Growth.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ refit_Growth <- function(dat = simulated_data, breakpoints, selex = FALSE, showP
for (k in 1:3) fit <- nlminb(model$env$last.par.best, model$fn, model$gr) ## start at last-best call, for stability
model$report()$denominator ## if we only ran seltype 2 points, this should NOT be 1.0
best <- model$env$last.par.best
rep <- sdreport(model)
rep <- TMB::sdreport(model)

## data frame with observed and predicted values
fits_df <- bind_cols(ypred = rep$value[names(rep$value)=='ypreds'],
Expand All @@ -98,7 +98,7 @@ refit_Growth <- function(dat = simulated_data, breakpoints, selex = FALSE, showP
upper = value + 1.96*value_sd^2)
pars_df <- rep0 %>%
filter(!(variable %in% c('L1','L2'))) %>%
select(strata, variable, value, value_sd, lower, upper)
dplyr::select(strata, variable, value, value_sd, lower, upper)

## check overlap across strata
# Initialize the matchcol column with FALSE
Expand All @@ -118,9 +118,6 @@ refit_Growth <- function(dat = simulated_data, breakpoints, selex = FALSE, showP
}
}




## panel plot of par ests and CIs
p1 <- ggplot(pars_df, aes(x = strata, y = value, color = matchcol)) +
geom_point()+
Expand Down

0 comments on commit 04482c0

Please sign in to comment.