family | R Documentation |
Families of distributions supported by package stepR
.
Deprecation warning: This overviw is deprecated, but still given and up to date for some older, deprecated functions, however, may be removed in a future version. For an overview about the parametric families supported by the new functions see parametricFamily
.
Package stepR
supports several families of distributions (mainly exponential) to model the data, some of which require additional (fixed) parameters. In particular, the following families are available:
"gauss"
normal distribution with unknown mean but known, fixed standard deviation given as a single numeric
(will be estimated using sdrobnorm
if omitted); cf. dnorm
.
"gaussvar"
normal distribution with unknown variance but known, fixed mean assumed to be zero; cf. dnorm
.
"poisson"
Poisson distribution with unknown intensity (no additional parameter); cf. dpois
.
"binomial"
binomial distribution with unknown success probability but known, fixed size given as a single integer
; cf. dbinom
.
"gaussKern"
normal distribution with unknown mean and unknown, fixed standard deviation (being estimated using sdrobnorm
), after filtering with a fixed filter which needs to be given as the additional parameter (a dfilter
object); cf. dfilter
.
The family is selected via the family
argument, providing the corresponding string, while the param
argument contains the parameters if any.
Beware that not all families can be chosen for all functions.
Distributions, parametricFamily
, dnorm
, dpois
, dbinom
, dfilter
, sdrobnorm
# illustrating different families fitted to the same binomial data set
size <- 200
n <- 200
# truth
p <- 10^seq(-3, -0.1, length = n)
# data
y <- rbinom(n, size, p)
plot(y)
lines(size * p, col = "red")
# fit 4 jumps, binomial family
jumps <- 4
bfit <- steppath(y, family = "binomial", param = size, max.blocks = jumps)
lines(bfit[[jumps]], col = "orange")
# Gaussian approximation with estimated variance
gfit <- steppath(y, family = "gauss", max.blocks = jumps)
lines(gfit[[jumps]], col = "green3", lty = 2)
# Poisson approximation
pfit <- steppath(y, family = "poisson", max.blocks = jumps)
lines(pfit[[jumps]], col = "blue", lty = 2)
legend("topleft", legend = c("binomial", "gauss", "poisson"), lwd = 2,
col = c("orange", "green3", "blue"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.