MQMF0.1.5 package

Modelling and Quantitative Methods in Fisheries

addcontours

addcontours simplifies adding contours to an xy plot of points

addlnorm

addlnorm estimates a log-normal distribution from output of hist

addnorm

addnorm adds a normal distribution to a histogram of a data set.

aicbic

aicbic returns the AIC and BIC for a given model

altnegLL

altnegLL calculate the Normal negative log-likelihood

bce

bce Baranov catch equation

bh

bh represents one version of Beverton-Holt recruitment

bracket

bracket bounds a value on the x-axis and y-axis

calcprior

calcprior return the sum of a vector of constant values as priors

chapter2

chapter2 The 15 R-code chunks from A Non-Introduction to R

chapter3

chapter3 The 27 R-code chunks from Simple Population Models

chapter4

chapter4 The 47 R-code chunks from Model Parameter Estimation

chapter5

chapter5 The 23 R-code chunks from Static Models

chapter6

chapter6 The 53 R-code chunks from On Uncertainty

chapter7

chapter7 The 67 R-code chunks from Surplus Production Models

countgtone

countgtone used in apply to count the number > 1 in a vector

countgtzero

countgtzero used in apply to count numbers > zero in a vector

countNAs

countNAs used in apply to count the number of NAs in a vector

countones

countones used in apply to count the number of ones in a vector

countzeros

countzeros used in apply to count the number of zeros in a vector

discretelogistic

discretelogistic example and figure 3.2 Discrete logistic model

do_MCMC

do_MCMC conducts an MCMC using Gibbs within Metropolis

domed

domed calculates domed selectivity curves

fabens

fabens calculates predicted growth increment for tagging data

facttonum

facttonum converts a vector of numeric factors into numbers

fitSPM

fitSPM fits a surplus production model

freqMean

freqMean calculates the mean and stdev of count data

getlag

getlag is used to look for the response of cpue to previous catches

getmax

getmax can be used to define the upper bound for a plot

getmin

getmin can be used to define the lower bound for a plot

getMSY

getMSY calculates the MSY for the Polacheck et al 1993 equation

getname

getname returns the name of a variable as character

getrmse

getrmse calculates the rmse of the input 'invar' series

getseed

getseed generates a random number seed

getsingle

getsingle extracts one number from an input line of characters

gettime

gettime calculates time in seconds passed each day

getvector

getvector extracts a vector of numbers from a line of characters

grapes-ni-grapes

'%ni%' identifies which element in x is NOT in y

Gz

Gz calculates predicted Gompertz length-at-age growth curve

halftable

halftable halves the height of a tall narrow data.frame for printing

inthist

inthist a replacement for the hist function for use with integers

invl

invl calculates growth increments for the inverse logistic

iscol

incol is a utility to determine if a column is present in a matrix

likeratio

likeratio conducts a likelihood ratio test

linter

linter finds a value in a series using its location in another

logist

logist Logistic selectivity function

magnitude

magnitude returns the magnitude of numbers in base 10

makelabel

makelabel generates a label from text and values

mature

mature alternative logistic function commonly used for maturity

mm

mm calculates the predicted Michaelis-Menton length-at-age

mnnegLL

mnnegLL generic multinomial negative log-likelihoods

MQMF

MQMF functions for Using R for Modelling and Quantitative Methods in F...

negLL

negLL calculate log-normal log-likelihoods

negLL1

negLL1 calculate log-normal log-likelihoods with a penalty

negLLM

negLLM -ve log-normal likelihoods for multiple index time-series

negLLP

negLLP -ve log-likelihood for normally distributed variables

negNLL

negNLL -ve log-likelihood for normally distributed variables

negnormL

negnormL an alternative -log-likelihood for normal errors

outfit

outfit tidy print of output from optim, nlminb, or nlm

panel.cor

panel.cor is a version of a function given in the help for pairs

parasympt

parasympt generates N vectors from a multi-variate normal

parset

parset alters the current base graphics par settings

parsyn

parsyn types the standard par command syntax to the console

penalty0

penalty0 enables the adding of a large penalty as one approaches 0.0

penalty1

penalty1 adds an increasingly large penalty as a value approaches 1.0

plot.dynpop

plot.dynpop an S3 method for plotting dynpop objects

plot1

plot1 a quick way to plot an xy line or point plot

plotfishM

plotfishM plots the catch and optionally the cpue

plotlag

plotlag plots the effect of a lag between two variables

plotprep

plotprep sets up a window and the par values for plotting

plotprofile

plotprofile simplifies plotting single likelihood profiles

plotproj

plotproj generate a plot of a matrix of biomass projections

plotspmdat

plotspmdat plots the fish data containing catches and cpue

plotspmmod

plotspmmod plots an spm model fit given parameters and data

predfreq

predfreq is used for modal analysis of count data

printV

printV returns a vector cbinded to 1:length(invect)

properties

properties - used to examine the properties of a data.frame

quants

quants used in apply to estimate quantiles across a vector

removeEmpty

removeEmpty removes empty strings from a vector of strings

ricker

ricker one version of the Ricker stock recruitment

robustSPM

robustSPM does a robustness test on quality of fit of an SPM

setpalette

setpalette is a shortcut for altering the palette to R4

simpspm

simpspm calculates only the predicted log(CE) for an SPM

simpspmM

simpspmM calculates predicted CE when multiple indices are present

spm

spm calculates the dynamics of a Schaefer or Fox model

spmboot

spmboot conducts a bootstrap analysis on a spm model

spmCE

spmCE - calculates the dynamics for multiple cpue time-series

spmphaseplot

spmphaseplot - plots the phase plot of harvest rate vs biomass

spmproj

spmproj calculates biomass trajectories for replicate parameters

spmprojDet

spmprojDet conducts forward projections from known conditions

srug

srug is the Schnute and Richards Unified Growth Curve

ssq

ssq a generalized function for summing squared residuals

summspm

summspm extracts critical statistics from output of plotspmmod

uphist

uphist a histogram with an upper limit on the x-axis

vB

vB calculates the predicted von Bertalanffy length at age

which.closest

which.closest find a number in a vector closest to a given value

Complements the book "Using R for Modelling and Quantitative Methods in Fisheries" ISBN 9780367469894, published in 2021 by Chapman & Hall in their "Using R series". There are numerous functions and data-sets that are used in the book's many practical examples.