Skip to content

Commit

Permalink
multisca renamed to scax
Browse files Browse the repository at this point in the history
  • Loading branch information
ejardim committed Dec 18, 2024
1 parent 4336231 commit a0e610c
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 25 deletions.
3 changes: 1 addition & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ export(defaultVmod)
export(defaultSRmod)
export(a4aSCA)
export(sca.sa)
export(scax)
export(sep.sa)
#export(makePrediction)
#export(os.32or64bit)
#export(os.type)
#export(plotIters)

exportClasses(a4aFit)
exportClasses(a4aFits)
exportClasses(a4aFitResiduals)
Expand All @@ -66,7 +66,6 @@ exportClasses(SCAPars)
exportClasses(a4aStkParams)
exportClasses(submodel)
exportClasses(submodels)

exportMethods("distr<-")
exportMethods("grInvMod<-")
exportMethods("grMod<-")
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

NEW FEATURES
- plot for residuals by age
- multisca method to run several sca
- scax method to run several sca
- plot for multiple fits
- new classes for plural fit objects

Expand Down
2 changes: 1 addition & 1 deletion R/a4aFitMCMCs-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ setMethod("a4aFitMCMCs", signature(object="missing"),
#' )
#' }
#' myFits <-
#' FLa4a:::multisca(
#' scax(
#' FLStocks(ple4), list(FLIndices(ple4.index)),
#' fmodel = fmods, qmodel=qmods, fit="MCMC", mcmc=SCAMCMC()
#' )
Expand Down
2 changes: 1 addition & 1 deletion R/a4aFits-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ setMethod("a4aFits", signature(object="missing"),
#' )
#' }
#' myFits <-
#' FLa4a:::multisca(
#' scax(
#' FLStocks(ple4), list(FLIndices(ple4.index)),
#' fmodel = fmods, qmodel=qmods, fit="MP"
#' )
Expand Down
10 changes: 5 additions & 5 deletions R/fittingFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -1489,9 +1489,9 @@ fitADMB <- function(fit, wkdir, df.data, stock, indices, full.df,
}

#' @title Run several stock assessments in a single run
#' @name multisca
#' @name scax
#' @docType methods
#' @rdname multisca
#' @rdname scax
#' @description Internal method to run several stock assessment fits with different stocks, indices and submodels
#' @param stocks an \code{FLStocks} object containing catch and stock information
#' @param indicess a list of \code{FLIndices} objects containing survey indices
Expand All @@ -1504,8 +1504,8 @@ fitADMB <- function(fit, wkdir, df.data, stock, indices, full.df,
#' @param combination.all bolean parameter (default is FALSE) to define if a full factorial across all stocks, indices, and submodel is run or just a sequence of runs.
#' @param ... all other arguments to be passed to \code{sca}
#' @return an \code{a4aFits} or \code{a4aFitSAs} or \code{a4aFitMCMCs} depending on the argument \code{fit}
#' @aliases multisca
# multisca <- function(stocks, indicess,
#' @aliases scax
# scax <- function(stocks, indicess,
# fmodel = missing,
# qmodel = missing,
# srmodel = missing,
Expand All @@ -1514,7 +1514,7 @@ fitADMB <- function(fit, wkdir, df.data, stock, indices, full.df,
# combination.all = FALSE,
# ...)

multisca <- function(stocks, indicess, fmodel = missing, qmodel = missing, srmodel = missing, n1model = missing, vmodel = missing, combination.all = FALSE, ...){
scax <- function(stocks, indicess, fmodel = missing, qmodel = missing, srmodel = missing, n1model = missing, vmodel = missing, combination.all = FALSE, ...){

args <- list(...)

Expand Down
2 changes: 1 addition & 1 deletion man/plot-mfits.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/plot-mmcfits.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/multisca.Rd → man/scax.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 6 additions & 10 deletions tests/multisca.R → tests/scax.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ idxss <- list(FLIndices(ple4.index))
# MP
#--------------------------------------------------------------------

fits <- FLa4a:::multisca(stks, idxss, fmodel = fmods, qmodel=qmods, fit="MP")
fits <- scax(stks, idxss, fmodel = fmods, qmodel=qmods, fit="MP")

is(fits, "a4aFits")
is(fits[[1]], "a4aFit")
Expand All @@ -32,7 +32,7 @@ is(fits[[1]], "a4aFit")
# SA
#--------------------------------------------------------------------

fitsa <- FLa4a:::multisca(stks, idxss, fmodel = fmods, qmodel=qmods, fit="assessment")
fitsa <- scax(stks, idxss, fmodel = fmods, qmodel=qmods, fit="assessment")

is(fitsa, "a4aFitSAs")
is(fitsa[[1]], "a4aFitSA")
Expand All @@ -41,7 +41,7 @@ is(fitsa[[1]], "a4aFitSA")
# MCMC
#--------------------------------------------------------------------

fitsm <- FLa4a:::multisca(stks, idxss, fmodel = fmods, qmodel=qmods, fit="MCMC", mcmc=SCAMCMC())
fitsm <- scax(stks, idxss, fmodel = fmods, qmodel=qmods, fit="MCMC", mcmc=SCAMCMC())

is(fitsm, "a4aFitMCMCs")
is(fitsm[[1]], "a4aFitMCMC")
Expand Down Expand Up @@ -74,10 +74,6 @@ stks.mc <- stks + fitsm
length(stks.mc) == length(fitsm)
identical(stks.mc[[2]], stks[[1]] + fitsm[[2]])





#====================================================================
# run fits sca multiple stocks and indices
#====================================================================
Expand All @@ -89,7 +85,7 @@ idxss[1:j] <- idxss[1]
# MP
#--------------------------------------------------------------------

fits <- FLa4a:::multisca(stks, idxss, fmodel = fmods, qmodel=qmods, fit="MP")
fits <- scax(stks, idxss, fmodel = fmods, qmodel=qmods, fit="MP")

is(fits, "a4aFits")
is(fits[[1]], "a4aFit")
Expand All @@ -99,7 +95,7 @@ is(fits[[1]], "a4aFit")
# SA
#--------------------------------------------------------------------

fitsa <- FLa4a:::multisca(stks, idxss, fmodel = fmods, qmodel=qmods, fit="assessment")
fitsa <- scax(stks, idxss, fmodel = fmods, qmodel=qmods, fit="assessment")

is(fitsa, "a4aFitSAs")
is(fitsa[[1]], "a4aFitSA")
Expand All @@ -108,7 +104,7 @@ is(fitsa[[1]], "a4aFitSA")
# MCMC
#--------------------------------------------------------------------

fitsm <- FLa4a:::multisca(stks, idxss, fmodel = fmods, qmodel=qmods, fit="MCMC", mcmc=SCAMCMC())
fitsm <- scax(stks, idxss, fmodel = fmods, qmodel=qmods, fit="MCMC", mcmc=SCAMCMC())

is(fitsm, "a4aFitMCMCs")
is(fitsm[[1]], "a4aFitMCMC")
Expand Down

0 comments on commit a0e610c

Please sign in to comment.