Type: Package
Title: Generalized Exponentiated Composite Distributions
Version: 0.1.0
Author: Bowen Liu [aut, cre], Malwane M.A. Ananda [aut], Dwaipayan Mukhopadhyay [aut]
Maintainer: Bowen Liu <bowen.liu@umkc.edu>
Description: Contains the framework of the estimation, sampling, and hypotheses testing for two special distributions (Exponentiated Exponential-Pareto and Exponentiated Inverse Gamma-Pareto) within the family of Generalized Exponentiated Composite distributions. The detailed explanation and the applications of these two distributions were introduced in Bowen Liu, Malwane M.A. Ananda (2022) <doi:10.1080/03610926.2022.2050399>, Bowen Liu, Malwane M.A. Ananda (2022) <doi:10.3390/math10111895>, and Bowen Liu, Malwane M.A. Ananda (2022) <doi:10.3390/app13010645>.
License: GPL-3
Encoding: UTF-8
Imports: stats, mistr
RoxygenNote: 7.2.3
NeedsCompilation: no
Packaged: 2023-10-21 14:30:24 UTC; liuab
Repository: CRAN
Date/Publication: 2023-10-24 16:40:02 UTC

Likelihood Ratio Test (LRT) for the exponent parameter in EEP model.

Description

This function computes the test statistic and the p-value of LRT for the exponent parameter in EEP model.

Usage

LRT_eep(data, theta0, theta1, eta1)

Arguments

data

Observations.

theta0

The MLE of theta when eta = 1.

theta1

The unrestricted MLE of theta.

eta1

The unrestricted MLE of eta.

Details

LRT_eep

Value

This function returns the test statistic and the p-value of the LRT test

Examples

sample1 = eep_sampling(200,eta = 1.1,theta = 6)
eta1 = mle_search_eep(data = sample1)$eta
theta1 = mle_search_eep(data = sample1)$theta
theta0 = mle_iter_eep(data = sample1,eta = 1)
LRT_eep(sample1,theta0,theta1,eta1)

Likelihood Ratio Test (LRT) for the exponent parameter in EIGP model.

Description

This function computes the test statistic and the p-value for LRT for the exponent parameter in EIGP model.

Usage

LRT_eigp(data, theta0, theta1, eta1)

Arguments

data

Observations.

theta0

The MLE of theta when eta = 1.

theta1

The unrestricted MLE of theta.

eta1

The unrestricted MLE of eta.

Details

LRT_eigp

Value

This function returns the test statistic and the p-value from the LRT test

Examples

sample1 = eigp_sampling(200,eta = 1.1,theta = 3)
eta1 = mle_search_eigp(data = sample1)$eta
theta1 = mle_search_eigp(data = sample1)$theta
theta0 = mle_iter_eigp(data = sample1,eta = 1)
LRT_eigp(sample1,theta0,theta1,eta1)

Asymptotic Wald's test for testing the exponent in a EEP model.

Description

This function computes the test statistic and the p-value of Wald's test for the exponent parameter in EEP model.

Usage

asymptotic_eep(data, eta0, theta1, eta1)

Arguments

data

Observations.

eta0

To test if the exponent equals 1, the default for eta0 is et to be 1.

theta1

The unrestricted MLE of theta.

eta1

The unrestricted MLE of eta.

Details

asymptotic_eep

Value

This function returns the test statistic and the p-value of the Wald's test.

Examples

sample1 = eep_sampling(200,eta = 1.1,theta = 3)
theta1 = mle_search_eep(data = sample1)$theta
eta1 = mle_search_eep(data = sample1)$eta
asymptotic_eep(sample1,eta0 = 1,theta1,eta1)

Asymptotic Wald's test for testing the exponent in a EIGP model.

Description

This function computes the test statistic and the p-value of Wald's test for the exponent parameter in EIGP model.

Usage

asymptotic_eigp(data, eta0 = 1, theta1, eta1)

Arguments

data

Observations.

eta0

To test if the exponent equals 1, the default for eta0 is et to be 1.

