Description Usage Arguments Details Value Author(s) References Examples
View source: R/log_Lik_Weib_gamma_weighted.R
Calculates the log-likelihood function of the weighted gamma or Weibull (depends on user input) distribution.
1 | log_Lik_Weib_gamma_weighted(TRpar,datain,r,dist)
|
TRpar |
A vector of length 2, containing the shape and scale parameters of the distribution. |
datain |
The available sample points. |
r |
The size (order) of the distribution. The special cases r=1,2,3 correspond to length, area, volume biased samples respectively and are the most frequently encountered in practice. The case r=0 corresponds to random samples from the Gamma distribution. |
dist |
Character switch, enables the choice of distribution: type "weib" for the Weibull or "gamma" for the gamma distribution. |
The log likelihood function of the weighted gamma distribution is defined by
\log L = ∑_{i=1}^n log f_r(X_i; θ)
where f_r(x; θ) is the density of the r-size biased gamma distribution. Setting r=0 corresponds to the log likelihood of the Gamma distribution.
In the case of Weibull, the log likelihood is defined by
\log L = ∑_{i=1}^n log f_r(X_i; θ)
where f_r(x; θ) is the density of the r-size biased Weibull distribution. Setting r=0 corresponds to the log likelihood of the Weibull distribution.
A scalar, the result of the log likelihood calculation.
Polychronis Economou
R implementation and documentation: Polychronis Economou <peconom@upatras.gr>
Economou et. al. (2021). Hypothesis testing for the population mean and variance based on r-size biased samples, under review.
1 2 3 4 | #Log-likelihood for the gamma distribution for true parms=(2,3), r=0:
log_Lik_Weib_gamma_weighted(c(2,3), rgamma(100, shape=2, scale=3), 0, "gamma")
#Log-likelihood for the Weibull distribution for true parms=(2,3), r=0:
log_Lik_Weib_gamma_weighted(c(2,3), rweibull(100, shape=2, scale=3), 0, "weib")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.