Title: | Asymmetry Measures for Probability Density Functions |
---|---|
Description: | Provides functions and examples for the weak and strong density asymmetry measures in the articles: "A measure of asymmetry", Patil, Patil and Bagkavos (2012) <doi:10.1007/s00362-011-0401-6> and "A measure of asymmetry based on a new necessary and sufficient condition for symmetry", Patil, Bagkavos and Wood (2014) <doi:10.1007/s13171-013-0034-z>. The measures provided here are useful for quantifying the asymmetry of the shape of a density of a random variable. The package facilitates implementation of the measures which are applicable in a variety of fields including e.g. probability theory, statistics and economics. |
Authors: | Dimitrios Bagkavos [aut, cre], Lucia Gamez [aut] |
Maintainer: | Dimitrios Bagkavos <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.2 |
Built: | 2024-12-14 06:35:33 UTC |
Source: | CRAN |
Returns the user-specified probability density function out of a range of available options evaluated at selected grid points.
d.sample(s,dist, p1,p2)
d.sample(s,dist, p1,p2)
s |
A scalar or vector: the x-axis grid points where the probability density function will be evaluated. |
dist |
Character string, used as a switch to the user selected distribution function (see details below). |
p1 |
A scalar. Parameter 1 (vector or object) of the selected density. |
p2 |
A scalar. Parameter 2 (vector or object) of the selected density. |
Based on user-specified argument dist
, the function returns the value of the probability density function at s
.
Supported distributions (along with the corresponding dist
values) are:
weib: The weibull distribution is implemented as
with where
is the shape parameter and
the scale parameter.
lognorm: The lognormal distribution is implemented as
where is the mean and
is the standard deviation of the distirbution.
norm: The normal distribution is implemented as
where is the mean and the
is the standard deviation of the distirbution.
uni: The uniform distribution is implemented as
for .
cauchy: The cauchy distribution is implemented as
where is the location parameter and
the scale parameter.
fnorm: The half normal distribution is implemented as
where
and .
normmixt:The normal mixture distribution is implemented as
where is a mixture component(scalar) and
a vector of parameters for the mean and variance of the two mixture components
.
skewnorm: The skew normal distribution with parameter is implemented as
.
fas: The Fernandez and Steel distribution is implemented as
where is the p.d.f. of the
distribution with
degrees of freedom.
controls the skewness of the distribution with values between
and
denotes the degrees of freedom.
shash: The Sinh-Arcsinh distribution is implemented as
where ,
and
.
is the vector of skewness,
is the scale parameter,
is the location parameter and
the kurtosis parameter.
A vector containing the user selected density values at the user specified points s
.
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]>, Lucia Gamez Gallardo <[email protected]>
selected.dens <- "weib" #select Weibull as the density shape <- 2 # specify shape parameter scale <- 1 # specify scale parameter xout <- seq(0.1,5,length=50) #design point where the density is evaluated d.sample(xout,selected.dens,shape,scale) # calculate density at xout
selected.dens <- "weib" #select Weibull as the density shape <- 2 # specify shape parameter scale <- 1 # specify scale parameter xout <- seq(0.1,5,length=50) #design point where the density is evaluated d.sample(xout,selected.dens,shape,scale) # calculate density at xout
Empirical (nonparametric) cummulative distribution function for given a random sample.
edf(xin, xout)
edf(xin, xout)
xin |
A vector of data points - the available sample. |
xout |
A vector of design points where the distribution function will be estimated. |
The empirical distribution function estimator at is defined as the number of observations up to
, divided by
, i.e.
.
A vector with the estimated distribution function at xout
.
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation:
Dimitrios Bagkavos <[email protected]> , Lucia Gamez Gallardo <[email protected]>
Hollander, M. abd Wolfe, D.A. (1999), Nonparametric Statistical Methods, 2nd edition, Wiley.
x.in <- rexp(200) x.out <- seq(0.1,5,length=60) dist.est <- edf(x.in,x.out) plot(x.out,dist.est,col="blue",main="Empirical c.d.f.",xlab="x",yla ="probability")
x.in <- rexp(200) x.out <- seq(0.1,5,length=60) dist.est <- edf(x.in,x.out) plot(x.out,dist.est,col="blue",main="Empirical c.d.f.",xlab="x",yla ="probability")
Implementation of the Epanechnikov kernel.
Epanechnikov(x)
Epanechnikov(x)
x |
A vector of data points between |
Implements:
for
The value of the kernel at
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> , Lucia Gamez Gallardo <[email protected]>
.Returns the strong asymmetry measure of Patil, Bagkavos and Wood (2014).
eta.s(xin, dist, GridLength, p1, p2)
eta.s(xin, dist, GridLength, p1, p2)
xin |
A vector of data points - the available sample. |
dist |
Character string, specifies selected distribution function. |
GridLength |
A non-negative number, which will be rounded up if fractional.Desired length of the sequence. |
p1 |
A scalar. Parameter 1 (vector or object) of the selected distribution. |
p2 |
A scalar. Parameter 2 (vector or object) of the selected distribution. |
Implements
with .
Uses maximum likehood estimates for the unknown functionals in the definition of the measure.
Returns a scalar, the value of the strong asymmetry measure .
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> , Lucia Gamez Gallardo <[email protected]>
eta.w.hat.bc, eta.w.hat, eta.w.breve,eta.w.breve.bc, eta.w.tilde,eta.w.tilde.bc
selected.dist <- "norm" #select norm as the distribution m.use <- mean(GDP.Per.head.dist.2005) sd.use<- sd(GDP.Per.head.dist.2005) grid <- 50 s.use<- GDP.Per.head.dist.1995 eta.s(GDP.Per.head.dist.2005,selected.dist,grid,m.use,sd.use)
selected.dist <- "norm" #select norm as the distribution m.use <- mean(GDP.Per.head.dist.2005) sd.use<- sd(GDP.Per.head.dist.2005) grid <- 50 s.use<- GDP.Per.head.dist.1995 eta.s(GDP.Per.head.dist.2005,selected.dist,grid,m.use,sd.use)
.Returns the strong asymmetry measure of Patil, Bagkavos and Wood (2014).
eta.s.exact(xin, dist, GridLength, p1, p2)
eta.s.exact(xin, dist, GridLength, p1, p2)
xin |
A vector of data points - the available sample. |
dist |
Character string, specifies selected distribution function. |
GridLength |
A non-negative number, which will be rounded up if fractional.Desired length of the sequence. |
p1 |
A scalar. Parameter 1 (vector or object) of the selected distribution. |
p2 |
A scalar. Parameter 2 (vector or object) of the selected distribution. |
Implements
with
This version uses exact p.d.f. and c.d.f. evaluation and not estimates of the unknown functionals.
Returns a scalar, the value of the strong asymmetry measure .
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> , Lucia Gamez Gallardo <[email protected]>
eta.w.hat.bc, eta.w.hat, eta.w.breve,eta.w.breve.bc, eta.w.tilde,eta.w.tilde.bc,eta.s
selected.dist <- "norm" #select norm as the distribution m.use <- 2 sd.use<- 2 grid <- 50 s.use<- rnorm(100) eta.s.exact(s.use,selected.dist,grid,m.use,sd.use) # calculate eta.s at xout
selected.dist <- "norm" #select norm as the distribution m.use <- 2 sd.use<- 2 grid <- 50 s.use<- rnorm(100) eta.s.exact(s.use,selected.dist,grid,m.use,sd.use) # calculate eta.s at xout
Implements the asymmetry coefficient of Patil, Patil and Bagkavos (2012).
eta.w.breve(xin, kfun)
eta.w.breve(xin, kfun)
xin |
A vector of data points - the available sample. |
kfun |
The kernel to use in the density estimate. |
Given a sample from a continuous density function
and distribution function
,
is defined by
where
Returns a scalar, the estimate of .
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]>, Lucia Gamez Gallardo <[email protected]>
eta.w.hat.bc, eta.w.hat, eta.w.breve.bc, eta.w.tilde,eta.w.tilde.bc
eta.w.breve(GDP.Per.head.dist.1995,Epanechnikov) 0.329707 #estimate of etabreve
eta.w.breve(GDP.Per.head.dist.1995,Epanechnikov) 0.329707 #estimate of etabreve
using boundary correctionImplements the asymmetry coefficient of Patil, Patil and Bagkavos (2012).
eta.w.breve.bc(xin, kfun)
eta.w.breve.bc(xin, kfun)
xin |
A vector of data points - the available sample. |
kfun |
The kernel to use in the density estimate. |
Given a sample from a continuous density function
and distribution function
.
is defined by
where
eta.w.breve.bc
uses reflection to correct the boundary bias of the kernel density estimate kde
Returns a scalar, the estimate of .
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> , Lucia Gamez Gallardo <[email protected]>
eta.w.hat.bc, eta.w.hat, eta.w.breve, eta.w.tilde,eta.w.tilde.bc
eta.w.breve.bc(GDP.Per.head.dist.1995,Epanechnikov) 0.329707 #estimate of etabreve
eta.w.breve.bc(GDP.Per.head.dist.1995,Epanechnikov) 0.329707 #estimate of etabreve
Implements the asymmetry coefficient of Patil, Patil and Bagkavos (2012).
eta.w.hat(xin, kfun)
eta.w.hat(xin, kfun)
xin |
A vector of data points - the available sample. |
kfun |
The kernel to use in the density estimate. |
Given a sample from a continuous density function
and distribution function
,
is defined by
where
Returns a scalar, the estimate of .
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]>, Lucia Gamez Gallardo <[email protected]>
eta.w.hat.bc, eta.w.breve, eta.w.breve.bc, eta.w.tilde,eta.w.tilde.bc
eta.w.hat(GDP.Per.head.dist.1995,Epanechnikov) 0.3463025 #estimate of etahat
eta.w.hat(GDP.Per.head.dist.1995,Epanechnikov) 0.3463025 #estimate of etahat
using boundary correctionImplements the asymmetry coefficient of Patil, Patil and Bagkavos (2012)
eta.w.hat.bc(xin, kfun)
eta.w.hat.bc(xin, kfun)
xin |
A vector of data points - the available sample. |
kfun |
The kernel to use in the density estimate. |
Given a sample from a continuous density function
and distribution function
,
is defined by
where
eta.w.hat.bc
uses reflection to correct the boundary bias issue of the kernel estimate kde
.
Returns a scalar, the estimate of .
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]>, Lucia Gamez Gallardo <[email protected]>
eta.w.hat, eta.w.breve, eta.w.breve.bc, eta.w.tilde,eta.w.tilde.bc
eta.w.hat.bc(GDP.Per.head.dist.1995,Epanechnikov) 0.3463025 #estimate of etahat.bc
eta.w.hat.bc(GDP.Per.head.dist.1995,Epanechnikov) 0.3463025 #estimate of etahat.bc
Implements the asymmetry coefficient of Patil, Patil and Bagkavos (2012).
eta.w.tilde(xin, kfun)
eta.w.tilde(xin, kfun)
xin |
A vector of data points - the available sample. |
kfun |
The kernel to use in the density estimate. |
Given a sample from a continuous density function
and distribution function
.
is defined by
where
Returns a scalar, the estimate of .
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> , Lucia Gamez Gallardo <[email protected]>
eta.w.hat.bc, eta.w.hat, eta.w.breve.bc, eta.w.breve,eta.w.tilde.bc
eta.w.tilde(GDP.Per.head.dist.1995,Epanechnikov) 0.3333485 #estimate of etatile
eta.w.tilde(GDP.Per.head.dist.1995,Epanechnikov) 0.3333485 #estimate of etatile
using boundary correctionImplements the asymmetry coefficient of Patil, Patil and Bagkavos (2012).
eta.w.tilde.bc(xin, kfun)
eta.w.tilde.bc(xin, kfun)
xin |
A vector of data points - the available sample. |
kfun |
The kernel to use in the density estimate. |
Given a sample from a continuous density function
and distribution function
,
is defined by
where
eta.w.tilde.bc
uses reflection to correct the boundary bias of kde
.
Returns a scalar, the estimate of .
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> , Lucia Gamez Gallardo <[email protected]>
eta.w.hat.bc, eta.w.hat, eta.w.breve.bc, eta.w.breve,eta.w.tilde
eta.w.tilde.bc(GDP.Per.head.dist.1995,Epanechnikov) 0.3333485 #estimate of etatile.bc
eta.w.tilde.bc(GDP.Per.head.dist.1995,Epanechnikov) 0.3333485 #estimate of etatile.bc
Contains values of the GDP/head distribution of 216 EU regions (the so called NUTS-2 level of the Eurostat categorization of territories within the EU for the year 1995.
GDP.Per.head.dist.1995
GDP.Per.head.dist.1995
A vector with 184 values of the GDP/head distribution for 1995.
Monfort, P. (2008). Convergence of EU regions measures and evolution. EU short papers on regional research and indicators, Directorate-General for Regional Policy 1/2008.
Contains values of the GDP/head distribution of 216 EU regions (the so called NUTS-2 level of the Eurostat categorization of territories within the EU for the year 2005.
GDP.Per.head.dist.1995
GDP.Per.head.dist.1995
A vector with 184 values of the GDP/head distribution for 2005.
Monfort, P. (2008). Convergence of EU regions measures and evolution. EU short papers on regional research and indicators, Directorate-General for Regional Policy 1/2008.
Implements the Integrated Epanechnikov kernel.
IntEpanechnikov(x)
IntEpanechnikov(x)
x |
A vector of design points with values from |
Implements:
for
The value of the integrated kernel function at the user designated points.
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> , Lucia Gamez Gallardo <[email protected]>
Classical univariate integrated kernel density estimator
IntKde(xin, xout, h, kfun)
IntKde(xin, xout, h, kfun)
xin |
A vector of data points - the available sample size. |
xout |
grid points where the distribution function will be estimated. |
h |
The bandwidth parameter. Defaults to |
kfun |
The kernel to use in the distribution function estimate. |
It implements the classical density integrated kernel estimator.
Let be a univariate independent and identically distributed sample drawn from some unknown distribution function
. Its kernel density estimator is
where is an integrated kernel, and
is a smoothing parameter called the bandwidth.
Returns a vector with the estimate of the distribution function at the user specified grid points.
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]>, Lucia Gamez Gallardo <[email protected]>
bw.nrd
, bw.nrd0
, bw.ucv
, bw.bcv
x.in <- rnorm(100) x.out <- seq(-3.4,3.4,length=60) kernel <- IntEpanechnikov dist.est <- IntKde(xin=x.in,xout=x.out,kfun=kernel) plot(x.out,dist.est, type="l", col="red", main="Kernel c.d.f. estimator")
x.in <- rnorm(100) x.out <- seq(-3.4,3.4,length=60) kernel <- IntEpanechnikov dist.est <- IntKde(xin=x.in,xout=x.out,kfun=kernel) plot(x.out,dist.est, type="l", col="red", main="Kernel c.d.f. estimator")
Classical univariate kernel density estimator.
kde(xin, xout, h, kfun)
kde(xin, xout, h, kfun)
xin |
A vector of data points. Missing values not allowed. |
xout |
A vector of grid points at which the estimate will be calculated. |
h |
A scalar, the bandwidth to use in the estimate, e.g. |
kfun |
Kernel function to use. |
Implements the classical density kernel estimator based on a sample of i.i.d observations from a distribution
with density
. The estimator is defined by
where is determined by a bandwidth selector such as Silverman's default plug-in rule and
, the kernel, is a non-negative probability density function.
A vector with the density estimates at the designated points xout.
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> , Lucia Gamez Gallardo <[email protected]>
bw.nrd
, bw.nrd0
, bw.ucv
, bw.bcv
x.in <- rnorm(100) x.out <- seq(-3.4,3.4,length=60) bandwidth <- bw.nrd(x.in) kernel <- Epanechnikov dens.est <- kde(x.in,x.out,bandwidth,kernel) plot(x.out,dens.est,col="red",main="Kernel density estimator")
x.in <- rnorm(100) x.out <- seq(-3.4,3.4,length=60) bandwidth <- bw.nrd(x.in) kernel <- Epanechnikov dens.est <- kde(x.in,x.out,bandwidth,kernel) plot(x.out,dens.est,col="red",main="Kernel density estimator")
Returns the value of the selected cumulative distribution function at user supplied grid points.
p.sample(s,dist, p1,p2)
p.sample(s,dist, p1,p2)
s |
A scalar or vector: the x-axis grid points where the cumulative distribution function is be evaluated. |
dist |
Character string, used as a switch to the user selected distribution function (see details below). |
p1 |
A scalar. Parameter 1 (vector or object) of the selected distribution. |
p2 |
A scalar. Parameter 2 (vector or object) of the selected distribution. |
Based on the user-specified argument dist
, the function returns the value of the cumulative distribution function at s
.
Supported distributions (along with the corresponding dist
values) are:
weib: The Weibull distribution is implemented as
with where
is the shape parameter and
the scale parameter.
lognorm: The lognormal distribution is implemented as
where is the mean,
is the standard deviation and
is the cumulative distribution function of the standard normal distribution.
norm: The normal distribution is implemented as
where is the mean and the
is the standard deviation.
uni: The uniform distribution is implemented as
for
cauchy: The cauchy distribution is implemented as
where is the location parameter and
the scale parameter.
fnorm: The half normal distribution is implemented as
where and
.
normmixt: The normal mixture distribution is implemented as
where is a mixture component(scalar) and
a vector of parameters for the mean and variance of the two mixture components
.
skewnorm: The skew normal distribution is implemented as
where ,
,
and
is the Owens T function, defined by
fas: The Fernandez and Steel distribution is implemented as
where is the p.d.f. of the t distribution with
degrees of freedom.
controls the skewness of the distribution with values between
and
is the degrees of freedom.
shash: The Sinh-Arcsinh distribution is implemented as
where ,
and
.
is the vector of skewness,
is the scale parameter,
is the location parameter and
the kurtosis parameter.
A vector containing the cumulative distribution function values at the user specified points s
.
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> , Lucia Gamez Gallardo <[email protected]>
selected.d <- "weib" #select Weibull as the CDF shape <- 2 # specify shape parameter scale <- 1 # specify scale parameter xout <- seq(0.1,5,length=50) #design point where the CDF is evaluated p.sample(xout,selected.d,shape,scale) # calculate CDF at xout
selected.d <- "weib" #select Weibull as the CDF shape <- 2 # specify shape parameter scale <- 1 # specify scale parameter xout <- seq(0.1,5,length=50) #design point where the CDF is evaluated p.sample(xout,selected.d,shape,scale) # calculate CDF at xout
Calculates the square of a density.
pdfsq(s,dist, p1,p2)
pdfsq(s,dist, p1,p2)
s |
A scalar or vector: the x-axis grid points where the probability density function will be evaluated. |
dist |
Character string, used as a switch to the user selected distribution function (see details below). |
p1 |
A scalar. Parameter 1 (vector or object) of the selected density. |
p2 |
A scalar. Parameter 2 (vector or object) of the selected density. |
Based on user-specified argument dist
, the function returns the value of , used in the definitions of
,
and their exact versions.
Supported distributions (along with the corresponding dist
values) are:
weib: The weibull distribution is implemented as
with where
is the shape parameter and
the scale parameter.
lognorm: The lognormal distribution is implemented as
where is the mean and
is the standard deviation of the distirbution.
norm: The normal distribution is implemented as
where is the mean and the
is the standard deviation of the distirbution.
uni: The uniform distribution is implemented as
for .
cauchy: The cauchy distribution is implemented as
where is the location parameter and
the scale parameter.
fnorm: The half normal distribution is implemented as
where
and .
normmixt:The normal mixture distribution is implemented as
where is a mixture component(scalar) and
a vector of parameters for the mean and variance of the two mixture components
.
skewnorm: The skew normal distribution with parameter is implemented as
.
fas: The Fernandez and Steel distribution is implemented as
where is the p.d.f. of the
distribution with
degrees of freedom.
controls the skewness of the distribution with values between
and
denotes the degrees of freedom.
shash: The Sinh-Arcsinh distribution is implemented as
where ,
and
.
is the vector of skewness,
is the scale parameter,
is the location parameter and
the kurtosis parameter.
A vector containing the user selected density values at the user specified points s
.
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]>, Lucia Gamez Gallardo <[email protected]>
selected.dens <- "weib" #select Weibull shape <- 2 # specify shape parameter scale <- 1 # specify scale parameter xout <- seq(0.1,5,length=50) #design point pdfsq(xout,selected.dens,shape,scale) # calculate the square density at xout
selected.dens <- "weib" #select Weibull shape <- 2 # specify shape parameter scale <- 1 # specify scale parameter xout <- seq(0.1,5,length=50) #design point pdfsq(xout,selected.dens,shape,scale) # calculate the square density at xout
Return the product
pdfsqcdf(s,dist, p1,p2)
pdfsqcdf(s,dist, p1,p2)
s |
A scalar or vector: the x-axis grid points where the probability density function will be evaluated. |
dist |
Character string, used as a switch to the user selected distribution function (see details below). |
p1 |
A scalar. Parameter 1 (vector or object) of the selected density. |
p2 |
A scalar. Parameter 2 (vector or object) of the selected density. |
Based on user-specified argument dist
, the function returns the value of , used in the definitions of
,
and their exact versions.
Supported distributions (along with the corresponding dist
values) are:
weib: The weibull distribution is implemented as
with where
is the shape parameter and
the scale parameter.
lognorm: The lognormal distribution is implemented as
where is the mean and
is the standard deviation of the distirbution.
norm: The normal distribution is implemented as
where is the mean and the
is the standard deviation of the distirbution.
uni: The uniform distribution is implemented as
for .
cauchy: The cauchy distribution is implemented as
where is the location parameter and
the scale parameter.
fnorm: The half normal distribution is implemented as
where
and .
normmixt:The normal mixture distribution is implemented as
where is a mixture component(scalar) and
a vector of parameters for the mean and variance of the two mixture components
.
skewnorm: The skew normal distribution with parameter is implemented as
.
fas: The Fernandez and Steel distribution is implemented as
where is the p.d.f. of the
distribution with
degrees of freedom.
controls the skewness of the distribution with values between
and
denotes the degrees of freedom.
shash: The Sinh-Arcsinh distribution is implemented as
where ,
and
.
is the vector of skewness,
is the scale parameter,
is the location parameter and
the kurtosis parameter.
A vector containing the user selected density values at the user specified points s
.
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> ,Lucia Gamez Gallardo <[email protected]>
selected.dens <- "weib" #select Weibull shape <- 2 # specify shape parameter scale <- 1 # specify scale parameter xout <- seq(0.1,5,length=50) #design point pdfsqcdf(xout,selected.dens,shape,scale) # calculate pdfsqcdf function at xout
selected.dens <- "weib" #select Weibull shape <- 2 # specify shape parameter scale <- 1 # specify scale parameter xout <- seq(0.1,5,length=50) #design point pdfsqcdf(xout,selected.dens,shape,scale) # calculate pdfsqcdf function at xout
.Return the product .
pdfsqcdfstar(s,dist, p1,p2)
pdfsqcdfstar(s,dist, p1,p2)
s |
A scalar or vector: the x-axis grid points where the probability density function will be evaluated. |
dist |
Character string, used as a switch to the user selected distribution function (see details below). |
p1 |
A scalar. Parameter 1 (vector or object) of the selected density. |
p2 |
A scalar. Parameter 2 (vector or object) of the selected density. |
Based on user-specified argument dist
, the function returns the value of
, used in the definitions of
,
and their exact versions.
Supported distributions (along with the corresponding dist
values) are:
weib: The weibull distribution is implemented as
with where
is the shape parameter and
the scale parameter.
lognorm: The lognormal distribution is implemented as
where is the mean and
is the standard deviation of the distirbution.
norm: The normal distribution is implemented as
where is the mean and the
is the standard deviation of the distirbution.
uni: The uniform distribution is implemented as
for .
cauchy: The cauchy distribution is implemented as
where is the location parameter and
the scale parameter.
fnorm: The half normal distribution is implemented as
where
and .
normmixt:The normal mixture distribution is implemented as
where is a mixture component(scalar) and
a vector of parameters for the mean and variance of the two mixture components
.
skewnorm: The skew normal distribution with parameter is implemented as
.
fas: The Fernandez and Steel distribution is implemented as
where is the p.d.f. of the
distribution with
degrees of freedom.
controls the skewness of the distribution with values between
and
denotes the degrees of freedom.
shash: The Sinh-Arcsinh distribution is implemented as
where ,
and
.
is the vector of skewness,
is the scale parameter,
is the location parameter and
the kurtosis parameter.
A vector containing the user selected density values at the user specified points s
.
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]>, Lucia Gamez Gallardo <[email protected]>
selected.dens <- "weib" #select Weibull shape <- 2 # specify shape parameter scale <- 1 # specify scale parameter xout <- seq(0.1,5,length=50) #design point pdfsqcdfstar(xout,selected.dens,shape,scale) #return f^2(xout)F(xout)
selected.dens <- "weib" #select Weibull shape <- 2 # specify shape parameter scale <- 1 # specify scale parameter xout <- seq(0.1,5,length=50) #design point pdfsqcdfstar(xout,selected.dens,shape,scale) #return f^2(xout)F(xout)
Return the value of .
pdfthird(s,dist, p1,p2)
pdfthird(s,dist, p1,p2)
s |
A scalar or vector: the x-axis grid points where the probability density function will be evaluated. |
dist |
Character string, used as a switch to the user selected distribution function (see details below). |
p1 |
A scalar. Parameter 1 (vector or object) of the selected density. |
p2 |
A scalar. Parameter 2 (vector or object) of the selected density. |
Based on user-specified argument dist
, the function returns the value of , used in the definitions of
,
and their exact versions.
Supported distributions (along with the corresponding dist
values) are:
weib: The weibull distribution is implemented as
with where
is the shape parameter and
the scale parameter.
lognorm: The lognormal distribution is implemented as
where is the mean and
is the standard deviation of the distirbution.
norm: The normal distribution is implemented as
where is the mean and the
is the standard deviation of the distirbution.
uni: The uniform distribution is implemented as
for .
cauchy: The cauchy distribution is implemented as
where is the location parameter and
the scale parameter.
fnorm: The half normal distribution is implemented as
where
and .
normmixt:The normal mixture distribution is implemented as
where is a mixture component(scalar) and
a vector of parameters for the mean and variance of the two mixture components
.
skewnorm: The skew normal distribution with parameter is implemented as
.
fas: The Fernandez and Steel distribution is implemented as
where is the p.d.f. of the
distribution with
degrees of freedom.
controls the skewness of the distribution with values between
and
denotes the degrees of freedom.
shash: The Sinh-Arcsinh distribution is implemented as
where ,
and
.
is the vector of skewness,
is the scale parameter,
is the location parameter and
the kurtosis parameter.
A vector containing the user selected density values at the user specified points s
.
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> ,Lucia Gamez Gallardo <[email protected]>
selected.dens <- "weib" #select Weibull shape <- 2 # specify shape parameter scale <- 1 # specify scale parameter xout <- seq(0.1,5,length=50) #design point pdfthird(xout,selected.dens,shape,scale) # calculate density to the cube at xout
selected.dens <- "weib" #select Weibull shape <- 2 # specify shape parameter scale <- 1 # specify scale parameter xout <- seq(0.1,5,length=50) #design point pdfthird(xout,selected.dens,shape,scale) # calculate density to the cube at xout
Returns the quantiles of selected distributions at user specified locations.
q.sample(s,dist, p1=0,p2=1)
q.sample(s,dist, p1=0,p2=1)
s |
A scalar or vector: the probabilities where the quantile function will be evaluated. |
dist |
Character string, used as a switch to the user selected distribution function (see details below). |
p1 |
A scalar. Parameter 1 (vector or object) of the selected distribution. |
p2 |
A scalar. Parameter 2 (vector or object) of the selected distribution. |
Based on user-specified argument dist
, the function returns the value of the quantile function at s
.
Supported distributions (along with the corresponding dist
values) are:
weib: The quantile function for the weibull distribution is implemented as
where is the shape parameter and
the scale parameter.
lognorm: The lognormal distribution has quantile function implemented as
where is the mean,
is the standard deviation and
is the Gauss error function.
norm: The normal distribution has quantile function implemented as
where is the mean and the
is the standard deviation.
uni: The uniform distribution has quantile function implemented as
for .
cauchy: The cauchy distribution has quantile function implemented as
where is the location parameter and
the scale parameter.
fnorm: The half normal distribution has quantile function implemented as
where and is the standard deviation of the distribution.
normmix: The quantile function normal mixture distribution is estimated numericaly, based on the built in quantile function.
skewnorm: There is no closed form expression for the quantile function of the skew normal distribution. For this reason, the quantiles are calculated through the qsn
function of the sn package.
fas:There is no closed form expression for the quantile function of the Fernandez and Steel distribution. For this reason, the quantiles are calculated through the qskt
function of the skewt package.
shash:There is no closed form expression for the quantile function of the Sinh-Arcsinh distribution. For this reason, the quantiles are calculated through the qSHASHo
function of the gamlss package.
A vector containing the quantile values at the user specified points s
.
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> , Lucia Gamez Gallardo <[email protected]>
selected.q <- "norm" #select Normal as the distribution shape <- 2 # specify shape parameter scale <- 2 # specify scale parameter xout <- seq(0.1,1,length=50) #design point where the quantile function is evaluated q.sample(xout,selected.q,shape,scale) # calculate quantiles at xout
selected.q <- "norm" #select Normal as the distribution shape <- 2 # specify shape parameter scale <- 2 # specify scale parameter xout <- seq(0.1,1,length=50) #design point where the quantile function is evaluated q.sample(xout,selected.q,shape,scale) # calculate quantiles at xout
Generate a random sample of size out of a range of available distributions.
r.sample(s, dist, p1=0, p2=1)
r.sample(s, dist, p1=0, p2=1)
s |
A scalar which specifies the size of the random sample drawn. |
dist |
Character string, used as a switch to the user selected distribution function (see details below). |
p1 |
A scalar. Parameter 1 (vector or object) of the selected distribution. |
p2 |
A scalar. Parameter 2 (vector or object) of the selected distribution. |
Based on user-specified argument dist
, the function returns a random sample of size from the corresponding distribution.
Supported distributions (along with the corresponding dist
values) are:
weib: The weibull distribution is implemented as
with where
is the shape parameter and
the scale parameter.
lognorm: The lognormal distribution is implemented as
where is the mean and
is the standard deviation of the distirbution.
norm: The normal distribution is implemented as
where is the mean and the
is the standard deviation of the distirbution.
uni: The uniform distribution is implemented as
for .
cauchy: The cauchy distribution is implemented as
where is the location parameter and
the scale parameter.
fnorm: The half normal distribution is implemented as
where
and .
normmixt:The normal mixture distribution is implemented as
where is a mixture component(scalar) and
a vector of parameters for the mean and variance of the two mixture components
.
skewnorm: The skew normal distribution with parameter is implemented as
.
fas: The Fernandez and Steel distribution is implemented as
where is the p.d.f. of the
distribution with
degrees of freedom.
controls the skewness of the distribution with values between
and
denotes the degrees of freedom.
shash: The Sinh-Arcsinh distribution is implemented as
where ,
and
.
is the vector of skewness,
is the scale parameter,
is the location parameter and
the kurtosis parameter.
A vector of random values at the user specified points s
.
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> , Lucia Gamez Gallardo <[email protected]>
selected.r <- "norm" #select Normal as the distribution shape <- 2 # specify shape parameter scale <- 1 # specify scale parameter n <- 100 # specify sample size r.sample(n,selected.r,shape,scale) # calculate CDF at the designated point
selected.r <- "norm" #select Normal as the distribution shape <- 2 # specify shape parameter scale <- 1 # specify scale parameter n <- 100 # specify sample size r.sample(n,selected.r,shape,scale) # calculate CDF at the designated point
, used in the implementation of the strong asymmetry measure
.Estimates , used in the calculation of the strong asymetry measure
.
Rho.p(xin, p.param, dist, p1=0, p2=1)
Rho.p(xin, p.param, dist, p1=0, p2=1)
xin |
A vector of data points - the available sample. |
p.param |
A parameter with the value greater than or equal to 1/2 and less than 1. |
dist |
Character string, specifies selected distribution function. |
p1 |
A scalar. Parameter 1 (vector or object) of the selected distribution. |
p2 |
A scalar. Parameter 2 (vector or object) of the selected distribution. |
Implements the quantity:
defined on page 6 Patil, Bagkavos and Wood, see also (4) in Bagkavos, Patil and Wood . Estimation of the p.d.f. and c.d.f. functions is currently performed by maximum likelihood as e.g. kernel estimates inherit large amount of variance to .
Returns a scalar, the value of .
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> , Lucia Gamez Gallardo <[email protected]>
Rho.p.exact,Rhostar.p, Rhostar.p.exact
set.seed(1234) selected.r <- "weib" #select Weibull as the distribution shape <- 1 # specify shape parameter scale <- 1 # specify scale parameter n <- 100 # specify sample size param <- 0.9 # specify parameter xout<-r.sample(n,selected.r,shape,scale) # specify sample Rho.p(xout,param,selected.r,shape,scale) # calculate Rho.p #-0.06665222 # returns the result selected.r2 <- "norm" #select Normal as the distribution n <- 100 # specify sample size mean <- 0 # specify the mean sd <- 1 # specify the variance param <- 0.9 # specify parameter xout <-r.sample(n,selected.r2,mean,sd) # specify sample Rho.p(xout,param,selected.r2,mean,sd) # calculate Rho.p #-0.1005591 # returns the result selected.r3 <- "cauchy" #select Cauchy as the distribution n <- 100 # specify sample size location <- 0 # specify the location parameter scale <- 1 # specify the scale parameter param <- 0.9 # specify parameter xout<-r.sample(n,selected.r3,location,scale) # specify sample Rho.p(xout,param,selected.r3,location,scale) # calculate Rho.p #-0.0580943 # returns the result
set.seed(1234) selected.r <- "weib" #select Weibull as the distribution shape <- 1 # specify shape parameter scale <- 1 # specify scale parameter n <- 100 # specify sample size param <- 0.9 # specify parameter xout<-r.sample(n,selected.r,shape,scale) # specify sample Rho.p(xout,param,selected.r,shape,scale) # calculate Rho.p #-0.06665222 # returns the result selected.r2 <- "norm" #select Normal as the distribution n <- 100 # specify sample size mean <- 0 # specify the mean sd <- 1 # specify the variance param <- 0.9 # specify parameter xout <-r.sample(n,selected.r2,mean,sd) # specify sample Rho.p(xout,param,selected.r2,mean,sd) # calculate Rho.p #-0.1005591 # returns the result selected.r3 <- "cauchy" #select Cauchy as the distribution n <- 100 # specify sample size location <- 0 # specify the location parameter scale <- 1 # specify the scale parameter param <- 0.9 # specify parameter xout<-r.sample(n,selected.r3,location,scale) # specify sample Rho.p(xout,param,selected.r3,location,scale) # calculate Rho.p #-0.0580943 # returns the result
, used in the implementation of the strong asymmetry measure
.Returns , used in the calculation of the strong asymetry measure
.
Rho.p.exact(xin, p.param, dist, p1=0, p2=1)
Rho.p.exact(xin, p.param, dist, p1=0, p2=1)
xin |
A vector of data points - the available sample. |
p.param |
A parameter with the value greater than or equal to 1/2 and less than 1. |
dist |
Character string, specifies selected distribution function. |
p1 |
A scalar. Parameter 1 (vector or object) of the selected distribution. |
p2 |
A scalar. Parameter 2 (vector or object) of the selected distribution. |
Implements the quantity:
defined on page 6 Patil, Bagkavos and Wood, see also (4) in Bagkavos, Patil and Wood . This implementation uses exact calculation of the functionals in the definition of .
Returns a scalar, the exact value of .
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> , Lucia Gamez Gallardo <[email protected]>
Rho.p,Rhostar.p, Rhostar.p.exact
set.seed(1234) selected.r <- "weib" #select Weibull as the distribution shape <- 1 # specify shape parameter scale <- 1 # specify scale parameter n <- 100 # specify sample size param <- 0.9 # specify parameter xout<-r.sample(n,selected.r,shape,scale) # specify sample Rho.p.exact(xout,param,selected.r,shape,scale) # calculate Rho.p.exact #-0.06665222 # returns the result selected.r2 <- "norm" #select Normal as the distribution n <- 100 # specify sample size mean <- 0 # specify the mean sd <- 1 # specify the variance param <- 0.9 # specify parameter xout <-r.sample(n,selected.r2,mean,sd) # specify sample Rho.p.exact(xout,param,selected.r2,mean,sd) # calculate Rho.p.exact #-0.2384271 # returns the result selected.r3 <- "cauchy" #select Cauchy as the distribution n <- 100 # specify sample size location <- 0 # specify the location parameter scale <- 1 # specify the scale parameter param <- 0.9 # specify parameter xout<-r.sample(n,selected.r3,location,scale) # specify sample Rho.p.exact(xout,param,selected.r3,location,scale) # calculate Rho.p.exact #-0.02340374 # returns the result
set.seed(1234) selected.r <- "weib" #select Weibull as the distribution shape <- 1 # specify shape parameter scale <- 1 # specify scale parameter n <- 100 # specify sample size param <- 0.9 # specify parameter xout<-r.sample(n,selected.r,shape,scale) # specify sample Rho.p.exact(xout,param,selected.r,shape,scale) # calculate Rho.p.exact #-0.06665222 # returns the result selected.r2 <- "norm" #select Normal as the distribution n <- 100 # specify sample size mean <- 0 # specify the mean sd <- 1 # specify the variance param <- 0.9 # specify parameter xout <-r.sample(n,selected.r2,mean,sd) # specify sample Rho.p.exact(xout,param,selected.r2,mean,sd) # calculate Rho.p.exact #-0.2384271 # returns the result selected.r3 <- "cauchy" #select Cauchy as the distribution n <- 100 # specify sample size location <- 0 # specify the location parameter scale <- 1 # specify the scale parameter param <- 0.9 # specify parameter xout<-r.sample(n,selected.r3,location,scale) # specify sample Rho.p.exact(xout,param,selected.r3,location,scale) # calculate Rho.p.exact #-0.02340374 # returns the result
, used in the implementation of the strong asymmetry measure
.Estimates , used in the calculation of the strong asymetry measure
.
Rhostar.p(xin, p.param, dist, p1, p2)
Rhostar.p(xin, p.param, dist, p1, p2)
xin |
A vector of data points - the available sample. |
p.param |
A parameter with the value greater than or equal to 1/2 and less than 1. |
dist |
Character string, specifies selected distribution function. |
p1 |
A scalar. Parameter 1 (vector or object) of the selected distribution. |
p2 |
A scalar. Parameter 2 (vector or object) of the selected distribution. |
Implements the quantity
defined on page 6 Patil, Bagkavos and Wood (2014), see also (5) in Bagkavos, Patil and Wood (2016). Estimation of the p.d.f. and c.d.f. functions is currently performed by maximum likelihood as e.g. kernel estimates inherit large amount of variance to .
Returns a scalar, the value of .
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]>, Lucia Gamez Gallardo <[email protected]>
Rho.p, Rhostar.p.exact, Rho.p.exact
set.seed(1234) selected.r <- "weib" #select Weibull as the distribution shape <- 1 # specify shape parameter scale <- 1 # specify scale parameter n <- 100 # specify sample size param <- 0.9 # specify parameter xout<-r.sample(n,selected.r,shape,scale) # specify sample Rhostar.p(xout,param,selected.r,shape,scale) # calculate Rhostar.p #-0.08936363 # returns the result selected.r2 <- "norm" #select Normal as the distribution n <- 100 # specify sample size mean <- 0 # specify the mean sd <- 1 # specify the variance param <- 0.9 # specify parameter xout <-r.sample(n,selected.r2,mean,sd) # specify sample Rhostar.p(xout,param,selected.r2,mean,sd) # calculate Rhostar.p #-0.02302223 # returns the result selected.r3 <- "cauchy" #select Cauchy as the distribution n <- 100 # specify sample size location <- 0 # specify the location parameter scale <- 1 # specify the scale parameter param <- 0.9 # specify parameter xout<-r.sample(n,selected.r3,location,scale) # specify sample Rhostar.p(xout,param,selected.r3,location,scale) # calculate Rhostar.p #0.02043852 # returns the result
set.seed(1234) selected.r <- "weib" #select Weibull as the distribution shape <- 1 # specify shape parameter scale <- 1 # specify scale parameter n <- 100 # specify sample size param <- 0.9 # specify parameter xout<-r.sample(n,selected.r,shape,scale) # specify sample Rhostar.p(xout,param,selected.r,shape,scale) # calculate Rhostar.p #-0.08936363 # returns the result selected.r2 <- "norm" #select Normal as the distribution n <- 100 # specify sample size mean <- 0 # specify the mean sd <- 1 # specify the variance param <- 0.9 # specify parameter xout <-r.sample(n,selected.r2,mean,sd) # specify sample Rhostar.p(xout,param,selected.r2,mean,sd) # calculate Rhostar.p #-0.02302223 # returns the result selected.r3 <- "cauchy" #select Cauchy as the distribution n <- 100 # specify sample size location <- 0 # specify the location parameter scale <- 1 # specify the scale parameter param <- 0.9 # specify parameter xout<-r.sample(n,selected.r3,location,scale) # specify sample Rhostar.p(xout,param,selected.r3,location,scale) # calculate Rhostar.p #0.02043852 # returns the result
, used in the implementation of the strong asymmetry measure
.Returns , used in the calculation of the strong asymetry measure
.
Rhostar.p.exact(xin, p.param, dist, p1, p2)
Rhostar.p.exact(xin, p.param, dist, p1, p2)
xin |
A vector of data points - the available sample. |
p.param |
A parameter with the value greater than or equal to 1/2 and less than 1. |
dist |
Character string, specifies selected distribution function. |
p1 |
A scalar. Parameter 1 (vector or object) of the selected distribution. |
p2 |
A scalar. Parameter 2 (vector or object) of the selected distribution. |
Implements the quantity
defined on page 6 Patil, Bagkavos and Wood (2014), see also (5) in Bagkavos, Patil and Wood (2016). This implementation uses exact calculation of the functionals in the definition of .
Returns a scalar, the exact value of .
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> , Lucia Gamez Gallardo <[email protected]>
set.seed(1234) selected.r <- "weib" #select Weibull as the distribution shape <- 1 # specify shape parameter scale <- 1 # specify scale parameter n <- 100 # specify sample size param <- 0.9 # specify parameter xout<-r.sample(n,selected.r,shape,scale) # specify sample Rhostar.p.exact(xout,param,selected.r,shape,scale) # calculate Rhostar.p.exact #-0.05206678 # returns the result selected.r2 <- "norm" #select Normal as the distribution n <- 100 # specify sample size mean <- 0 # specify the mean sd <- 1 # specify the variance param <- 0.9 # specify parameter xout <-r.sample(n,selected.r2,mean,sd) # specify sample Rhostar.p.exact(xout,param,selected.r2,mean,sd) # calculate Rhostar.p.exact #-0.008687447 # returns the result selected.r3 <- "cauchy" #select Cauchy as the distribution n <- 100 # specify sample size location <- 0 # specify the location parameter scale <- 1 # specify the scale parameter param <- 0.9 # specify parameter xout<-r.sample(n,selected.r3,location,scale) # specify sample Rhostar.p.exact(xout,param,selected.r3,location,scale) # calculate Rhostar.p.exact #0.0280602 # returns the result
set.seed(1234) selected.r <- "weib" #select Weibull as the distribution shape <- 1 # specify shape parameter scale <- 1 # specify scale parameter n <- 100 # specify sample size param <- 0.9 # specify parameter xout<-r.sample(n,selected.r,shape,scale) # specify sample Rhostar.p.exact(xout,param,selected.r,shape,scale) # calculate Rhostar.p.exact #-0.05206678 # returns the result selected.r2 <- "norm" #select Normal as the distribution n <- 100 # specify sample size mean <- 0 # specify the mean sd <- 1 # specify the variance param <- 0.9 # specify parameter xout <-r.sample(n,selected.r2,mean,sd) # specify sample Rhostar.p.exact(xout,param,selected.r2,mean,sd) # calculate Rhostar.p.exact #-0.008687447 # returns the result selected.r3 <- "cauchy" #select Cauchy as the distribution n <- 100 # specify sample size location <- 0 # specify the location parameter scale <- 1 # specify the scale parameter param <- 0.9 # specify parameter xout<-r.sample(n,selected.r3,location,scale) # specify sample Rhostar.p.exact(xout,param,selected.r3,location,scale) # calculate Rhostar.p.exact #0.0280602 # returns the result
Implements simpson's extended integration rule.
SimpsonInt(xin,h)
SimpsonInt(xin,h)
xin |
A vector of design points where the integral will be evaluated. |
h |
Assuming a<b and n is a positive integer. |
Simpson's extended numerical integration rule is implemented for equally spaced subdivisions (where
is even) of
as
where and
. Simpson's rule will return an exact result when the polynomial in question has a degree of three or less. For other functions, Simpson's Rule only gives an approximation.
A scalar, the approximate value of the integral.
Dimitrios Bagkavos and Lucia Gamez Gallardo
R implementation and documentation: Dimitrios Bagkavos <[email protected]> , Lucia Gamez Gallardo <[email protected]>
x.in<- seq(0,pi/4,length=5) h.out <- pi/8 SimpsonInt(x.in,h.out)
x.in<- seq(0,pi/4,length=5) h.out <- pi/8 SimpsonInt(x.in,h.out)