Title: | Generalized Exponentiated Composite Distributions |
---|---|
Description: | 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. |
Authors: | Bowen Liu [aut, cre], Malwane M.A. Ananda [aut] |
Maintainer: | Bowen Liu <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2025-02-19 04:59:05 UTC |
Source: | https://github.com/liuaber/gec |
This function computes the test statistic and the p-value of Wald's test for the exponent parameter in EEP model.
asymptotic_eep(data, eta0, theta1, eta1)
asymptotic_eep(data, eta0, theta1, eta1)
data |
n by 1 vector with all positive entries. |
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. |
asymptotic_eep
This function returns the test statistic and the p-value of the Wald's test.
sample1 = eep_sampling(1000,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)
sample1 = eep_sampling(1000,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)
This function computes the test statistic and the p-value of Wald's test for the exponent parameter in EIGP model.
asymptotic_eigp(data, eta0 = 1, theta1, eta1)
asymptotic_eigp(data, eta0 = 1, theta1, eta1)
data |
n by 1 vector with all positive entries. |
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. |
asymptotic_eigp
This function returns the test statistic and the p-value of the Wald's test.
sample1 = eigp_sampling(1000,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)
sample1 = eigp_sampling(1000,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)
cdf_eep
cdf_eep(theta, eta, data)
cdf_eep(theta, eta, data)
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 |
The data item. |
Return the cumulative probability of EEP at the specific location.
cdf_eep(1,2,5)
cdf_eep(1,2,5)
cdf_eigp
cdf_eigp(theta, eta, data)
cdf_eigp(theta, eta, data)
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 |
The data item. |
Return the cumulative probability of EIGP at the specific location.
cdf_eigp(1,2,5)
cdf_eigp(1,2,5)
This function serves as the objective function for the Maximum Likelihood Estimation procedure for EEP.
eep_nll(x, m, data)
eep_nll(x, m, data)
x |
A 2 by 1 vector. |
m |
m is the number of data items less than the density change point |
data |
n by 1 vector with all positive entries |
eep_nll
x is a 2 by 1 vector; m denotes the number of data items less than the density change point; data is a n by 1 vector, where n denotes the sample size of the data.
eep_nll(c(2,2),50,seq(1:100))
eep_nll(c(2,2),50,seq(1:100))
This function serves as a wrapper that returns the final estimates of theta, eta, and the corresponding density change point
eep_optim(data, init = c(1, 1), lower_bound = c(0.01, 0.01))
eep_optim(data, init = c(1, 1), lower_bound = c(0.01, 0.01))
data |
a n by 1 vector with all positive entries. |
init |
a 2 by 1 vector serves as the initial values of the model parameters. The default is c(1,1). |
lower_bound |
a 2 by 1 vector serves as the lower bound of the parameters. The default is c(0.01,0.01). |
eigp_optim
a data frame with 1 row and 3 columns that contains the MLE of theta, eta, and the predicted density change point.
eep_optim(seq(1:100))
eep_optim(seq(1:100))
Create a EEP random sample of size n, with parameters theta and eta.
eep_sampling(n, theta, eta)
eep_sampling(n, theta, eta)
n |
A positive integer to specify the sample size |
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. |
eep_sampling
Input an the sample size as n, parameters theta and eta, returns a numerical vector of size n.
returns a numerical vector of size n.
eep_sampling(100,1,1)
eep_sampling(100,1,1)
This function serves as the objective function for the Maximum Likelihood Estimation procedure for EIGP.
eigp_nll(x, m, data)
eigp_nll(x, m, data)
x |
A 2 by 1 vector. |
m |
m is the number of data items less than the density change point. |
data |
n by 1 vector with all positive entries. |
eigp_nll
x is a 2 by 1 vector; m denotes the number of data items less than the density change point; data is a n by 1 vector, where n denotes the sample size of the data.
eigp_nll(c(2,2),50,seq(1:100))
eigp_nll(c(2,2),50,seq(1:100))
This function serves as a wrapper that returns the final estimates of theta, eta, and the corresponding density change point
eigp_optim(data, init = c(1, 1), lower_bound = c(0.01, 0.01))
eigp_optim(data, init = c(1, 1), lower_bound = c(0.01, 0.01))
data |
a n by 1 vector with all positive entries. |
init |
a 2 by 1 vector serves as the initial values of the model parameters. The default is c(1,1). |
lower_bound |
a 2 by 1 vector serves as the lower bound of the parameters. The default is c(0.01,0.01). |
eigp_optim
a data frame with 1 row and 3 columns that contains the MLE of theta, eta, and the predicted density change point.
eigp_optim(seq(1:100))
eigp_optim(seq(1:100))
Create a EIGP random sample of size n, with parameters theta and eta.
eigp_sampling(n, theta, eta)
eigp_sampling(n, theta, eta)
n |
A positive integer to specify the sample size |
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. |
eigp_sampling
Input an the sample size as n, parameters theta and eta, returns a numerical vector of size n.
returns a numerical vector of size n.
eigp_sampling(100,1,1)
eigp_sampling(100,1,1)
This function return the negative log density of a sample item if if it follows exponential in a EEP model.
exp_eep(x, theta, eta)
exp_eep(x, theta, eta)
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. |
exp_exp
This function return the negative log density of a sample item if if it follows exponential in a EEP model.
exp_eep(1,5,2)
exp_eep(1,5,2)
hazard_eep
hazard_eep(theta, eta, data)
hazard_eep(theta, eta, data)
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 |
The data item. |
Return the hazard of EEP at the specific location.
hazard_eep(2,1,5) plot(hazard_eep(2,1,seq(0.01,100,by=0.01)))
hazard_eep(2,1,5) plot(hazard_eep(2,1,seq(0.01,100,by=0.01)))
hazard_eigp
hazard_eigp(theta, eta, data)
hazard_eigp(theta, eta, data)
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 |
The data item. |
Return the hazard of EIGP at the specific location.
hazard_eigp(1,2,5)
hazard_eigp(1,2,5)
This function return the negative log density of a sample item if if it follows inverse gamma in a EIGP model.
inv_gamma_eigp(x, theta, eta)
inv_gamma_eigp(x, theta, eta)
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. |
inv_gamma_eigp
This function return the negative log density of a sample item if if it follows inverse gamma in a EIGP model.
inv_gamma_eigp(1,5,2)
inv_gamma_eigp(1,5,2)
This function computes the test statistic and the p-value of LRT for the exponent parameter in EEP model.
LRT_eep(data, theta0, theta1, eta1)
LRT_eep(data, theta0, theta1, eta1)
data |
n by 1 vector with all positive entries. |
theta0 |
The MLE of theta when eta = 1. |
theta1 |
The unrestricted MLE of theta. |
eta1 |
The unrestricted MLE of eta. |
LRT_eep
This function returns the test statistic and the p-value of the LRT test
sample1 = eep_sampling(1000,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)
sample1 = eep_sampling(1000,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)
This function computes the test statistic and the p-value for LRT for the exponent parameter in EIGP model.
LRT_eigp(data, theta0, theta1, eta1)
LRT_eigp(data, theta0, theta1, eta1)
data |
n by 1 vector with all positive entries. |
theta0 |
The MLE of theta when eta = 1. |
theta1 |
The unrestricted MLE of theta. |
eta1 |
The unrestricted MLE of eta. |
LRT_eigp
This function returns the test statistic and the p-value from the LRT test
sample1 = eigp_sampling(1000,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)
sample1 = eigp_sampling(1000,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)
This function provides the analytical solution of theta for given eta EEP model.
mle_eep(s, m, n)
mle_eep(s, m, n)
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. |
mle_eep
This function returns the Maximum Likelihood Estimate of theta for a given eta
mle_eep(5,2,5)
mle_eep(5,2,5)
This function provides the analytical solution of theta for given eta EIGP model.
mle_eigp(s, m, n)
mle_eigp(s, m, n)
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. |
mle_eigp
This function returns the Maximum Likelihood Estimate of theta for a given eta
mle_eigp(5,2,5)
mle_eigp(5,2,5)
This function finds the analytical solution of theta given eta and data in EEP model.
mle_iter_eep(data, eta)
mle_iter_eep(data, eta)
data |
n by 1 vector with all positive entries. |
eta |
The exponent parameter. This value is greater than 0. |
mle_iter_eep
This function returns the Maximum Likelihood Estimate of theta for a given eta with data.
mle_iter_eep(seq(1:100),2)
mle_iter_eep(seq(1:100),2)
This function finds the analytical solution of theta given eta and data in EIGP model.
mle_iter_eigp(data, eta)
mle_iter_eigp(data, eta)
data |
n by 1 vector with all positive entries. |
eta |
The exponent parameter. This value is greater than 0. |
mle_iter_eigp
This function returns the Maximum Likelihood Estimate of theta for a given eta with data.
mle_iter_eigp(seq(1:100),2)
mle_iter_eigp(seq(1:100),2)
This function find the parameter estimates of EEP throgh a grid search procedure.
mle_search_eep(eta_seq = seq(0.5, 10, by = 0.01), data)
mle_search_eep(eta_seq = seq(0.5, 10, by = 0.01), data)
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. |
mle_search_eep
This function returns a data frame as the parameter estimates for EEP from grid search methods.
sample1 = eep_sampling(1000,eta = 2,theta = 3) mle_search_eep(data = sample1)
sample1 = eep_sampling(1000,eta = 2,theta = 3) mle_search_eep(data = sample1)
This function find the parameter estimates of EIGP through a grid search procedure.
mle_search_eigp(eta_seq = seq(0.5, 10, by = 0.01), data)
mle_search_eigp(eta_seq = seq(0.5, 10, by = 0.01), data)
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. |
mle_search_eigp
This function returns data frame as the parameter estimates for EIGP from grid search methods.
sample1 = eigp_sampling(1000,eta = 2,theta = 3) mle_search_eigp(data = sample1)
sample1 = eigp_sampling(1000,eta = 2,theta = 3) mle_search_eigp(data = sample1)
This function computes the negative log-likelihood for EEP distribution.
neg_log_eep(y, theta, eta)
neg_log_eep(y, theta, eta)
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. |
neg_log_eigp
This function return the negative log density of a sample item if if it follows Pareto in a EEP model.
neg_log_eep(seq(1:100),2,2)
neg_log_eep(seq(1:100),2,2)
This function computes the negative log-likelihood for EIGP distribution.
neg_log_eigp(y, theta, eta)
neg_log_eigp(y, theta, eta)
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. |
neg_log_eigp
This function return the negative log density of a sample item if if it follows Pareto in a EIGP model.
neg_log_eigp(seq(1:100),2,2)
neg_log_eigp(seq(1:100),2,2)
This function return the negative log density of a sample item if if it follows Pareto in a EEP model.
pareto_eep(x, theta, eta)
pareto_eep(x, theta, eta)
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. |
pareto_eep
This function return the negative log density of a sample item if if it follows Pareto in a EEP model.
pareto_eep(10,5,2)
pareto_eep(10,5,2)
This function return the negative log density of a sample item if if it follows Pareto in a EIGP model.
pareto_eigp(x, theta, eta)
pareto_eigp(x, theta, eta)
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. |
pareto_eigp
This function return the negative log density of a sample item if if it follows Pareto in a EIGP model.
pareto_eigp(10,5,2)
pareto_eigp(10,5,2)
pdf_eep
pdf_eep(theta, eta, data)
pdf_eep(theta, eta, data)
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 |
The data item. |
Return the density of EEP
pdf_eep(1,2,5)
pdf_eep(1,2,5)
pdf_eigp
pdf_eigp(theta, eta, data)
pdf_eigp(theta, eta, data)
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 |
The data item. |
Return the density of EIGP
pdf_eigp(1,2,5)
pdf_eigp(1,2,5)
q_eep
q_eep(theta, eta, p)
q_eep(theta, eta, p)
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. |
Return the p-th percentile of EEP.
q_eigp(1,2,5)
q_eigp(1,2,5)
q_eigp
q_eigp(theta, eta, p)
q_eigp(theta, eta, p)
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. |
Return the p-th percentile of EIGP.
q_eigp(1,2,5)
q_eigp(1,2,5)
This function serves as the optimization function for EEP at different locations of density change points.
raw_est_eep(data, init = c(1, 1), lower_bound = c(0.01, 0.01))
raw_est_eep(data, init = c(1, 1), lower_bound = c(0.01, 0.01))
data |
a n by 1 vector with all positive entries. |
init |
a 2 by 1 vector serves as the initial values of the model parameters. The default is c(1,1). |
lower_bound |
a 2 by 1 vector serves as the lower bound of the parameters. The default is c(0.01,0.01). |
raw_est_eep
x is a 2 by 1 vector; m denotes the number of data items less than the density change point; data is a n by 1 vector, where n denotes the sample size of the data.
a n-1 by 2 matrix with estimates of theta and eta for n-1 different locations of density change points (1st column for theta, 2nd column for eta).
raw_est_eep(seq(1:100))
raw_est_eep(seq(1:100))
This function serves as the optimization function for EIGP at different locations of density change points.
raw_est_eigp(data, init = c(1, 1), lower_bound = c(0.01, 0.01))
raw_est_eigp(data, init = c(1, 1), lower_bound = c(0.01, 0.01))
data |
a n by 1 vector with all positive entries. |
init |
a 2 by 1 vector serves as the initial values of the model parameters. The default is c(1,1). |
lower_bound |
a 2 by 1 vector serves as the lower bound of the parameters. The default is c(0.01,0.01). |
raw_est_eigp
x is a 2 by 1 vector; m denotes the number of data items less than the density change point; data is a n by 1 vector, where n denotes the sample size of the data.
a n-1 by 2 matrix with estimates of theta and eta for n-1 different locations of density change points (1st column for theta, 2nd column for eta).
raw_est_eigp(seq(1:100))
raw_est_eigp(seq(1:100))
This function find the parameter estimates of EEP through a grid search procedure.
se_eep(data, theta, eta)
se_eep(data, theta, eta)
data |
n by 1 vector with all positive entries. |
theta |
the MLE of theta |
eta |
the MLE of eta |
se_eep
The estimate of SE for theta and eta
sample1 = eep_sampling(1000,eta = 2,theta = 3) theta = mle_search_eep(data = sample1)$theta eta = mle_search_eep(data = sample1)$eta se_eep(sample1,theta,eta)
sample1 = eep_sampling(1000,eta = 2,theta = 3) theta = mle_search_eep(data = sample1)$theta eta = mle_search_eep(data = sample1)$eta se_eep(sample1,theta,eta)
This function find the parameter estimates of EIGP through a grid search procedure.
se_eigp(data, theta, eta)
se_eigp(data, theta, eta)
data |
n by 1 vector with all positive entries. |
theta |
the MLE of theta |
eta |
the MLE of eta |
se_eigp
The estimate of SE for theta and eta
sample1 = eigp_sampling(1000,eta = 2,theta = 3) theta = mle_search_eigp(data = sample1)$theta eta = mle_search_eigp(data = sample1)$eta se_eigp(sample1,theta,eta)
sample1 = eigp_sampling(1000,eta = 2,theta = 3) theta = mle_search_eigp(data = sample1)$theta eta = mle_search_eigp(data = sample1)$eta se_eigp(sample1,theta,eta)
This function checks if the estimates from raw_est_eigp or raw_est_eep satisfy the pre-defined conditions for the parameters.
validation(data, estimate)
validation(data, estimate)
data |
a n by 1 vector with all positive entries. |
estimate |
a data frame with 2 columns named 'theta' and 'eta'. |
validation
a n-1 by 1 Boolean vector.
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)
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)