dchallenge: Density and random number generation functions for a...

Description Usage Arguments Examples

View source: R/challenge.r

Description

This is a 1/3-2/3 mixture of a t-distribution with 2 degrees of freedom centered at 15 and scaled by 2, and a gamma distribution with shape 2 and rate 1/3. (The t-distribution is windsorised at 0, but this has negligible effect.) This distribution is challenging because it mixes heavy tailed and asymmetric distributions.

Usage

1
2
3

Arguments

x

values to evaluate pdf at

n

number of random samples to generate

Examples

1
2
3
4
5
6
7
8
9
plot(dchallenge, xlim = c(-5, 60), n = 500)

x <- rchallenge(1e4)
hist(x, breaks = 1000)
xsum <- condense(bin(x, 0.1))
plot(xsum$x, xsum$.count, type = "l")
xsmu <- smooth(xsum, 0.3)
plot(xsmu$x, xsmu$.count, type = "l")
plot(xsmu$x, xsmu$.count, type = "l", xlim = c(0, 30))

hadley/bigvis documentation built on May 17, 2019, 9:45 a.m.