Title: | Complex Pearson Distributions |
---|---|
Description: | Probability mass function, distribution function, quantile function and random generation for the Complex Triparametric Pearson (CTP) and Complex Biparametric Pearson (CBP) distributions developed by Rodriguez-Avi et al (2003) <doi:10.1007/s00362-002-0134-7>, Rodriguez-Avi et al (2004) <doi:10.1007/BF02778271> and Olmo-Jimenez et al (2018) <doi:10.1080/00949655.2018.1482897>. The package also contains maximum-likelihood fitting functions for these models. |
Authors: | Silverio Vilchez-Lopez [aut, cre], Maria Jose Olmo-Jimenez [aut], Jose Rodriguez-Avi [aut] |
Maintainer: | Silverio Vilchez-Lopez <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.3.3 |
Built: | 2025-02-02 03:55:14 UTC |
Source: | https://github.com/cran/cpd |
Probability mass function, distribution function, quantile function and random generation for the Complex Biparametric Pearson (CBP) distribution with parameters and
.
dcbp(x, b, gamma) pcbp(q, b, gamma, lower.tail = TRUE) qcbp(p, b, gamma, lower.tail = TRUE) rcbp(n, b, gamma)
dcbp(x, b, gamma) pcbp(q, b, gamma, lower.tail = TRUE) qcbp(p, b, gamma, lower.tail = TRUE) rcbp(n, b, gamma)
x |
vector of (non-negative integer) quantiles. |
b |
parameter b (real) |
gamma |
parameter gamma (positive) |
q |
vector of quantiles. |
lower.tail |
if TRUE (default), probabilities are |
p |
vector of probabilities. |
n |
number of observations. If |
The CBP distribution with parameters and
has pmf
where is the imaginary unit,
the gamma function and
the normalizing constant.
The CBP is a particular case of the CTP when .
The mean and the variance of the CBP distribution are
and
so
.
It is always overdispersed.
dcbp
gives the pmf, pcbp
gives the distribution function, qcbp
gives the quantile function and rcbp
generates random values.
Jose Rodriguez-Avi J, Conde-Sanchez A, Saez-Castillo AJ (2003). “A new class of discrete distributions with complex parameters.” Stat. Pap., 44, 67–88. doi:10.1007/s00362-002-0134-7.
Probability mass function, distribution function, quantile function and random generation for the CTP distribution: dctp
, pctp
, qctp
and rctp
.
Functions for maximum-likelihood fitting of the CBP distribution: fitcbp
.
# Examples for the function dcbp dcbp(3,2,5) dcbp(c(3,4),2,5) # Examples for the function pcbp pcbp(3,2,3) pcbp(c(3,4),2,3) # Examples for the function qcbp qcbp(0.5,2,3) qcbp(c(.8,.9),2,3) # Examples for the function rcbp rcbp(10,1,3)
# Examples for the function dcbp dcbp(3,2,5) dcbp(c(3,4),2,5) # Examples for the function pcbp pcbp(3,2,3) pcbp(c(3,4),2,3) # Examples for the function qcbp qcbp(0.5,2,3) qcbp(c(.8,.9),2,3) # Examples for the function rcbp rcbp(10,1,3)
chisq.test2
performs Pearson chi-squared goodness-of-fit test for count data
chisq.test2(obs, p.esp, npar = NULL, grouping = FALSE)
chisq.test2(obs, p.esp, npar = NULL, grouping = FALSE)
obs |
a numeric vector with the counts |
p.esp |
a numeric vector with the expected probabilities of the same length of |
npar |
an integer specifying the number of parameters of the model. By default |
grouping |
a logical indicating whether to group in classes with expected frequency greater than or equal to 5. By default |
A list with class "htest"
containing the following components:
statistic
: the value of the chi-squared test statistic.
df
: the degrees of freedom of the approximate chi-squared distribution.
p.value
: the p-value for the test.
observed
: the observed counts.
observed.grouped
: the observed counts grouped in classes with expected frequency greather or equal to 5.
expected
: the expected counts under the null hypothesis.
expected.grouped
: the expected counts under the null hypothesis grouped in classes with expected frequency greather or equal to 5.
residuals
: the Pearson residuals computed as (observed - expected) / sqrt(expected)
.
set.seed(123) x <- rctp(500, -1.5, 1, 2) table(x) obs <- c(172, 264, 57, 6, 0, 1) fit <- fitctp(x) p.esp <- c(dctp(0:(length(obs)-1),fit$coefficients[1],fit$coefficients[2], fit$coefficients[3])[1:(length(obs)-1)],1-sum(dctp(0:(length(obs)-1), fit$coefficients[1],fit$coefficients[2],fit$coefficients[3])[1:(length(obs)-1)])) chisq.test2(obs, p.esp) chisq.test2(obs, p.esp, grouping = TRUE) chisq.test2(obs, npar= 3, p.esp)
set.seed(123) x <- rctp(500, -1.5, 1, 2) table(x) obs <- c(172, 264, 57, 6, 0, 1) fit <- fitctp(x) p.esp <- c(dctp(0:(length(obs)-1),fit$coefficients[1],fit$coefficients[2], fit$coefficients[3])[1:(length(obs)-1)],1-sum(dctp(0:(length(obs)-1), fit$coefficients[1],fit$coefficients[2],fit$coefficients[3])[1:(length(obs)-1)])) chisq.test2(obs, p.esp) chisq.test2(obs, p.esp, grouping = TRUE) chisq.test2(obs, npar= 3, p.esp)
Probability mass function, distribution function, quantile function and random generation for the Complex Triparametric Pearson (CTP) distribution with parameters ,
and
.
dctp(x, a, b, gamma) pctp(q, a, b, gamma, lower.tail = TRUE) qctp(p, a, b, gamma, lower.tail = TRUE) rctp(n, a, b, gamma)
dctp(x, a, b, gamma) pctp(q, a, b, gamma, lower.tail = TRUE) qctp(p, a, b, gamma, lower.tail = TRUE) rctp(n, a, b, gamma)
x |
vector of (non-negative integer) quantiles. |
a |
parameter a (real) |
b |
parameter b (real) |
gamma |
parameter |
q |
vector of quantiles. |
lower.tail |
if TRUE (default), probabilities are |
p |
vector of probabilities. |
n |
number of observations. If |
The CTP distribution with parameters ,
and
has pmf
where is the imaginary unit,
the gamma function and
the normalizing constant.
If the CTP is a Complex Biparametric Pearson (CBP) distribution, so the pmf of the CBP distribution is obtained.
If
the CTP is an Extended Biparametric Waring (EBW) distribution, so the pmf of the EBW distribution is obtained.
The mean and the variance of the CTP distribution are
and
so
.
It is underdispersed if , equidispersed if
or overdispersed
if
. In particular, if
the CTP is always overdispersed.
dctp
gives the pmf, pctp
gives the distribution function, qctp
gives the quantile function and rctp
generates random values.
If the probability mass function, distribution function, quantile function and random generation function for the CBP distribution arise.
If
the probability mass function, distribution function, quantile function and random generation function for the EBW distribution arise.
Jose Rodriguez-Avi J, Conde-Sanchez A, Saez-Castillo AJ (2003). “A new class of discrete distributions with complex parameters.” Stat. Pap., 44, 67–88. doi:10.1007/s00362-002-0134-7.
Rodriguez-Avi J, Conde-Sanchez A, Saez-Castillo AJ, Olmo-Jimenez MJ (2004). “A triparametric discrete distribution with complex parameters.” Stat. Pap., 45, 81-95. doi:10.1007/BF02778271.
Olmo-Jimenez MJ, Rodriguez-Avi J, Cueva-Lopez V (2018). “A review of the CTP distribution: a comparison with other over- and underdispersed count data models.” Journal of Statistical Computation and Simulation, 88(14), 2684-2706. doi:10.1080/00949655.2018.1482897.
Cueva-Lopez V, Olmo-Jimenez MJ, Rodriguez-Avi J (2021). “An Over and Underdispersed Biparametric Extension of the Waring Distribution.” Mathematics, 9(170), 1-15. doi:10.3390/math9020170.
Functions for maximum-likelihood fitting of the CTP, CBP and EBW distributions: fitctp
, fitcbp
and fitebw
.
# Examples for the function dctp dctp(3,1,2,5) dctp(c(3,4),1,2,5) # Examples for the function pctp pctp(3,1,2,3) pctp(c(3,4),1,2,3) # Examples for the function qctp qctp(0.5,1,2,3) qctp(c(.8,.9),1,2,3) # Examples for the function rctp rctp(10,1,1,3)
# Examples for the function dctp dctp(3,1,2,5) dctp(c(3,4),1,2,5) # Examples for the function pctp pctp(3,1,2,3) pctp(c(3,4),1,2,3) # Examples for the function qctp qctp(0.5,1,2,3) qctp(c(.8,.9),1,2,3) # Examples for the function rctp rctp(10,1,1,3)
Probability mass function, distribution function, quantile function and random generation for the Extended Biparametric Waring (EBW) distribution with parameters and
(or
).
debw(x, alpha, gamma, rho) pebw(q, alpha, gamma, rho, lower.tail = TRUE) qebw(p, alpha, gamma, rho, lower.tail = TRUE) rebw(n, alpha, gamma, rho, lower.tail = TRUE)
debw(x, alpha, gamma, rho) pebw(q, alpha, gamma, rho, lower.tail = TRUE) qebw(p, alpha, gamma, rho, lower.tail = TRUE) rebw(n, alpha, gamma, rho, lower.tail = TRUE)
x |
vector of (non-negative integer) quantiles. |
alpha |
parameter alpha (real) |
gamma |
parameter |
rho |
parameter rho (positive) |
q |
vector of quantiles. |
lower.tail |
if TRUE (default), probabilities are |
p |
vector of probabilities. |
n |
number of observations. If |
The EBW distribution with parameters and
has pmf
where is the gamma function and
the normalizing constant.
There is an alternative parametrization in terms of and
when
. So, introduce only
and
or
and
,
depending on the parametrization you wish to use.
The mean and the variance of the EBW distribution are
and
so
.
It is underdispersed if , equidispersed if
or overdispersed
if
. In particular, if
the EBW is overdispersed, whereas if
the EBW is underdispersed. In the case
, the EBW may be under-, equi- or
overdispersed depending on the value of
.
debw
gives the pmf, pebw
gives the distribution function, qebw
gives the quantile function and rebw
generates random values.
If the probability mass function, distribution function, quantile function and random generation function for the UGW
distribution arise.
If the probability mass function, distribution function, quantile function and random generation function for the CTP
distribution arise.
Jose Rodriguez-Avi J, Conde-Sanchez A, Saez-Castillo AJ (2003). “A new class of discrete distributions with complex parameters.” Stat. Pap., 44, 67–88. doi:10.1007/s00362-002-0134-7.
Rodriguez-Avi J, Conde-Sanchez A, Saez-Castillo AJ, Olmo-Jimenez MJ (2004). “A triparametric discrete distribution with complex parameters.” Stat. Pap., 45, 81-95. doi:10.1007/BF02778271.
Olmo-Jimenez MJ, Rodriguez-Avi J, Cueva-Lopez V (2018). “A review of the CTP distribution: a comparison with other over- and underdispersed count data models.” Journal of Statistical Computation and Simulation, 88(14), 2684-2706. doi:10.1080/00949655.2018.1482897.
Functions for maximum-likelihood fitting of the CTP and CBP distributions: fitctp
and fitcbp
.
# Examples for the function dctp debw(3,1,rho=5) debw(c(3,4),2,rho=5) # Examples for the function pebw pebw(3,2,rho=5) pebw(c(3,4),2,rho=5) # Examples for the function qebw qebw(0.5,-2.1,gamma=0.1) qebw(c(.8,.9),-2.1,gamma=0.1) qebw(0.5,2,rho=5) qebw(c(.8,.9),2,rho=5) # Examples for the function rebw rebw(10,2,rho=5) rebw(10,-2.1,gamma=5)
# Examples for the function dctp debw(3,1,rho=5) debw(c(3,4),2,rho=5) # Examples for the function pebw pebw(3,2,rho=5) pebw(c(3,4),2,rho=5) # Examples for the function qebw qebw(0.5,-2.1,gamma=0.1) qebw(c(.8,.9),-2.1,gamma=0.1) qebw(0.5,2,rho=5) qebw(c(.8,.9),2,rho=5) # Examples for the function rebw rebw(10,2,rho=5) rebw(10,-2.1,gamma=5)
Maximum-likelihood fitting of the Complex Biparametric Pearson (CBP) distribution with parameters and
. Generic
methods are
print
, summary
, coef
, logLik
, AIC
, BIC
and plot
.
fitcbp(x, bstart = NULL, gammastart = NULL, method = "L-BFGS-B", control = list(), ...)
fitcbp(x, bstart = NULL, gammastart = NULL, method = "L-BFGS-B", control = list(), ...)
x |
A numeric vector of length at least one containing only finite values. |
bstart |
A starting value for the parameter |
gammastart |
A starting value for the parameter |
method |
The method to be used in fitting the model. See 'Details'. |
control |
A list of parameters for controlling the fitting process. |
... |
Additional parameters. |
If the starting values of the parameters and
are omitted (default option),
they are computing by the method of moments (if possible; otherwise they must be entered).
The default method is "L-BFGS-B"
(see details in optim
function),
but non-linear minimization (nlm
) or those included in the optim
function ("Nelder-Mead"
,
"BFGS"
, "CG"
and "SANN"
) may be used.
Standard error (SE) estimates for and
are provided by the default method;
otherwise, SE for
where
is computed.
An object of class 'fitCBP'
is a list containing the following components:
n
, the number of observations,
initialValues
, a vector with the starting values used,
coefficients
, the parameter ML estimates of the CTP distribution,
se
, a vector of the standard error estimates,
hessian
, a symmetric matrix giving an estimate of the Hessian at the solution found in the optimization of the log-likelihood function,
cov
, an estimate of the covariance matrix of the model coefficients,
corr
, an estimate of the correlation matrix of the model estimates,
loglik
, the maximized log-likelihood,
aic
, Akaike Information Criterion, minus twice the maximized log-likelihood plus twice the number of parameters,
bic
, Bayesian Information Criterion, minus twice the maximized log-likelihood plus twice the number of parameters,
code
, a code that indicates successful convergence of the fitter function used (see nlm and optim helps),
converged
, logical value that indicates if the optimization algorithms succesfull,
method
, the name of the fitter function used.
Generic functions:
print
: The print of a 'fitCBP'
object shows the ML parameter estimates and their standard errors in parenthesis.
summary
: The summary provides the ML parameter estimates, their standard errors and the statistic and p-value of the Wald test to check if the parameters are significant.
This summary also shows the loglikelihood, AIC and BIC values, as well as the results for the chi-squared goodness-of-fit test and the Kolmogorov-Smirnov test for discrete variables. Finally, the correlation matrix between parameter estimates appears.
coef
: It extracts the fitted coefficients from a 'fitCBP'
object.
logLik
: It extracts the estimated log-likelihood from a 'fitCBP'
object.
AIC
: It extracts the value of the Akaike Information Criterion from a 'fitCBP'
object.
BIC
: It extracts the value of the Bayesian Information Criterion from a 'fitCBP'
object.
plot
: It shows the plot of a 'fitCBP'
object. Observed and theoretical probabilities, empirical and theoretical cumulative distribution functions or empirical cumulative probabilities against theoretical cumulative probabilities are the three plot types.
Jose Rodriguez-Avi J, Conde-Sanchez A, Saez-Castillo AJ (2003). “A new class of discrete distributions with complex parameters.” Stat. Pap., 44, 67–88. doi:10.1007/s00362-002-0134-7.
Plot of observed and theoretical frequencies for a CBP fit: plot.fitCBP
Maximum-likelihood fitting for the CTP distribution: fitctp
.
Maximum-likelihood fitting for the EBW distribution: fitebw
.
set.seed(123) x <- rcbp(500, 1.75, 3.5) fitcbp(x) summary(fitcbp(x, bstart = 1.1, gammastart = 3))
set.seed(123) x <- rcbp(500, 1.75, 3.5) fitcbp(x) summary(fitcbp(x, bstart = 1.1, gammastart = 3))
Maximum-likelihood fitting of the Complex Triparametric Pearson (CTP) distribution with parameters ,
and
. Generic
methods are
print
, summary
, coef
, logLik
, AIC
, BIC
and plot
.
fitctp(x, astart = NULL, bstart = NULL, gammastart = NULL, method = "L-BFGS-B", control = list(), ...)
fitctp(x, astart = NULL, bstart = NULL, gammastart = NULL, method = "L-BFGS-B", control = list(), ...)
x |
A numeric vector of length at least one containing only finite values. |
astart |
A starting value for the parameter |
bstart |
A starting value for the parameter |
gammastart |
A starting value for the parameter |
method |
The method to be used in fitting the model. See 'Details'. |
control |
A list of parameters for controlling the fitting process. |
... |
Additional parameters. |
If the starting values of the parameters ,
and
are omitted (default option),
they are computing by the method of moments (if possible; otherwise they must be entered).
The default method is "L-BFGS-B"
(see details in optim
function),
but non-linear minimization (nlm
) or those included in the optim
function ("Nelder-Mead"
,
"BFGS"
, "CG"
and "SANN"
) may be used.
Standard error (SE) estimates for ,
and
are provided by the default method; otherwise, SE for
where
is computed.
An object of class 'fitCTP'
is a list containing the following components:
n
, the number of observations,
initialValues
, a vector with the starting values used,
coefficients
, the parameter ML estimates of the CTP distribution,
se
, a vector of the standard error estimates,
hessian
, a symmetric matrix giving an estimate of the Hessian at the solution found in the optimization of the log-likelihood function,
cov
, an estimate of the covariance matrix of the model coefficients,
corr
, an estimate of the correlation matrix of the model estimates,
loglik
, the maximized log-likelihood,
aic
, Akaike Information Criterion, minus twice the maximized log-likelihood plus twice the number of parameters,
bic
, Bayesian Information Criterion, minus twice the maximized log-likelihood plus twice the number of parameters,
code
, a code that indicates successful convergence of the fitter function used (see nlm and optim helps),
converged
, logical value that indicates if the optimization algorithms succesfull,
method
, the name of the fitter function used.
Generic functions:
print
: The print of a 'fitCTP'
object shows the ML parameter estimates and their standard errors in parenthesis.
summary
: The summary provides the ML parameter estimates, their standard errors and the statistic and p-value of the Wald test to check if the parameters are significant.
This summary also shows the loglikelihood, AIC and BIC values, as well as the results for the chi-squared goodness-of-fit test and the Kolmogorov-Smirnov test for discrete variables. Finally, the correlation matrix between parameter estimates appears.
coef
: It extracts the fitted coefficients from a 'fitCTP'
object.
logLik
: It extracts the estimated log-likelihood from a 'fitCTP'
object.
AIC
: It extracts the value of the Akaike Information Criterion from a 'fitCTP'
object.
BIC
: It extracts the value of the Bayesian Information Criterion from a 'fitCTP'
object.
plot
: It shows the plot of a 'fitCTP'
object. Observed and theoretical probabilities, empirical and theoretical cumulative distribution functions or empirical cumulative probabilities against theoretical cumulative probabilities are the three plot types.
Rodriguez-Avi J, Conde-Sanchez A, Saez-Castillo AJ, Olmo-Jimenez MJ (2004). “A triparametric discrete distribution with complex parameters.” Stat. Pap., 45, 81-95. doi:10.1007/BF02778271.
Olmo-Jimenez MJ, Rodriguez-Avi J, Cueva-Lopez V (2018). “A review of the CTP distribution: a comparison with other over- and underdispersed count data models.” Journal of Statistical Computation and Simulation, 88(14), 2684-2706. doi:10.1080/00949655.2018.1482897.
Plot of observed and theoretical frequencies for a CTP fit: plot.fitCTP
Maximum-likelihood fitting for the CBP distribution: fitcbp
.
Maximum-likelihood fitting for the EBW distribution: fitebw
.
set.seed(123) x <- rctp(500, -0.5, 1, 2) fitctp(x) summary(fitctp(x, astart = 1, bstart = 1.1, gammastart = 3))
set.seed(123) x <- rctp(500, -0.5, 1, 2) fitctp(x) summary(fitctp(x, astart = 1, bstart = 1.1, gammastart = 3))
Maximum-likelihood fitting of the Extended Biparametric Waring (EBW) distribution with parameters ,
and
. Generic
methods are
print
, summary
, coef
, logLik
, AIC
, BIC
and plot
. The method to be used in fitting the
model is "L-BFGS-B" which allows constraints for each variable (see details in optim
funtion).
fitebw(x, alphastart = NULL, rhostart = NULL, gammastart = NULL, method = "L-BFGS-B", control = list(),...)
fitebw(x, alphastart = NULL, rhostart = NULL, gammastart = NULL, method = "L-BFGS-B", control = list(),...)
x |
A numeric vector of length at least one containing only finite values. |
alphastart |
A starting value for the parameter |
rhostart |
A starting value for the parameter |
gammastart |
A starting value for the parameter |
method |
The method to be used in fitting the model. The default method is "L-BFGS-B" (optim). |
control |
A list of parameters for controlling the fitting process. |
... |
Additional parameters. |
If the starting value for is positive, the parameterization
is used;
otherwise, the parameterization
is used.
If the starting values of the parameters ,
or
are omitted (default option),
they are computing by the method of moments (if possible; otherwise they must be entered).
The default method is "L-BFGS-B"
(see details in optim
function),
but non-linear minimization (nlm
) or those included in the optim
function
("Nelder-Mead"
, "BFGS"
, "CG"
and "SANN"
) may be used.
Standard error (SE) estimates for ,
or
are provided by the default method;
otherwise, SE for
and
where
and
(or for
and
where
and
) are computed.
An object of class 'fitEBW'
is a list containing the following components:
n
, the number of observations,
initialValues
, a vector with the starting values used,
coefficients
, the parameter ML estimates of the CTP distribution,
se
, a vector of the standard error estimates,
hessian
, a symmetric matrix giving an estimate of the Hessian at the solution found in the optimization of the log-likelihood function,
cov
, an estimate of the covariance matrix of the model coefficients,
corr
, an estimate of the correlation matrix of the model estimates,
loglik
, the maximized log-likelihood,
aic
, Akaike Information Criterion, minus twice the maximized log-likelihood plus twice the number of parameters,
bic
, Bayesian Information Criterion, minus twice the maximized log-likelihood plus twice the number of parameters,
code
, a code that indicates successful convergence of the fitter function used (see nlm and optim helps),
converged
, logical value that indicates if the optimization algorithms succesfull.
method
, the name of the fitter function used.
Generic functions:
print
: The print of a 'fitEBW'
object shows the ML parameter estimates and their standard errors in parenthesis.
summary
: The summary provides the ML parameter estimates, their standard errors and the statistic and p-value of the Wald test to check if the parameters are significant.
This summary also shows the loglikelihood, AIC and BIC values, as well as the results for the chi-squared goodness-of-fit test and the Kolmogorov-Smirnov test for discrete variables. Finally, the correlation matrix between parameter estimates appears.
coef
: It extracts the fitted coefficients from a 'fitEBW'
object.
logLik
: It extracts the estimated log-likelihood from a 'fitEBW'
object.
AIC
: It extracts the value of the Akaike Information Criterion from a 'fitEBW'
object.
BIC
: It extracts the value of the Bayesian Information Criterion from a 'fitEBW'
object.
plot
: It shows the plot of a 'fitEBW'
object. Observed and theoretical probabilities, empirical and theoretical cumulative distribution functions or empirical cumulative probabilities against theoretical cumulative probabilities are the three plot types.
Cueva-Lopez V, Olmo-Jimenez MJ, Rodriguez-Avi J (2021). “An Over and Underdispersed Biparametric Extension of the Waring Distribution.” Mathematics, 9(170), 1-15. doi:10.3390/math9020170.
Plot of observed and theoretical frequencies for a EBW fit: plot.fitEBW
Maximum-likelihood fitting for the CTP distribution: fitctp
.
Maximum-likelihood fitting for the CBP distribution: fitcbp
.
set.seed(123) x <- rebw(500, 2, rho = 5) fitebw(x) summary(fitebw(x, alphastart = 1, rhostart = 5))
set.seed(123) x <- rebw(500, 2, rho = 5) fitebw(x) summary(fitebw(x, alphastart = 1, rhostart = 5))
Plot of observed and theoretical frequencies for a CBP fit
## S3 method for class 'fitCBP' plot(x, plty = "FREQ", maxValue = NULL, ...)
## S3 method for class 'fitCBP' plot(x, plty = "FREQ", maxValue = NULL, ...)
x |
An object of class |
plty |
Plot type to be shown. Default is |
maxValue |
maxValue you want to appear in the plot |
... |
Additional parameters. |
set.seed(123) x <- rcbp(500, 1.75, 3.5) fit <- fitcbp(x) plot(fit) plot(fit, plty = "CDF") plot(fit, plty = "PP")
set.seed(123) x <- rcbp(500, 1.75, 3.5) fit <- fitcbp(x) plot(fit) plot(fit, plty = "CDF") plot(fit, plty = "PP")
Plot of observed and theoretical frequencies for a CTP fit
## S3 method for class 'fitCTP' plot(x, plty = "FREQ", maxValue = NULL, ...)
## S3 method for class 'fitCTP' plot(x, plty = "FREQ", maxValue = NULL, ...)
x |
An object of class |
plty |
Plot type to be shown. Default is |
maxValue |
maxValue you want to appear in the plot |
... |
Additional parameters. |
set.seed(123) x <- rctp(500, -0.5, 1, 2) fit <- fitctp(x) plot(fit) plot(fit, plty = "CDF") plot(fit, plty = "PP")
set.seed(123) x <- rctp(500, -0.5, 1, 2) fit <- fitctp(x) plot(fit) plot(fit, plty = "CDF") plot(fit, plty = "PP")
Plot of observed and theoretical frequencies for a EBW fit
## S3 method for class 'fitEBW' plot(x, plty = "FREQ", maxValue = NULL, ...)
## S3 method for class 'fitEBW' plot(x, plty = "FREQ", maxValue = NULL, ...)
x |
An object of class |
plty |
Plot type to be shown. Default is |
maxValue |
maxValue you want to appear in the plot |
... |
Additional parameters. |
set.seed(123) x <- rebw(500, -0.25, 1) fit <- fitebw(x) plot(fit) plot(fit, plty = "CDF") plot(fit, plty = "PP")
set.seed(123) x <- rebw(500, -0.25, 1) fit <- fitebw(x) plot(fit) plot(fit, plty = "CDF") plot(fit, plty = "PP")
One of the main drawbacks of the Univariate Generalized Waring (UGW) distribution with parameters ,
and
is that the first two parameters are interchangeable, so it is not possible to distinguish
the variance components 'liability' and 'proneness' without additional information. To solve this problem,
an EBW distribution (where these components are uniquely identifiable) can be used since,
given a UGW distribution, there always exists an EBW close to it.
varcomp(object, ...)
varcomp(object, ...)
object |
An object of class |
... |
Additional parameters. |
A data frame with the variance components (randomness, liability and proneness) in absolute and relative terms.
set.seed(123) x <- rebw(500, 2, rho = 5) fit <- fitebw(x, alphastart = 1, rhostart = 5) varcomp(fit)
set.seed(123) x <- rebw(500, 2, rho = 5) fit <- fitebw(x, alphastart = 1, rhostart = 5) varcomp(fit)