c95

0th

Percentile

Compute 95% Credible Interval and Mean

Small helper function that computes the 2.5% and 97.5% quantiles and the mean of a vector. Useful for example when using function predict.bamlss.

Keywords
regression
Usage
c95(x)
Arguments
x

A numeric vector.

See Also

predict.bamlss, coef.bamlss

Aliases
  • c95
Examples
# NOT RUN {
x <- rnorm(100)
c95(x)

# }
# NOT RUN {
## Example computing predictions.
set.seed(123)
d <- data.frame("x" = seq(-3, 3, length = 30))
d$y <- sin(d$x) + rnorm(30, sd = 0.3)

## Estimate model and compute predictions.
## with c95().
b <- bamlss(y ~ s(x), data = d)
p <- predict(b, model = "mu", FUN = c95)
plot(d)
matplot(d$x, p, type = "l", lty = c(2, 1, 2),
  col = "black", add = TRUE)

## Example extracting coefficients.
coef(b, FUN = c95)
# }
Documentation reproduced from package bamlss, version 1.1-2, License: GPL-2 | GPL-3

Community examples

Looks like there are no examples yet.