Description Usage Arguments Details Value Functions Examples
Moments, central moments, mean, variance, standard deviation, skewness and (excess) kurtosis for Bernstein polygrams.
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)
|
polygram_object |
a polygram object. |
moment |
positive integer, specifying which moment to calculate. |
excess |
logical, only for kurtosis; if |
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.
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.
mean_polygram
: Calculates the mean of a Bernstein polygram.
moment_polygram
: Calculates the pth moment of a Bernstein polygram.
central_moment_polygram
: Calculates the pth central moment of a Bernstein polygram.
var_polygram
: Calculates the variance of a Bernstein polygram.
sd_polygram
: Calculates the standard deviation of a Bernstein polygram.
skewness_polygram
: Calculates the skewness of a Bernstein polygram.
kurtosis_polygram
: Calculates the (excess) kurtosis of a Bernstein polygram.
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)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.