Learn R Programming

LeMaRns (version 0.1.2)

get_indicators: Calculate indicators

Description

Calculates Mean Maximum Length (MML), the Large Fish Indicator (LFI), Typical Length (TyL) and Length Quantiles (LQ) of the whole community or a subset of the species.

Usage

get_indicators(inputs, outputs, ...)

# S4 method for LeMans_param,LeMans_outputs get_indicators( inputs, outputs, species = 1:dim(outputs@N)[2], time_steps = 1:dim(outputs@N)[3], prob = 0.5, length_LFI = 40 )

# S4 method for LeMans_param,missing get_indicators( inputs, N, species = 1:dim(N)[2], time_steps = 1:dim(N)[3], prob = 0.5, length_LFI = 40 )

# S4 method for missing,LeMans_outputs get_indicators( wgt, mid, l_bound, u_bound, Linf, outputs, species = 1:dim(outputs@N)[2], time_steps = 1:dim(outputs@N)[3], species_names = NULL, prob = 0.5, length_LFI = 40 )

# S4 method for missing,missing get_indicators( wgt, mid, l_bound, u_bound, Linf, N, species = 1:dim(N)[2], time_steps = 1:dim(N)[3], species_names = NULL, prob = 0.5, length_LFI = 40 )

get_LFI(inputs, outputs, ...)

# S4 method for LeMans_param,LeMans_outputs get_LFI( inputs, outputs, species = 1:dim(outputs@N)[2], time_steps = 1:dim(outputs@N)[3], length_LFI = 40 )

# S4 method for LeMans_param,missing get_LFI( inputs, N, species = 1:dim(N)[2], time_steps = 1:dim(N)[3], length_LFI = 40 )

# S4 method for missing,LeMans_outputs get_LFI( wgt, l_bound, u_bound, outputs, species = 1:dim(outputs@N)[2], time_steps = 1:dim(outputs@N)[3], species_names = NULL, length_LFI = 40 )

# S4 method for missing,missing get_LFI( wgt, l_bound, u_bound, N, species = 1:dim(N)[2], time_steps = 1:dim(N)[3], species_names = NULL, length_LFI = 40 )

get_MML(inputs, outputs, ...)

# S4 method for LeMans_param,LeMans_outputs get_MML( inputs, outputs, species = 1:dim(outputs@N)[2], time_steps = 1:dim(outputs@N)[3] )

# S4 method for LeMans_param,missing get_MML(inputs, N, species = 1:dim(N)[2], time_steps = 1:dim(N)[3])

# S4 method for missing,LeMans_outputs get_MML( wgt, Linf, outputs, species = 1:dim(outputs@N)[2], time_steps = 1:dim(outputs@N)[3], species_names = NULL )

# S4 method for missing,missing get_MML( wgt, Linf, N, species = 1:dim(N)[2], time_steps = 1:dim(N)[3], species_names = NULL )

get_TyL(inputs, outputs, ...)

# S4 method for LeMans_param,LeMans_outputs get_TyL( inputs, outputs, species = 1:dim(outputs@N)[2], time_steps = 1:dim(outputs@N)[3] )

# S4 method for LeMans_param,missing get_TyL(inputs, N, species = 1:dim(N)[2], time_steps = 1:dim(N)[3])

# S4 method for missing,LeMans_outputs get_TyL( wgt, mid, outputs, species = 1:dim(outputs@N)[2], time_steps = 1:dim(outputs@N)[3], species_names = NULL )

# S4 method for missing,missing get_TyL( wgt, mid, N, species = 1:dim(N)[2], time_steps = 1:dim(N)[3], species_names = NULL )

get_LQ(inputs, outputs, ...)

# S4 method for LeMans_param,LeMans_outputs get_LQ( inputs, outputs, species = 1:dim(outputs@N)[2], time_steps = 1:dim(outputs@N)[3], prob = 0.5 )

# S4 method for LeMans_param,missing get_LQ(inputs, N, species = 1:dim(N)[2], time_steps = 1:dim(N)[3], prob = 0.5)

# S4 method for missing,LeMans_outputs get_LQ( wgt, u_bound, outputs, species = 1:dim(outputs@N)[2], time_steps = 1:dim(outputs@N)[3], species_names = NULL, prob = 0.5 )

