moment_functionals: Moments, central moments, mean, variance, standard deviation,...

Description Usage Arguments Details Value Functions Examples

Description

Moments, central moments, mean, variance, standard deviation, skewness and (excess) kurtosis for Bernstein polygrams.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
mean_polygram(polygram_object)

moment_polygram(polygram_object, moment = 1)

central_moment_polygram(polygram_object, moment = 2)

var_polygram(polygram_object)

sd_polygram(polygram_object)

skewness_polygram(polygram_object)

kurtosis_polygram(polygram_object, excess = FALSE)

Arguments

polygram_object

a polygram object.

moment

positive integer, specifying which moment to calculate.

excess

logical, only for kurtosis; if TRUE (default), the excess kurtosis is calculated.

Details

A Bernstein polygram on [a, b] is disjoint mixture of rescaled Bernstein densities on subintervals of [a, b]. Such polygrams can be used for non-parametric density estimation, as an alternative to logsplines and kernel density estimation. These functions help with calculating moments.

Value

mean returns the expected value, var the variance, sd the standard deviation, moment the pth moment, central_moment the pth central moment, skewness the skewness, and kurtosis the kurtosis.

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Do a parametric bootstrap.
set.seed(1337)
data = rbeta(200, 2, 7)
polygram_object = polygram(data, s = 3, m = 4)
current_median = qpolygram(0.5, polygram_object)
medians = replicate(100, {
  new_data = rpolygram(200, polygram_object)
  new_median = qpolygram(0.5, polygram(new_data, s = 3, m = 4))
  new_median
})
plot(polygram(sqrt(200)*(current_median - medians), s = 4, m = 4,
              support = c(-1,1)))

JonasMoss/polygrams documentation built on Nov. 8, 2019, 5:19 p.m.