These functions return the mode of the main probability distributions implemented in R.
## Continuous distributions
# Beta
betaMode(shape1, shape2, ncp = 0)
# Cauchy
cauchyMode(location = 0, ...)
# Chisquare
chisqMode(df, ncp = 0)
# Exponentiel
expMode(...)
# F
fMode(df1, df2)
# Fisk (package 'VGAM')
fiskMode(shape1.a, scale = 1)
# Frechet (package 'evd')
frechetMode(loc = 0, scale = 1, shape = 1, ...)
# Gamma
gammaMode(shape, rate = 1, scale = 1/rate)
# Normal (Gaussian)
normMode(mean = 0, ...)
# Generalised Extreme Value (package 'evd')
gevMode(loc = 0, scale = 1, shape = 0, ...)
# Generalised Hyperbolic (package 'fBasics')
ghMode(alpha = 1, beta = 0, delta = 1, mu = 0,
lambda = -1/2, ...) # Gompertz (package 'VGAM')
gompertzMode(shape, scale = 1)
# Generalised Pareto (package 'evd')
gpdMode(loc = 0, scale = 1, shape = 0, ...)
# Gumbel (package 'evd')
gumbelMode(loc = 0, ...)
# Hyperbolic (package 'fBasics')
hypMode(alpha = 1, beta = 0, delta = 1, mu = 0,
pm = c(1, 2, 3, 4))
# Koenker (package 'VGAM')
koenkerMode(location = 0, ...)
# Kumaraswamy (package 'VGAM')
kumarMode(shape1, shape2)
# Laplace (package 'VGAM')
laplaceMode(location = 0, ...)
# Logistic
logisMode(location = 0, ...)
# Lognormal
lnormMode(meanlog = 0, sdlog = 1)
# Normal Inverse Gaussian (package 'fBasics')
nigMode(alpha = 1, beta = 0, delta = 1, mu = 0, ...)
# Stable (package 'stabledist')
stableMode(alpha, beta, gamma = 1, delta = 0, pm = 0, ...)
# Negative Weibull (package 'evd')
rweibullMode(loc = 0, scale = 1, shape = 1, ...)
# Paralogistic (package 'VGAM')
paralogisticMode(shape1.a, scale = 1)
# Pareto (package 'VGAM')
paretoMode(location, ...)
# Rayleigh (package 'VGAM')
rayleighMode(scale = 1)
# T (Student)
tMode(df, ncp = 0)
# Uniform
unifMode(min = 0, max = 1)
# Weibull
weibullMode(shape, scale = 1, ...)
## Discrete distributions
# Bernoulli
bernMode(prob)
# Binomial
binomMode(size, prob)
# Geometric
geomMode(...)
# Hypergeometric
hyperMode(m, n, k, ...)
# Negative Binomial
nbinomMode(size, prob, mu)
# Poisson
poisMode(lambda)
First positive parameter of the Beta and Kumaraswamy distributions. See the package VGAM for more details.
Second positive parameter of the Beta and Kumaraswamy distributions. See the package VGAM for more details.
Shape parameter of the Fisk and Paralogistic distributions. See the package VGAM for more details.
Non-centrality parameter of the Beta, Chisquare, and Student distributions.
Location parameter of the Cauchy, Koenker, Laplace, Logistic, and Pareto distributions. See the package VGAM for more details.
Degree of freedom of the Chisquare and Student distributions.
First degree of freedom of the F distribution.
Second degree of freedom of the F distribution.
Location parameter of the Fr\'echet, Generalized Extreme Value, Generalized Pareto, Gumbel, and Negative Weibull distributions.
Scale parameter of the Fisk, Fr\'echet, Gamma, Generalized Extreme Value, Gompertz, Generalized Pareto, Negative Weibull, Paralogistic, Rayleigh, and Weibull distributions. See the packages evd and VGAM for more details.
Shape parameter of the Fr\'echet, Gamma, Generalized Extreme Value, Gompertz, Generalized Pareto, Negative Weibull, and Weibull distributions. See the packages evd and VGAM for more details.
An alternative way to specify the scale of the Gamma distribution.
Mean of the Normal distribution.
Parameter of the Hyperbolic, Generalised Hyperbolic, Stable, and Normal Inverse Gaussian distributions. See the packages fBasics and stabledist for more details.
Parameter of the Hyperbolic, Generalised Hyperbolic, Stable, and Normal Inverse Gaussian distributions. See the packages fBasics and stabledist for more details.
Parameter of the Hyperbolic, Generalised Hyperbolic, Stable, and Normal Inverse Gaussian distributions. See the packages fBasics and stabledist for more details.
Parameter of the Hyperbolic, Generalised Hyperbolic, Normal Inverse Gaussian, and Negative binomial distributions. See the package fBasics for more details.
Vector of (non-negative) means of the Poisson distribution.
Integer value for the selection of the parameterization of the Hyperbolic and Stable distributions. See the packages fBasics and stabledist for more details.
Mean of the Lognormal distribution on the log scale.
Standard deviation of the Lognormal distribution on the log scale.
Scale parameter of the Stable distribution. See the package stabledist for more details.
Lower limit of the Uniform distribution. Must be finite.
Upper limit of the Uniform distribution. Must be finite.
Probability of success on each trial (between 0 and 1), used in the Bernoulli, Binomial and Negative Binomial distributions.
Number of trials (zero or more), used in the Binomial and Negative Binomial distributions.
Number of white balls in the urn for the Hypergeometric distribution.
Number of black balls in the urn for the Hypergeometric distribution.
Number of balls drawn from the urn for the Hypergeometric distribution.
Further arguments, which will be ignored.
A numeric value is returned, the (true) mode of the distribution.
mlv
for the estimation of the mode;
the documentation of the related distributions Beta
, GammaDist
, etc.
# NOT RUN {
layout(mat = matrix(1:2,1,2))
## Beta distribution
curve(dbeta(x, shape1 = 2, shape2 = 3.1), xlim = c(0,1), ylab = "Beta density")
M <- betaMode(shape1 = 2, shape2 = 3.1)
abline(v = M, col = 2)
mlv("beta", shape1 = 2, shape2 = 3.1)
## Lognormal distribution
curve(dlnorm(x, meanlog = 3, sdlog = 1.1), xlim = c(0, 10), ylab = "Lognormal density")
M <- lnormMode(meanlog = 3, sdlog = 1.1)
abline(v = M, col = 2)
mlv("lnorm", meanlog = 3, sdlog = 1.1)
## Poisson distribution
poisMode(lambda = 6)
poisMode(lambda = 6.1)
mlv("poisson", lambda = 6.1)
layout(mat = matrix(1,1,1))
# }
Run the code above in your browser using DataLab