# S4 method for missing,missing get_LQ( wgt, u_bound, N, species = 1:dim(N)[2], time_steps = 1:dim(N)[3], species_names = NULL, prob = 0.5 )

Arguments

inputs

A '>LeMans_param object containing the parameter values of the current LeMans model.

outputs

A '>LeMans_outputs object containing the outputs of the model run.

...

Additional arguments.

species

A numeric value or vector or a character string representing the species that you wish to use to calculate the indicators. The default is 1:dim(N)[2].

time_steps

A numeric vector of the time steps that you wish to use to calculate the indicators. The default is 1:dim(N)[3].

prob

A numeric value or vector between 0 and 1 denoting the length quantiles to be calculated. The default is 0.5.

length_LFI

A numeric vector representing the thresholds to be used to calculate the LFI. The default value is 40.

N

An array with dimensions nsc, nfish and tot_time representing the number of individuals in each length class for each time step.

wgt

A matrix with dimensions nsc and nfish representing the weight of each species in each length class.

mid

A numeric vector of length nfish representing the mid-point of the length classes in the model.

l_bound

A numeric vector of length nsc representing the lower bounds of the length classes.

u_bound

A numeric vector of length nsc representing the upper bounds of the length classes.

Linf

A numeric vector of length nfish representing the asymptotic length of each species.

species_names

A character vector of length nfish that denotes the names of the species in the model.

Value

get_indicators returns a list object with names `LFI`, `MML`, `TYL` and `LQ`. If length(length_LFI)>1, `LFI` is a matrix with dimensions length(time_steps) by length(length_LFI) where the i,jth element represents the LFI using the jth length_LFI in the ith time_steps. If length(length_LFI)==1, the function will return a numeric vector of length length(time_steps). `MML` is a numeric vector of length time_steps where each element is the MML for the species in species. `TYL` is a numeric vector of length time_steps where each element is the TyL for the species in species. If length(prob)==1, `LQ` is a matrix with dimensions length(time_steps) by length(prob) where the i,jth element is the LQ using thejth prob in the ith time_steps. If length(prob)==1, the function will return a numeric vector of length length(time_steps).

If length(length_LFI)==1, get_LFI returns a matrix with dimensions length(time_steps) by length(length_LFI) where the i,jth element is the LFI using the jth length_LFI in the ith time_steps. If length(length_LFI)==1, the function will return a numeric vector of length length(time_steps).

get_MML returns a numeric vector of length time_steps where each element is the MML for the species in species.

If length(prob)>1, get_LQ returns a matrix with dimensions length(time_steps) and length(prob) where the i,jth element is the LQ using the the jth prob in the ith time_steps. If length(prob)==1, the function will return a numeric vector of length length(time_steps).

Details

The LFI represents the proportion of biomass with a length larger than length_LFI. The MML is the biomass weighted mean of Linf:

sum(biomass[species]*Linf[species])/sum(biomass[species])

where biomass is a numeric vector of length nfish representing the biomass of each species. TyL is the biomass-weighted geometric mean length of the community:

exp(sum(biomass_*log(mid))/sum(Bio_l))

where biomass_ is a numeric vector of length nsc representing the biomass of all the species in each length class. The LQ is the length at which the biomass exceeds a given proportion prob of the total biomass.

See Also

plot_indicators

Examples

Run this code
# NOT RUN {
# Set up and run the model
NS_params <- LeMansParam(NS_par, tau=NS_tau, eta=rep(0.25, 21), L50=NS_par$Lmat, other=1e12)
effort <- matrix(0.5, 10, dim(NS_params@Qs)[3])
model_run <- run_LeMans(NS_params, years=10, effort=effort)

# Calculate the indicators
get_indicators(inputs=NS_params, outputs=model_run)

# Calculate the LFI
get_LFI(inputs=NS_params, outputs=model_run)

# Calculate MML
get_MML(inputs=NS_params, outputs=model_run)

# Calculate TyL
get_TyL(inputs=NS_params, outputs=model_run)

# Calculate LQs
get_LQ(inputs=NS_params, outputs=model_run)
# }

Run the code above in your browser using DataLab