R: Estimate of the Mode of a Discrete Distribution (Most...

mfv {modeest} | R Documentation

## Estimate of the Mode of a Discrete Distribution (Most Frequent Value)

### Description

This function returns the most frequent value(s) in a given numerical vector.

### Usage

      mfv(x, ...)

### Arguments

`x` | numeric. Vector of observations.
`...` | further arguments, which will be ignored.

### Details

Argument `x` is to come from a discrete distribution. This function uses function `tabulate` of R.

### Value

The most frequent value(s) found in `x` is (are) returned.

### Note

The user should preferentially call `mfv` through `mlv(x, method = "mfv")` (or `mlv(x, method = "discrete")`). This returns an object of class `mlv`.

### Author(s)

P. Poncet

### References

- Dutta S. and Goswami A. (2010). Mode estimation for discrete distributions. Mathematical Methods of Statistics, 19(4):374–384.

### See Also

`mlv` for general mode estimation; `geomMode`, `poisMode`, etc. for computation of the mode of the usual discrete distributions

### Examples

    # Unimodal distribution
    x <- rbinom(100, size = 10, prob = 0.8)

    ## True mode
    binomMode(size = 10, prob = 0.8)

    ## Most frequent value
    mfv(x)
    mlv(x, method = "discrete")

    # Bimodal distribution
    x <- rpois(100, lambda = 7)

    ## True mode
    poisMode(lambda = 7)

    ## Most frequent value
    mfv(x)
    M <- mlv(x, method = "discrete")
    print(M)
    plot(M)

[Package modeest version 2.1 Index]