View source: R/gkwreg-inference.R
| logLik.gkwreg | R Documentation |
Extracts the log-likelihood value from a fitted Generalized Kumaraswamy (GKw) regression model object.
## S3 method for class 'gkwreg'
logLik(object, ...)
object |
An object of class |
... |
Currently not used. |
The log-likelihood is extracted from the fitted model object and returned as
an object of class "logLik" with appropriate attributes for the number
of parameters (df) and observations (nobs). These attributes
are required for information criteria calculations.
For a GKw regression model with parameter vector \theta, the log-likelihood
is defined as:
\ell(\theta \mid y) = \sum_{i=1}^n \log f(y_i; \alpha_i, \beta_i, \gamma_i, \delta_i, \lambda_i)
where f(\cdot) is the probability density function of the specified GKw
family distribution, and the parameters may depend on covariates through link
functions.
An object of class "logLik" containing the log-likelihood value
with the following attributes:
dfNumber of estimated parameters
nobsNumber of observations
Lopes, J. E.
gkwreg, AIC.gkwreg, BIC.gkwreg
# Load example data
data(GasolineYield)
# Fit a Kumaraswamy regression model
fit <- gkwreg(yield ~ batch + temp, data = GasolineYield, family = "kw")
# Extract log-likelihood
ll <- logLik(fit)
print(ll)
# Access attributes
cat("Log-likelihood:", as.numeric(ll), "\n")
cat("Parameters:", attr(ll, "df"), "\n")
cat("Observations:", attr(ll, "nobs"), "\n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.