lmgce {GCEstim} | R Documentation |
Generalized Cross entropy estimation
Description
This generic function fits a linear regression model via generalized cross entropy. Initial support spaces can be provided or computed.
Usage
lmgce(
formula,
data,
subset,
na.action,
offset,
contrasts = NULL,
model = TRUE,
x = FALSE,
y = FALSE,
cv = TRUE,
cv.nfolds = 5,
errormeasure = c("RMSE", "MSE", "MAE", "MAPE", "sMAPE", "MASE"),
errormeasure.which = {
if (isTRUE(cv))
c("1se", "min", "elbow")
else c("min", "elbow")
},
support.method = c("standardized", "ridge"),
support.method.penalize.intercept = TRUE,
support.signal = NULL,
support.signal.vector = NULL,
support.signal.vector.min = 0.3,
support.signal.vector.max = 20,
support.signal.vector.n = 20,
support.signal.points = c(1/5, 1/5, 1/5, 1/5, 1/5),
support.noise = NULL,
support.noise.points = c(1/3, 1/3, 1/3),
weight = 0.5,
twosteps.n = 1,
method = c("dual.BFGS", "dual.lbfgsb3c", "dual", "primal.solnl", "primal.solnp",
"dual.CG", "dual.L-BFGS-B", "dual.Rcgmin", "dual.bobyqa", "dual.newuoa",
"dual.nlminb", "dual.nlm", "dual.lbfgs", "dual.optimParallel"),
caseGLM = c("D", "M", "NM"),
boot.B = 0,
boot.method = c("residuals", "cases", "wild"),
seed = 230676,
OLS = TRUE,
verbose = 0
)
Arguments
formula |
An object of class |
data |
A data frame (or object coercible by
|
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
na.action |
a function which indicates what should happen when the data
contain |
offset |
this can be used to specify an a priori known component to be
included in the linear predictor during fitting. This should be |
contrasts |
An optional list. See the |
model |
Boolean value. if |
x |
Boolean value. if |
y |
Boolean value. if |
cv |
Boolean value. If |
cv.nfolds |
number of folds used for cross-validation when
|
errormeasure |
Loss function (error) to be used for the selection
of the support spaces. One of c("RMSE","MSE", "MAE", "MAPE", "sMAPE", "MASE").
The default is |
errormeasure.which |
Which value of |
support.method |
One of c("standardized", "ridge"). If
|
support.method.penalize.intercept |
Boolean value. if |
support.signal |
|
support.signal.vector |
NULL or a vector of positive values when
|
support.signal.vector.min |
A positive value for the lowest limit of the
|
support.signal.vector.max |
A positive value for the highest limit of the
|
support.signal.vector.n |
A positive integer for the number of support
spaces to be used when |
support.signal.points |
A positive integer, a vector or a matrix. Prior
weights for the signal. If not a positive integer then the sum of weights by
row must be equal to 1. The default is
|
support.noise |
An interval, preferably centered around zero, given in
the form |
support.noise.points |
A positive integer, a vector or a matrix. Prior
weights for the noise. If not a positive integer then the sum of weights by
row must be equal to 1. The default is
|
weight |
a value between zero and one representing the
prediction-precision loss trade-off. If |
twosteps.n |
Number of GCE reestimations using a previously estimated vector of signal probabilities. |
method |
Use |
caseGLM |
special cases of the generic general linear model. One of
|
boot.B |
A single positive integer greater or equal to 10 for the number
of bootstrap replicates to be used for the computation of the bootstrap
confidence interval(s). Zero value will generate no replicate. The default
is |
boot.method |
Method to be use for bootstrapping. One of
|
seed |
A single value, interpreted as an integer, for reproducibility
or |
OLS |
Boolean value. if |
verbose |
An integer to control how verbose the output is. For a value
of 0 no messages or output are shown and for a value of 3 all messages
are shown. The default is |
Details
The lmgce
function fits a linear regression model via generalized cross
entropy. Models for lmgce
are specified symbolically. A typical model has the
form response ~ terms where response is the (numeric) response vector and
terms is a series of terms which specifies a linear predictor for response.
lmgce
calls the lower level functions lmgce.validate
,
lmgce.assign.ci
, lmgce.assign.noci
, lmgce.sscv
,
lmgce.ss
, lmgce.cv
and lmgce.fit
.
Value
lmgce
returns an object of class
lmgce
.
The function summary.lmgce
is used to obtain and print a
summary of the results. The generic accessory functions
coef.lmgce
, fitted.values.lmgce
,
residuals.lmgce
and df.residual.lmgce
, extract
various useful features of the value returned by object
of class
lmgce
.
An object of class
lmgce
is a list containing at
least the following components:
coefficients |
a named vector of coefficients. |
residuals |
the residuals, that is response minus fitted values. |
fitted.values |
the fitted mean values. |
df.residual |
the residual degrees of freedom. |
call |
the matched call. |
terms |
the |
contrast |
(only where relevant) the contrasts used. |
xlevels |
(only where relevant) a record of the levels of the factors used in fitting. |
offset |
the offset used (missing if none were used). |
y |
if requested (the default), the response used. |
x |
if requested (the default), the model matrix used. |
model |
if requested (the default), the model frame used. |
na.action |
(where relevant) information returned by
|
boot.B |
number of bootstrap replicates used. |
boot.method |
method used for bootstrapping. |
caseGLM |
case of the generic general linear model used. |
convergence |
an integer code. 0 indicates successful
optimization completion. Other numbers indicate different errors. See
|
error |
loss function (error) used for the selection of the support spaces. |
error.measure |
in sample error for the selected support space. |
error.measure.cv.mean |
cross-validation mean error for the selected support space. |
error.measure.cv.sd |
standard deviation of the cross-validation error for the selected support space. |
error.which |
which criterion/standardized/factor support was used |
support.signal.1se |
upper limit of the standardized support space or factor that produced the error within one standard error from the minimum error. |
support.signal.elbow |
upper limit of the standardized support space or factor that produced the error correspondent to the elbow of the error curve. |
support.signal.min |
upper limit of the standardized support space or factor that produced the minimum error. |
p0 |
vector of prior weights used for the signal. |
p |
estimated probabilities associated with the signal. |
w0 |
vector of prior weights used for the noise. |
w |
estimated probabilities associated with the noise. |
lambda |
estimated Lagrange multipliers. |
nep |
normalized entropy of the signal of the model. |
nep.cv.mean |
cross-validation normalized entropy of the signal of the model. |
nep.cv.sd |
standard deviation of the cross-validation normalized entropy of the signal of the model. |
nepk |
normalized entropy of the signal of each coefficient. |
results |
results from the different support spaces with or without
cross-validation, and from bootstrap replicates, namely number of attempts
(if the number of attempts is greater than three times the
number of bootstrap replicates the bootstrapping process stops), coefficients
and normalized entropies (nep - model, and nepk - coefficients), when
applicable; results from OLS estimation if |
support |
vector of given positive upper limits for the
support spaces on standardized data or factors, when
|
support.matrix |
matrix with the support spaces used for estimation on original data. |
support.method |
method chosen for the support's limits |
support.ok |
vector of successful positive upper limits for the
support spaces on standardized data ( |
support.stdUL |
when applicable, the upper limit of the standardized
support chosen, when |
vcov |
variance-covariance matrix of the coefficients. |
Author(s)
Jorge Cabral, jorgecabral@ua.pt
References
Golan, A., Judge, G. G. and Miller, D. (1996)
Maximum entropy econometrics : robust estimation with limited data.
Wiley.
Golan, A. (2008).
Information and Entropy Econometrics — A Review and Synthesis.
Foundations and Trends® in Econometrics, 2(1–2), 1–145.
doi:10.1561/0800000004
Golan, A. (2017)
Foundations of Info-Metrics: Modeling, Inference, and Imperfect Information (Vol. 1).
Oxford University Press.
doi:10.1093/oso/9780199349524.001.0001
Pukelsheim, F. (1994)
The Three Sigma Rule.
The American Statistician, 48(2), 88–91.
doi:10.2307/2684253
Macedo, P., Cabral, J., Afreixo, V., Macedo, F., Angelelli, M. (2025)
RidGME estimation and inference in ill-conditioned models.
In: Gervasi O, Murgante B, Garau C, et al., eds. Computational Science and
Its Applications – ICCSA 2025 Workshops. Springer Nature Switzerland; 2025:300-313.
doi:10.1007/978-3-031-97589-9_21
See Also
summary.lmgce
for more detailed summaries.
The generic functions plot.lmgce
, print.lmgce
,
coef.lmgce
and confint.lmgce
.
Examples
res_gce_package <-
lmgce(y ~ .,
data = dataGCE,
boot.B = 50,
seed = 230676)
res_gce_package