theta1

The unrestricted MLE of theta.

eta1

The unrestricted MLE of eta.

Details

asymptotic_eigp

Value

This function returns the test statistic and the p-value of the Wald's test.

Examples

sample1 = eigp_sampling(200,eta = 1.1,theta = 3)
theta1 = mle_search_eigp(data = sample1)$theta
eta1 = mle_search_eigp(data = sample1)$eta
asymptotic_eigp(sample1,eta0 = 1,theta1,eta1)

The cumulative distribution function of EEP.

Description

cdf_eep

Usage

cdf_eep(theta, eta, data)

Arguments

theta

The location parameter for the base distribution (eta = 1). The value needs to be positive.

eta

The exponent parameter. The value provided needs to be positive.

data

Observations.

Value

Return the cumulative probability of EEP at the specific location.

Examples

cdf_eep(1,2,5)

The cumulative distribution function of EIGP.

Description

cdf_eigp

Usage

cdf_eigp(theta, eta, data)

Arguments

theta

The location parameter for the base distribution (eta = 1). The value needs to be positive.

eta

The exponent parameter. The value provided needs to be positive.

data

Observations.

Value

Return the cumulative probability of EIGP at the specific location.

Examples

cdf_eigp(1,2,5)

The EEP Negative Log-likelihood Function.

Description

This function serves as the objective function for the Maximum Likelihood Estimation procedure for EEP.

Usage

eep_nll(x, m, data)

Arguments

x

Vector of parameters.

m

The number of data items less than the density change point.

data

Observations.

Details

eep_nll

Value

A scalar that represents the negative loglikelihood of a EEP sample given the model parameter and the data.

Examples

eep_nll(c(2,2),50,seq(1:100))

The Wrapper Function that Returns the Final Estimates from Maximum Likelihood Estimation for EEP.

Description

This function serves as a wrapper that returns the final estimates of theta, eta, and the corresponding density change point

Usage

eep_optim(data, init = c(1, 1), lower_bound = c(0.01, 0.01))

Arguments

data

Observations.

init

The vector of initial values of the model parameters. The default is c(1,1).

lower_bound

The vector of the lower bound for the parameters. The default is c(0.01,0.01).

Details

eep_optim

Value

A data frame with 1 row and 3 columns that contains the MLE of theta, eta, and the predicted density change point.

Examples

eep_optim(seq(1:100))

The Random Number Generation Function for EIGP

Description

Create a EEP random sample.

Usage

eep_sampling(n, theta, eta)

Arguments

n

Number of observations. (n>=1)

theta

The location parameter for the parent EP distribution (eta = 1). The value needs to be positive.

eta

The exponent parameter. The parameter should be positive.

Details

eep_sampling

Value

returns a numerical vector of size n.

Examples

eep_sampling(100,1,1)

The EIGP Negative Log-likelihood Function.

Description

This function serves as the objective function for the Maximum Likelihood Estimation procedure for EIGP.

Usage

eigp_nll(x, m, data)

Arguments

x

Vector of parameters.

m

The number of data items less than the density change point.

data

Observations.

Details

eigp_nll

Value

A scalar that represents the negative loglikelihood of a EIGP sample given the model parameter and the data.

Examples

eigp_nll(c(2,2),50,seq(1:100))

The Wrapper Function that Returns the Final Estimates from Maximum Likelihood Estimation for EIGP.

Description

This function serves as a wrapper that returns the final estimates of theta, eta, and the corresponding density change point

Usage

eigp_optim(data, init = c(1, 1), lower_bound = c(0.01, 0.01))

Arguments

data

Observations.

init

The vector of initial values of the model parameters. The default is c(1,1).

lower_bound

The vector of the lower bound for the parameters. The default is c(0.01,0.01).

Details

eigp_optim

Value

A data frame with 1 row and 3 columns that contains the MLE of theta, eta, and the predicted density change point.

Examples

eigp_optim(seq(1:100))

The Random Number Generation Function for EIGP

Description

Create a EIGP random sample.

