# calc_LFI: Calculate community indicators In LeMaRns: Length-Based Multispecies Analysis by Numerical Simulation

## Description

Calculates the Large Fish Indicator (LFI), Typical Length (TyL) or Length Quantile (LQ) for the community or a subset of the species.

## Usage

 ```1 2 3 4 5``` ```calc_LFI(wgt, N, bry, prop) calc_LQ(wgt, u_bound, N, prob) calc_TyL(wgt, mid, N) ```

## Arguments

 `wgt` A matrix with dimensions `nsc` and `nfish` representing the weight of each species in each length class. `N` A matrix with dimensions `nsc` and `nfish` representing the number of individuals in each length class for the current time step. `bry` A numeric vector representing the length classes that are larger than `length_LFI`. `prop` A numeric value between 0 and 1 representing how far along, as a proportion, the value of the large indicator threshold is in the length class that contains it. `u_bound` A numeric vector of length `nsc` representing the upper bounds of the length classes. `prob` A numeric value or vector between 0 and 1 denoting the LQ to be calculated. `mid` A numeric vector of length `nfish` representing the mid-point of the length classes in the model.

## Value

`calc_LFI` returns a numeric value or vector representing the proportion of the biomass in the length classes above `bry` and in `prop` of the biomass in the length class `bry`.

`calc_TYL` returns a numeric value or vector representing the biomass-weighted geometric mean length of the community.

`calc_LQ` returns a numeric value or vector representing the length at which biomass exceeds a given proportion `prob` of the total biomass.

`get_indicators`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16``` ```# Set up and run the model NS_params <- LeMansParam(NS_par, tau=NS_tau, eta=rep(0.25, 21), L50=NS_par\$Lmat, other=1e11) effort <- matrix(0.5, 10, dim(NS_params@Qs)) model_run <- run_LeMans(NS_params, years=10, effort=effort) # Calculate the LFI for 40cm bry <- which(NS_params@l_bound<=40 & NS_params@u_bound>40) length_LFI <- 40 prop <- (length_LFI-NS_params@l_bound[bry])/(NS_params@u_bound[bry]-NS_params@l_bound[bry]) LFI <- calc_LFI(model_run@N[,,101], NS_params@wgt, bry, prop) # Calculate TyL for the final time step calc_TyL(wgt=NS_params@wgt, mid=NS_params@mid, N=model_run@N[,,101]) # Calculate the LQ for the final time step calc_LQ(wgt=NS_params@wgt, u_bound=NS_params@u_bound, N=model_run@N[,,101], prob=0.5) ```