Description Usage Arguments References Examples
Density, cumulative distribution function, quantile function and random sample generation from the generalized quantile-based asymmetric family of densities defined in Gijbels et al. (2019b).
1 2 3 4 5 6 7 8 |
y, q |
These are each a vector of quantiles. |
eta |
This is the location parameter η. |
phi |
This is the scale parameter φ. |
alpha |
This is the index parameter α. |
f |
This is the reference density function f which is a standard version of a unimodal and symmetric around 0 density. |
g |
This is the "link" function. The function g is to be differentiated. Therefore, g must be written as a function. For example, g<-function(y){log(y)} for log link function. |
F |
This is the cumulative distribution function F of the unimodal and symmetric around 0 reference density function f. |
beta |
This is a vector of probabilities. |
QF |
This is the quantile function of the reference density f. |
lower |
This is the lower limit of the domain (support of the random variable) f_{α}^g(y;η,φ), default -Inf. |
upper |
This is the upper limit of the domain (support of the random variable) f_{α}^g(y;η,φ), default Inf. |
n |
This is the number of observations, which must be a positive integer that has length 1. |
Gijbels, I., Karim, R. and Verhasselt, A. (2019b). Quantile estimation in a generalized asymmetric distributional setting. To appear in Springer Proceedings in Mathematics & Statistics, Proceedings of ‘SMSA 2019’, the 14th Workshop on Stochastic Models, Statistics and their Application, Dresden, Germany, in March 6–8, 2019. Editors: Ansgar Steland, Ewaryst Rafajlowicz, Ostap Okhrin.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | # Example 1: Let F be a standard normal cumulative distribution function then
f_N<-function(s){dnorm(s, mean = 0,sd = 1)} # density function of N(0,1)
F_N<-function(s){pnorm(s, mean = 0,sd = 1)} # distribution function of N(0,1)
QF_N<-function(beta){qnorm(beta, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)}
# For identiy link function
g_id<-function(y){y}
# For log-link function
g_log<-function(y){log(y)}
rnum<-rnorm(100)
beta=c(0.25,0.50,0.75)
# Density
dGAD(y=rnorm(100),eta=10,phi=1,alpha=0.5,f=f_N,g=g_id) # For identity link
dGAD(y=rexp(100,0.1),eta=10,phi=1,alpha=0.5,f=f_N,g=g_log) # For log-link
# Distribution function
pGAD(q=rnorm(100),eta=0,phi=1,alpha=.5,F=F_N,g=g_id) # For identity link
pGAD(q=rexp(100,0.1),eta=10,phi=1,alpha=.5,F=F_N,g=g_log) # For log-link
# Quantile function
qGAD(beta=beta,eta=0,phi=1,alpha=0.5,F=F_N,g=g_id) # For identity link
qGAD(beta=beta,eta=10,phi=1,alpha=0.5,F=F_N,g=g_log,lower = 0, upper = Inf) # For log-link
# random sample generation
rGAD(n=100,eta=0,phi=1,alpha=.5,F=F_N,g=g_id ,lower = -Inf, upper = Inf,QF=NULL) # For identity link
rGAD(n=100,eta=10,phi=1,alpha=.5,F=F_N,g=g_log ,lower =0, upper = Inf,QF=NULL) # For log-link
# Example 2: Let F be a standard Laplace cumulative distribution function then
f_La<-function(s){0.5*exp(-abs(s))} # density function of Laplace(0,1)
F_La<-function(s){0.5+0.5*sign(s)*(1-exp(-abs(s)))} # distribution function of Laplace(0,1)
QF_La<-function(beta){-sign(beta-0.5)*log(1-2*abs(beta-0.5))}
# For identiy link function
g_log<-function(y){log(y)}
beta=c(0.25,0.50,0.75)
# Density
dGAD(y=rnorm(100),eta=10,phi=1,alpha=0.5,f=f_La,g=g_id) # For identity-link
dGAD(y=rexp(100,0.1),eta=10,phi=1,alpha=0.5,f=f_La,g=g_log) # For log-link
# Distribution function
pGAD(q=rnum,eta=0,phi=1,alpha=.5,F=F_La,g=g_id) # For identity-link
pGAD(q=rexp(100,0.1),eta=10,phi=1,alpha=.5,F=F_La,g=g_log) # For log-link
# Quantile function
qGAD(beta=beta,eta=0,phi=1,alpha=0.5,F=F_La,g=g_id,lower = -Inf, upper = Inf) # For identity link
qGAD(beta=beta,eta=10,phi=1,alpha=0.5,F=F_La,g=g_log,lower = 0, upper = Inf) # For log-link
# random sample generation
rGAD(n=100,eta=0,phi=1,alpha=.5,F=F_La,g=g_id) # For identity link
rGAD(n=100,eta=10,phi=1,alpha=.5,F=F_La,g=g_log ,lower =0, upper = Inf,QF=NULL) # For log-link
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.