disc_score_dt {SeaVal}R Documentation

Generalized Discrimination score

Description

Calculate the Generalized discrimination score from a data.table with data belonging to a single group (as defined by the by variable in the DISS function), for example a single location and month. Formula (5a) from Mason&2018 is used in the calculation. Mostly auxiliary function for the DISS function.

Usage

disc_score_dt(year, obs, pB, pN, pA)

Arguments

year

a vector of pool variables, typically year.

obs

a vector of observations the observation column, needs to contain -1 if it falls into the first category, 0 for the second and 1 for the third category.

pB

a vector of probabilities for the first category.

pN

a vector of probabilities for the second category.

pA

a vector of probabilities for the third category.

Value

A data table with the scores

Examples

disc_score_dt(year = 1999:2001,
             obs = c(-1,0,0),
             pB = c(0.5,0.3,0),
             pN = c(0.3,0.3,0.7),
             pA = c(0.2,0.4,0.3))


[Package SeaVal version 1.1.1 Index]