Learn R Programming

probhat (version 0.4.1)

70_moment-based_statistics: Moment-Based Statistics

Description

Compute moment-based statistics from probability distributions.

Usage

ph.mean (sf, …, n.intervals=200)
ph.sd (sf, …, n.intervals=200)
ph.var (sf, …, n.intervals=200)
ph.skewness (sf, …, n.intervals=200)
ph.kurtosis (sf, …, n.intervals=200)

moment (sf, nth, …, n.intervals=200)

central.moment (sf, nth, …, n.intervals=200) standardized.moment (sf, nth, …, n.intervals=200)

raw.moment (sf, nth, about=0, …, n.intervals=200)

Arguments

sf

A suitable function object. Here, this is a univariate PMF or spline-based CDF. Refer to the references and see also sections.

nth

Integer, the nth moment

about

Numeric, the about constant for raw moments.

n.intervals

Integer. In the discrete case, ignored. In the continuous case, the number of intervals, used in the numerical approximation.

Ignored.

Value

A single numeric value.

Details

The mean/sd/var/skewness/kurtosis functions all call the moment function.

If the moment function is called with nth equal zero, it returns one. If called with nth=1 (the mean), it computes the the first raw moment. If called with nth=2 (the variance), it computes the second central moment. If called with nth=3 (the skewness), it computes the third standardized moment. If called with nth=4 (the kurtosis), it computes the fourth standardized moment. And if called with nth>4, it also computes the nth standardized moment.

Note that currently, the standard deviation, variance and higher moments, should should not be regarded as accurate.

References

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

See Also

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

probmv, rng

quartiles, ntiles, ph.median, ph.quantile ph.mode, ph.modes

Examples

Run this code
# NOT RUN {
prep.ph.data ()

cFh <- cdfuv.cks (height)

ph.mean (cFh)
ph.sd (cFh)
ph.skewness (cFh)
ph.kurtosis (cFh)
# }

Run the code above in your browser using DataLab