Usage

eigp_sampling(n, theta, eta)

Arguments

n

Number of observations. (n>=1)

theta

The location parameter for the parent IGP distribution (eta = 1). The value needs to be positive.

eta

The exponent parameter. The parameter should be positive.

Details

eigp_sampling

Value

This function returns a numerical vector of size n.

Examples

eigp_sampling(100,1,1)

The negative log density of a sample item if it follows exponential in a EEP model

Description

This function return the negative log density of a sample item if if it follows exponential in a EEP model.

Usage

exp_eep(x, theta, eta)

Arguments

x

The value of a sample item.

theta

The location parameter for the base distribution (eta = 1). The value needs to be positive.

eta

The exponent parameter. The value provided needs to be positive.

Details

exp_exp

Value

This function return the negative log density of a sample item if if it follows exponential in a EEP model.

Examples

exp_eep(1,5,2)

The hazard function of EEP.

Description

hazard_eep

Usage

hazard_eep(theta, eta, data)

Arguments

theta

The location parameter for the base distribution (eta = 1). The value needs to be positive.

eta

The exponent parameter. The value provided needs to be positive.

data

Observations.

Value

Return the hazard of EEP at the specific location.

Examples

hazard_eep(2,1,5)
plot(hazard_eep(2,1,seq(0.01,100,by=0.01)))

The hazard function of EIGP.

Description

hazard_eigp

Usage

hazard_eigp(theta, eta, data)

Arguments

theta

The location parameter for the base distribution (eta = 1). The value needs to be positive.

eta

The exponent parameter. The value provided needs to be positive.

data

Observations.

Value

Return the hazard of EIGP at the specific location.

Examples

hazard_eigp(1,2,5)
plot(hazard_eep(2,1,seq(0.01,100,by=0.01)))

The negative log density of a sample item if it follows inverse gamma in a EIGP model

Description

This function return the negative log density of a sample item if if it follows inverse gamma in a EIGP model.

Usage

inv_gamma_eigp(x, theta, eta)

Arguments

x

The value of a sample item.

theta

The location parameter for the base distribution (eta = 1). The value needs to be positive.

eta

The exponent parameter. The value provided needs to be positive.

Details

inv_gamma_eigp

Value

This function return the negative log density of a sample item if if it follows inverse gamma in a EIGP model.

Examples

inv_gamma_eigp(1,5,2)

Analytical solution of theta given eta in EEP model.

Description

This function provides the analytical solution of theta for given eta EEP model.

Usage

mle_eep(s, m, n)

Arguments

s

A numeric value the sum of log(1/x_i^eta), where i is from 1 to m.

m

m is the number of data items less than the density change point.

n

n is the sample size, n has to be greater than m.

Details

mle_eep

Value

This function returns the Maximum Likelihood Estimate of theta for a given eta

Examples

mle_eep(5,2,5)

Analytical solution of theta given eta in EIGP model.

Description

This function provides the analytical solution of theta for given eta EIGP model.

Usage

mle_eigp(s, m, n)

Arguments

s

a numeric value the sum of log(1/x_i^eta), where i is from 1 to m.

m

m is the number of data items less than the density change point.

n

n is the sample size, n has to be greater than m.

Details

mle_eigp

Value

This function returns the Maximum Likelihood Estimate of theta for a given eta.

Examples

mle_eigp(5,2,5)

Iteration function to find the analytical solution of theta given eta and data in EEP model.

Description

This function finds the analytical solution of theta given eta and data in EEP model.

Usage

mle_iter_eep(data, eta)

Arguments

data

Observations.

eta

The exponent parameter. This value is greater than 0.

Details

mle_iter_eep

Value

This function returns the Maximum Likelihood Estimate of theta for a given eta with data.

Examples

mle_iter_eep(seq(1:100),2)

Iteration function to find the analytical solution of theta given eta and data in EIGP model.

Description

This function finds the analytical solution of theta given eta and data in EIGP model.

Usage

mle_iter_eigp(data, eta)

Arguments

