met_levs: Get estimated BCG levels

Description Usage Arguments Details Value See Also Examples

Description

Get estimated BCG levels from fuzzy membership functions

Usage

1
met_levs(met_in, scr_in, all_out = FALSE)

Arguments

met_in

input data.frame of coral metrics

scr_in

input data.frame of site BCG scores, see details

all_out

logical if probabilities for all BCG levels are returned for each metric, otherwise the single highest probability is returned.

Details

The input scr_in data has two columns labelled station_code and scr. The station codes should match those in met_in. The scr values for each station can be numeric or character string BCG levels that represent qualitative rankings.

BCG levels for each metric are based on the raw metric distributions for the a priori expert rankings of each site. Distributions for each metric at each level are recreated from normal distributions, where the mean and standard deviation of each distribution are based on maximum likelihoods estimates from the raw data.

It is assumed that there is a 100% chance a raw metric value can be assigned to one of several BCG levels across the range of raw values. The probabilities across the range are based on scaled density functions of the raw metrics at each BCG level, where the density functions are scaled such that their sum is always equal to one. This creates a fuzzy membership function where any given value of a raw metric is assigned to a probability for each BCG level, where the sum of all probabilities is equal to one. See the plot from plot_fuzz.

Value

A data.frame of estimated BCG scores for each metric. Probabilities for all levels are returned if all_out = TRUE.

See Also

plot_fuzz

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# coral metrics
met_in <- get_stony_mets(crl_dem)

# bcg scores for each station
station_code <- c(1:5)
scr <- c(2, 5, 3, 2, 4)
scr_in <- data.frame(station_code, scr) 

# get levels
met_levs(met_in, scr_in)

## End(Not run) 

USEPA/CoralBCG documentation built on May 20, 2019, 3:28 p.m.