73_mode_estimation: Mode Estimation

Description Usage Arguments Value References See Also Examples

Description

Compute the mode or modes, from probability distributions.

Usage

1
2
ph.mode (sf, infv=FALSE, ..., level.names=FALSE, freq, n)
ph.modes (sf, infv=FALSE)

Arguments

sf

A suitable function object.
For ph.mode, this is a univariate PMF or spline-based PDF.
For ph.modes, a spline-based PDF only.

Refer to the references and see also sections.

infv

Logical, if true, return the value of the PMF/PDF at the mode(s).

level.names

Logical, if false, return the category index, if true, return the category name.
Ignored, except for categorical PMFs with infv=FALSE.

freq

Logical, if true, return frequencies.
Ignored, except for PMFs with infv=TRUE.

n

Integer, the sample size.
Ignored, unless both infv and freq are true.

...

Ignored.

Value

ph.mode returns a single integer or numeric value.
(Except for categorical PMFs with infv=FALSE and level.names=TRUE, which return a string).

ph.modes returns a numeric vector.

References

Refer to the vignette for an overview, references and better examples.

See Also

Succinct Constructors
Discrete Kernel Smoothing, Continuous Kernel Smoothing, Categorical Distributions, Empirical-Like Distributions

probmv, rng

ph.mean, moment
quartiles, ntiles, ph.median, ph.quantile

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
prep.ph.data ()

gfh <- pmfuv.cat (crime.type, n.arrests)
cfh <- pdfuv.cks (height, smoothness=0.5)

ph.mode (gfh)
ph.mode (gfh, TRUE)
ph.mode (gfh, TRUE, freq=TRUE)
ph.mode (gfh, category=TRUE)

ph.mode (cfh)
ph.modes (cfh)

probhat documentation built on May 12, 2021, 5:08 p.m.