distributions_bernstein_densities: Density, distribution function, quantile function, random...

Description Usage Arguments Value Functions Examples

Description

Density, distribution function, quantile function, random generation, and pth derivative for a Bernstein density with parameter vector lambda.

Usage

1
2
3
4
5
dxbernstein(x, lambda, p = 1, support = c(0, 1), log = FALSE)

dbernstein(x, lambda, p = 1, support = c(0, 1), log = FALSE)

pbernstein(x, lambda, p = 1, support = c(0, 1), log.p = FALSE)

Arguments

x, q

vector of quantiles.

lambda

A vector of positive weights summing to 1.

p

vector of probabilities.

support

The support of the

log, log.p

logical; if TRUE, probabilities p are given as log(p).

n

number of observations. If codelength(n) > 1, the length is taken to be the number required.

lower.tail

logical; if TRUE (default), probabilities are P[x≤X] otherwise, P[X<x].

Value

dbernstein gives the density, pbernstein the distribution function, qbernstein the quantile function, rbeta generates random deviates, and dxbernstein gives the pth derivative of the density function.

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.