rchen | R Documentation |
Generates a random vector using the Chen distribution. Thus, the 'chen_rand()' function simulates random variables having a specified Chen Distribution.
rchen(n = 1, quantile, lambda = 0.1, tau = 0.8)
n |
number of observations. If length(n) > 1, the length is taken to be the number required |
quantile |
median |
lambda |
shape parameter |
tau |
indicates the quantile |
The reparameterized chen distribution has density:
f(y;\lambda,\mu,\tau)=log(1-\tau)/(1-e^{\mu^\lambda}) \lambda y^{\lambda-1}
e^[[log(1-\tau)/1-exp(\mu^\lambda)][1-exp(y^\lambda)]+y^\lambda ]
A vector of size 'n'
Default of lambda is 0.1
Default of tau is 0.8
n <- 500
lambda <- 1
beta <- c(2.5, -2, 3)
X <- cbind(runif(n), runif(n), runif(n))
eta <- X %*% as.matrix(beta)
md <- exp(eta)
rand <- chenreg::rchen(n, md, lambda, tau = 0.7)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.