# defuzz: Convert fuzzy set into a crisp numeric value In beerda/lfl: Linguistic Fuzzy Logic

## Description

Take a fuzzy set in the form of a vector of membership degrees and a vector of numeric values that correspond to that degrees and perform a selected type of defuzzification, i.e. conversion of the fuzzy set into a single crisp value.

## Usage

 `1` ```defuzz(degrees, values, type = c("mom", "fom", "lom", "dee")) ```

## Arguments

 `degrees` A fuzzy set in the form of a numeric vector of membership degrees of values provided as the `values` argument. `values` A universe for the fuzzy set. `type` Type of the requested defuzzification method. The possibilities are: `'mom'`: Mean of Maxima - maximum membership degrees are found and a mean of values that correspond to that degrees is returned; `'fom'`: First of Maxima - first value with maximum membership degree is returned; `'lom'`: Last of Maxima - last value with maximum membership degree is returned; `'dee'`: Defuzzification of Evaluative Expressions - method used by the `pbld()` inference mechanism that combines the former three approaches accordingly to the shape of the `degrees` vector: If `degrees` is non-increasing then `'lom'` type is used, if it is non-decreasing then `'fom'` is applied, else `'mom'` is selected.

## Details

Function converts input fuzzy set into a crisp value. The definition of input fuzzy set is provided by the arguments `degrees` and `values`. These arguments should be numeric vectors of the same length, the former containing membership degrees in the interval [0, 1] and the latter containing the corresponding crisp values: i.e., `values[i]` has a membership degree `degrees[i]`.

## Value

A defuzzified value.

## Author(s)

Michal Burda

`fire()`, `aggregateConsequents()`, `perceive()`, `pbld()`, `fcut()`, `lcut()`
 ```1 2 3 4``` ```# returns mean of maxima, i.e., mean of 6, 7, 8 defuzz(c(0, 0, 0, 0.1, 0.3, 0.9, 0.9, 0.9, 0.2, 0), 1:10, type='mom') ```