% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MSE_functions.R
\name{Converge}
\alias{Converge}
\title{Check Convergence}
\usage{
Converge(
  MSEobj,
  PMs = c("Yield", "P10", "AAVY"),
  maxMP = 15,
  thresh = 0.5,
  ref.it = 20,
  inc.leg = FALSE,
  all.its = FALSE,
  nrow = NULL,
  ncol = NULL,
  silent = FALSE
)
}
\arguments{
\item{MSEobj}{An MSE object of class \code{'MSE'}}

\item{PMs}{A character vector of names of the PM methods or a list of the PM methods}

\item{maxMP}{Maximum number of MPs to include in a single plot}

\item{thresh}{The convergence threshold. Maximum root mean square deviation over the last \code{ref.it} iterations}

\item{ref.it}{The number of iterations to calculate the convergence statistics. For example,
a value of 20 means convergence diagnostics are calculated over last 20 simulations}

\item{inc.leg}{Logical. Should the legend be displayed?}

\item{all.its}{Logical. Plot all iterations? Otherwise only (nsim-ref.it):nsim}

\item{nrow}{Numeric. Optional. Number of rows}

\item{ncol}{Numeric. Optional. Number of columns}

\item{silent}{Hide the messages printed in console?}
}
\value{
A table of convergence results for each MP
}
\description{
Have I undertaken enough simulations (nsim)? Has my MSE converged on stable
(reliable) peformance metrics?
}
\details{
Performance metrics are plotted against the number of simulations. Convergence diagonostics
are calculated over the last \code{ref.it} (default = 20) iterations. The convergence diagnostics are:
\enumerate{
\item Is the order of the MPs stable over the last \code{ref.it} iterations?
\item Is the average difference in performance statistic over the last \code{ref.it} iterations < \code{thresh}?
}

By default three commonly used performance metrics are used:
\enumerate{
\item Average Yield Relative to Reference Yield
\item Probability Spawning Biomass is above 0.1BMSY
\item Probability Average Annual Variability in Yield is < 20 per cent
}
Additional or alternative performance metrics objects can be supplied. Advanced users can develop their own performance metrics.
}
\note{
See relevant section of the \href{https://dlmtool.github.io/DLMtool/userguide/checking-convergence.html}{DLMtool User Guide} for more information.
}
\examples{
\dontrun{
MSE <- runMSE()
Converge(MSE)
}

}
\author{
A. Hordyk
}
