rchen: rchen

View source: R/chen_rand.R

rchenR Documentation

rchen

Description

Generates a random vector using the Chen distribution. Thus, the 'chen_rand()' function simulates random variables having a specified Chen Distribution.

Usage

rchen(n = 1, quantile, lambda = 0.1, tau = 0.8)

Arguments

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

Details

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 ]

Value

A vector of size 'n'

Note

Default of lambda is 0.1

Default of tau is 0.8

Examples

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)

AlissonRP/chenReg documentation built on July 20, 2023, 4:50 a.m.