Compute moment-based statistics from probability distributions.
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)
A suitable function object. Here, this is a univariate PMF or spline-based CDF. Refer to the references and see also sections.
Integer, the nth moment
Numeric, the about constant for raw moments.
Integer. In the discrete case, ignored. In the continuous case, the number of intervals, used in the numerical approximation.
Ignored.
A single numeric value.
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.
Refer to the vignette for an overview, references and better examples.
Succinct Constructors Discrete Kernel Smoothing, Continuous Kernel Smoothing, Empirical-Like Distributions
# NOT RUN {
ph.data.prep ()
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