data

Observations.

eta

The exponent parameter. This value is greater than 0.

Details

mle_iter_eigp

Value

This function returns the Maximum Likelihood Estimate of theta for a given eta with data.

Examples

mle_iter_eigp(seq(1:100),2)

The grid search procedure for parameter estimation of EEP.

Description

This function find the parameter estimates of EEP throgh a grid search procedure.

Usage

mle_search_eep(eta_seq = seq(0.5, 10, by = 0.01), data)

Arguments

eta_seq

A predefined range for eta values. The default is c(0.5,10,by = 0.01)

data

Observations.

Details

mle_search_eep

Value

This function returns a data frame as the parameter estimates for EEP from grid search methods.

Examples

sample1 = eep_sampling(200,eta = 2,theta = 3)
mle_search_eep(data = sample1)

The grid search procedure for parameter estimation of EIGP.

Description

This function find the parameter estimates of EIGP through a grid search procedure.

Usage

mle_search_eigp(eta_seq = seq(0.5, 10, by = 0.01), data)

Arguments

eta_seq

A predefined range for eta values. The default is c(0.5,10,by = 0.01)

data

n by 1 vector with all positive entries.

Details

mle_search_eigp

Value

This function returns data frame as the parameter estimates for EIGP from grid search methods.

Examples

sample1 = eigp_sampling(200,eta = 2,theta = 3)
mle_search_eigp(data = sample1)

The negative log likelihood function for EEP distribution.

Description

This function computes the negative log-likelihood for EEP distribution.

Usage

neg_log_eep(y, theta, eta)

Arguments

y

n by 1 vector with all positive entries.

theta

The location parameter for the base distribution (eta = 1). The value needs to be positive.

eta

The exponent parameter. The value provided needs to be positive.

Details

neg_log_eigp

Value

This function return the negative log density of a sample item if if it follows Pareto in a EEP model.

Examples

neg_log_eep(seq(1:100),2,2)

The negative log likelihood function for EIGP distribution.

Description

This function computes the negative log-likelihood for EIGP distribution.

Usage

neg_log_eigp(y, theta, eta)

Arguments

y

n by 1 vector with all positive entries.

theta

The location parameter for the base distribution (eta = 1). The value needs to be positive.

eta

The exponent parameter. The value provided needs to be positive.

Details

neg_log_eigp

Value

This function return the negative log density of a sample item if if it follows Pareto in a EIGP model.

Examples

neg_log_eigp(seq(1:100),2,2)

The negative log density of a sample item if it follows Pareto in a EEP model

Description

This function return the negative log density of a sample item if if it follows Pareto in a EEP model.

Usage

pareto_eep(x, theta, eta)

Arguments

x

The value of a sample item.

theta

The location parameter for the base distribution (eta = 1). The value needs to be positive.

eta

The exponent parameter. The value provided needs to be positive.

Details

pareto_eep

Value

This function return the negative log density of a sample item if if it follows Pareto in a EEP model.

Examples

pareto_eep(10,5,2)

The negative log density of a sample item if it follows Pareto in a EIGP model

Description

This function return the negative log density of a sample item if if it follows Pareto in a EIGP model.

Usage

pareto_eigp(x, theta, eta)

Arguments

x

The value of a sample item.

theta

The location parameter for the base distribution (eta = 1). The value needs to be positive.

eta

The exponent parameter. The value provided needs to be positive.

Details

pareto_eigp

Value

This function return the negative log density of a sample item if if it follows Pareto in a EIGP model.

Examples

pareto_eigp(10,5,2)

The probability function of EEP.

Description

pdf_eep

Usage

pdf_eep(theta, eta, data)

Arguments

theta

The location parameter for the base distribution (eta = 1). The value needs to be positive.

eta

The exponent parameter. The value provided needs to be positive.

data

Observations.

Value

Return the density of EEP

Examples

pdf_eep(1,2,5)

The probability density function of EIGP.

Description

pdf_eigp

Usage

pdf_eigp(theta, eta, data)

