Description Usage Arguments Examples
Density, distribution function and random generation for the truncated Laplace distribution.
1 2 3 4 5 | dtrunclaplace(x, mean, scale, lower, upper)
ptrunclaplace(q, mean, scale, lower, upper)
rtrunclaplace(n, mean, scale, lower, upper)
|
x, |
q vector of quantiles |
mean |
vector of means |
scale |
vector of scale parameters (> 0) |
lower |
lower bound of distribution |
upper |
upper bound of distribution |
n |
number of observations. If length(n) > 1, the length is taken to be the number required |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
# Compare the distribution of random angles from a truncated
# Laplace versus those from a standard Laplace distribution.
N <- 1000
as <- rlaplace(N, mean=0 scale=1.0)
at <- rtrunclaplace(N, mean=0, scale=1.0, lower=-pi/2, upper=pi/2)
library(ggplot2)
dat <- data.frame(angle = c(as, at), distribution = rep(c("standard", "truncated"), each=N))
ggplot() +
geom_histogram(data=dat, aes(x=angle, fill=distribution), position="dodge", binwidth=pi/10) +
theme_bw()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.