calcCat: Calculate Categories

View source: R/calcCat.R

calcCatR Documentation

Calculate Categories

Description

Calculate stock status categories from B/Bmsy and F/Fmsy, and add as columns to an existing data frame.

Usage

calcCat(dat, method = "cmsy.naive")

Arguments

dat

data frame of stock time series, containing columns named bbmsy and ffmsy, as well as method-specific bbmsy.* and ffmsy.*.

method

string indicating which method was used to estimate B/Bmsy and F/Fmsy.

Details

The column names in dat should contain the method name as a suffix. For example, if method = "effEdepP" (Effective Effort and Depletion Prior), then this function will look for columns called bbmsy.effEdepP and ffmsy.effEdepP.

Value

Data frame like dat but with additional columns containing stock status category information:

trueCat4 True Kobe category
estCat4 Estimated Kobe category
confMat4 Comparison statistic: 4 * (trueCat4 - 1) + estCat4
trueCat3 True SOFIA category
estCat3 Estimated SOFIA category
confMat3 Comparison statistic: 4 * (trueCat3 - 1) + estCat3

Note

The data frame dat and the bbmsy.* and ffmsy.* column names are created in ‘output.R’ using results from the sraplus analysis.

In a simulation, the columns bbmsy and ffmsy contain the true values from an operating model, while bbmsy.* and ffmsy.* contain the estimated values. In a SOFIA analysis of actual data, only the estimated values are relevant and are used in the subsequent analysis and plots.

This function calculates two sets of stock categories. Cat3 has three levels and forms the basis of the SOFIA analysis, while Cat4 has four levels corresponding to the different rectangles of a Kobe plot.

Author(s)

Rishi Sharma, with a contribution by Arni Magnusson.

See Also

plotCat plots a summary of stock status categories.

SOFIA-package gives an overview of the package.

Examples

## Not run: 
calcCat(stock.timeseries, method="effDepP")

## End(Not run)


sofia-tsaf/SOFIA documentation built on May 31, 2022, 3:31 a.m.