plotCatchPMF: Plot Probability Mass Function of Predicted Total Catch

Description Usage Arguments See Also

View source: R/plotCatchPMF.R

Description

Plots a probability mass function representing the predicted probability of catching a given number of fish in total over all runs. The plot is coloured to indicate the mean EQR achieved if each number was observed in terms of the WFD classification this would indicate.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
plotCatchPMF(
  fit,
  newData,
  subset = 1,
  na.action,
  boundaries,
  mu,
  rho,
  xmax,
  xmaxscale = 2,
  maxpts = 200,
  title,
  ...
)

Arguments

fit

an "fcs2Fit" object containing a full FCS2 model fit, as returned from fcs2FitModel with runBUGS = TRUE.

newData

a data frame with surveys as rows and variables as columns. It should contain all variables required by fit.

subset

an vector specifying which surveys to plot the predicted PMF for.

na.action

a function which indicates what should happen when the data contain missing values (NAs). The default is set by the na.action setting of options and this is usually set to na.omit. This setting removes surveys that contain missing data in any required variables. Alternatively, na.pass can be used to ignore missing values (where possible) or na.fail can be given to signal an error if missing values are found.

boundaries

a vector of length 4 giving the EQR boundaries separating the classes Bad, Poor, Good, Moderate and High. These are used only to colour the plot with Bad red and High blue. If missing, regularly spaced boundaries of c(0.2, 0.4, 0.6, 0.8) are used with a warning. If NULL, the probability that defines the single EQR is coloured blue.

mu

a matrix of posterior samples of the abundance component mu can optionally be given to save recalculation if already available. This is assumed to have been calculated from abundance using the same arguments as above.

rho

a matrix of posterior samples of the prevalence component rho can optionally be given to save recalculation if already available. This is assumed to have been calculated from prevalence using the same arguments as above.

xmax

an optional x-axis upper limit giving the largest value of the total catch to plot the probability of.

xmaxscale

if xmax is not specified, the x-axis upper limit is set to xmaxscale * the expected total catch.

maxpts

the maximum number of points to plot on the x-axis. If xmax >= maxpts a simpler plot with lines rather than bars is drawn with maxpts points only.

title

an optional character vector giving the title for each plot. Should have one entry per survey selected by subset.

...

further arguments passed to barplot if xmax < maxpts of plot otherwise.

See Also

fcs2FitModel for fitting the model.
pCatch for obtaining the probabilities plotted by this function.

fcs2InteractivePrediction can be used to interactively view how the predicted catch distribution changes with covariates.


aquaMetrics/fcs2 documentation built on Aug. 21, 2021, 12:55 p.m.