Arguments

theta

The location parameter for the base distribution (eta = 1). The value needs to be positive.

eta

The exponent parameter. The value provided needs to be positive.

data

Observations.

Value

Return the density of EIGP

Examples

pdf_eigp(1,2,5)

The quantile function of EEP.

Description

q_eep

Usage

q_eep(theta, eta, p)

Arguments

theta

The location parameter for the base distribution (eta = 1). The value needs to be positive.

eta

The exponent parameter. The value provided needs to be positive.

p

This indicates the p-th percentile. p is greater than 0 and less than 100.

Value

Return the p-th percentile of EEP.

Examples

q_eigp(1,2,5)

The quantile function of EIGP.

Description

q_eigp

Usage

q_eigp(theta, eta, p)

Arguments

theta

The location parameter for the base distribution (eta = 1). The value needs to be positive.

eta

The exponent parameter. The value provided needs to be positive.

p

This indicates the p-th percentile. p is greater than 0 and less than 100.

Value

Return the p-th percentile of EIGP.

Examples

q_eigp(1,2,5)

The Optimization Function for EEP Maximum Likelihood Estimation.

Description

This function serves as the optimization function for EEP at different locations of density change points.

Usage

raw_est_eep(data, init = c(1, 1), lower_bound = c(0.01, 0.01))

Arguments

data

Observations.

init

The vector of initial values of the model parameters. The default is c(1,1).

lower_bound

The vector of the lower bound for the parameters. The default is c(0.01,0.01).

Details

raw_est_eep

Value

The matrix with estimates of theta and eta for n-1 different locations of density change points (1st column for theta, 2nd column for eta).

Examples

raw_est_eep(seq(1:100))

The Optimization Function for EIGP Maximum Likelihood Estimation.

Description

This function serves as the optimization function for EIGP at different locations of density change points.

Usage

raw_est_eigp(data, init = c(1, 1), lower_bound = c(0.01, 0.01))

Arguments

data

Observations.

init

The vector of initial values of the model parameters. The default is c(1,1).

lower_bound

The vector of the lower bound for the parameters. The default is c(0.01,0.01).

Details

raw_est_eigp

Value

The matrix with estimates of theta and eta for n-1 different locations of density change points (1st column for theta, 2nd column for eta).

Examples

raw_est_eigp(seq(1:100))

The function for calculating the standard errors of the parameters of EEP model.

Description

This function find the parameter estimates of EEP through a grid search procedure.

Usage

se_eep(data, theta, eta)

Arguments

data

Observations.

theta

The MLE of theta

eta

The MLE of eta

Details

se_eep

Value

The estimate of SE for theta and eta

Examples

sample1 = eep_sampling(200,eta = 2,theta = 3)
theta = mle_search_eep(data = sample1)$theta
eta = mle_search_eep(data = sample1)$eta
se_eep(sample1,theta,eta)

The function for calculating the standard errors of the parameters of EIGP model.

Description

This function find the parameter estimates of EIGP through a grid search procedure.

Usage

se_eigp(data, theta, eta)

Arguments

data

Observations.

theta

The MLE of theta

eta

The MLE of eta

Details

se_eigp

Value

The estimate of SE for theta and eta

Examples

sample1 = eigp_sampling(200,eta = 2,theta = 3)
theta = mle_search_eigp(data = sample1)$theta
eta = mle_search_eigp(data = sample1)$eta
se_eigp(sample1,theta,eta)

The validation Function for Model Parameters.

Description

This function checks if the estimates from raw_est_eigp or raw_est_eep satisfy the pre-defined conditions for the parameters.

Usage

validation(data, estimate)

Arguments

data

Observations.

estimate

The data frame with 2 columns named 'theta' and 'eta'.

Details

validation

Value

A Boolean vector.

Examples

estimate = raw_est_eigp(seq(1:100),init = c(1,1),lower_bound = c(0.01,0.01))
estimate = data.frame(estimate)
colnames(estimate) = c('theta','eta')
validation(seq(1:100),estimate)