Parameters: The Parameters class and constructor

ParametersR Documentation

The Parameters class and constructor

Description

A class that contains all model parameters

Usage

parameters(names = c(), vals = c(), transformed = TRUE,
  base = new("Parameters"))

meanParameters(x)

## S3 method for class 'Parameters'
plot(x, xlim = c(0.001, 1), ...)

## S3 method for class 'Parameters'
lines(x, ...)

## S3 method for class 'Parameters'
as.list(x, ...)

## S3 method for class 'Parameters'
simulate(object, nsim = 1000, seed = NULL,
  binsize = 5, keepZeros = TRUE, ...)

Arguments

names

String vector. Contains the names of the parameters that will have non default values.

vals

Numeric vector. The corresponding values, transformed if transformed is TRUE.

transformed

Boolean. If TRUE vals should contain the transformed parameter values.

base

Parameters object. The parameter values will be used instead of the default values.

x

a Parameters object

xlim

the x limits (x1, x2) of the plot.

...

Arguments passed to other methods.

object

a Parameters object

nsim

number of individuals in the simulated sample

seed

the seed that is passed to set.seed.

binsize

numeric, the width of the weight classes in grams

keepZeros

logical, if TRUE keep bins with zero frequency. Note that the zeros after the last non-zero bin are always droped.

Value

Returns an object of the Parameters class

Slots

logWinf:

Numeric scalar. Asymptotic weight

logFm:

Numeric scalar. Fishing mortality

logA:

Numeric scalar. Growth parameter

logn:

Numeric scalar. Exponent of consumption

logeta_F:

Numeric scalar. 50% retention size, relative to asymptotic weight

logeta_m:

Numeric scalar. 50% maturation size, relative to asymptotic weight

logeta_S:

Numeric scalar. 50% retention size (survey), relative to asymptotic weight

loga:

Numeric scalar. Physiological mortality

logepsilon_a:

Numeric scalar. Allocation to activity

logepsilon_r:

Numeric scalar. Recruitment efficiency

logWfs:

Numeric scalar. 50% retention size

logu:

Numeric scalar. Selectivity parameter, width o

M:

Numeric scalar. Number of internal weight classes

scaleWinf:

Numeric scalar. Scale of asymptotic weight

scaleFm:

Numeric scalar. Scale of fishing mortality

scaleA:

Numeric scalar. Scale of growth parameter

scalen:

Numeric scalar. Scale of exponent of consumption

scaleeta_F:

Numeric scalar. Scale of 50% retantion size

scaleeta_m:

Numeric scalar. Scale of 50% maturation size

scaleeta_S:

Numeric scalar. Scale of survey gear 50% retantion size

scalea:

Numeric scalar. Scale of the physiological mortality

scaleepsilon_a:

Numeric scalar. Scale of the allocation to activity

scaleepsilon_r:

Numeric scalar. Scale of recruitment efficiency

scaleWfs:

Numeric scalar. Scale of size of 50% retention

scaleu:

Numeric scalar.

Note

Additional arguments are passed to plot.default (from plot) and to lines (from lines). From all other functions the extra arguments are ignored.

Author(s)

alko

alko

Examples


## Without any arguments gives a Parameters object with default values
parameters()

## Changing some parameters gives the corresponding object
par1 <- parameters(c("Winf", "Fm", "Wfs"), c(log(1000 / 10000), log(0.4 / 0.25), log(100 / 1000)))
par2 <- parameters(c("Winf", "Fm", "Wfs"), c(1000 , 0.4, 100), transformed=FALSE)

## Check if the two objects are equal
all.equal(par1, par2)

## Take a Parameters object and change one parameter
par <- parameters(c("Winf", "a", "Fm", "Wfs"), c(1000, 0.4, 0.2, 100), transformed = FALSE)
changeMatsize <- parameters("eta_m", 0.3, transformed =FALSE, base=par)

difference(par, changeMatsize)
##       base comp difference percent.difference
## eta_m 0.25  0.3      -0.05                 20

alko989/s6model documentation built on Nov. 2, 2023, 10:04 p.m.