| Title: | Regression Coefficients Estimation Using the Generalized Cross Entropy |
|---|---|
| Description: | Estimation and inference using the Generalized Maximum Entropy (GME) and Generalized Cross Entropy (GCE) framework, a flexible method for solving ill-posed inverse problems and parameter estimation under uncertainty (Golan, Judge, and Miller (1996, ISBN:978-0471145925) "Maximum Entropy Econometrics: Robust Estimation with Limited Data"). The package includes routines for generalized cross entropy estimation of linear models including the implementation of a GME-GCE two steps approach. Diagnostic tools, and options to incorporate prior information through support and prior distributions are available (Macedo, Cabral, Afreixo, Macedo and Angelelli (2025) <doi:10.1007/978-3-031-97589-9_21>). In particular, support spaces can be defined by the user or be internally computed based on the ridge trace or on the distribution of standardized regression coefficients. Different optimization methods for the objective function can be used. An adaptation of the normalized entropy aggregation (Macedo and Costa (2019) <doi:10.1007/978-3-030-26036-1_2> "Normalized entropy aggregation for inhomogeneous large-scale data") and a two-stage maximum entropy approach for time series regression (Macedo (2022) <doi:10.1080/03610918.2022.2057540>) are also available. Suitable for applications in econometrics, health, signal processing, and other fields requiring robust estimation under data constraints. |
| Authors: | Cabral Jorge [aut, cre] (ORCID: <https://orcid.org/0000-0001-5721-4550>), Macedo Pedro [ths], Afreixo Vera [ths] |
| Maintainer: | Cabral Jorge <[email protected]> |
| License: | GPL-3 |
| Version: | 1.1.0 |
| Built: | 2026-06-07 10:33:02 UTC |
| Source: | https://github.com/jorgevazcabral/gcestim |
Function that allows to calculate different types of errors for point predictions:
MAE - Mean Absolute Error,
MAD - Mean Absolute Deviation,
MSE - Mean Squared Error,
RMSE - Root Mean Squared Error,
MAPE - Mean Absolute Percentage Error,
sMAPE - symmetric Mean Absolute Percentage Error,
MASE - Mean Absolute Scaled Error (Hyndman & Koehler, 2006)
accmeasure( y_pred, y_true, which = c("RMSE", "MSE", "MAPE", "sMAPE", "MAE", "MAD", "MASE") )accmeasure( y_pred, y_true, which = c("RMSE", "MSE", "MAPE", "sMAPE", "MAE", "MAD", "MASE") )
y_pred |
fitted values. |
y_true |
observed values. |
which |
one of c("RMSE", "MAPE", "sMAPE", "MAE", "MAD", "MASE") |
The value of the chosen error is returned.
Jorge Cabral, [email protected]
Hyndman, R. J., & Koehler, A. B. (2006)
Another look at measures of forecast accuracy.
International Journal of Forecasting, 22(4), 679–688.
doi:10.1016/j.ijforecast.2006.03.001
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) accmeasure(fitted(res_gce_package), dataThesis$y, which = "MSE") accmeasure(coef(res_gce_package), coef.dataThesis, which = "MSE")res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) accmeasure(fitted(res_gce_package), dataThesis$y, which = "MSE") accmeasure(coef(res_gce_package), coef.dataThesis, which = "MSE")
lmgce Fitted ModelsSimple utility returning case names.
## S3 method for class 'lmgce' case.names(object, ...)## S3 method for class 'lmgce' case.names(object, ...)
object |
Fitted |
... |
Additional arguments (not used). |
A character vector containing the names or labels of the cases
(observations) in the lmgce model object.
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) case.names(res_gce_package)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) case.names(res_gce_package)
lmgce objectChanges the number of GCE reestimations of a lmgce object
changestep(object, twosteps.n, verbose = 0)changestep(object, twosteps.n, verbose = 0)
object |
fitted |
twosteps.n |
An integer that defines the number of GCE reestimations to be used. |
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 |
An lmgce object with the specified number of GCE
reestimations
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) res_gce_package_change_step <- changestep(res_gce_package,0) summary(res_gce_package) summary(res_gce_package_change_step)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) res_gce_package_change_step <- changestep(res_gce_package,0) summary(res_gce_package) summary(res_gce_package_change_step)
lmgce objectChanges the support spaces of a lmgce object
changesupport(object, support, verbose = 0)changesupport(object, support, verbose = 0)
object |
fitted |
support |
One of c("min", "1se", "elbow") or a chosen support from
|
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 |
An lmgce object with the specified support spaces
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) res_gce_package_change <- changesupport(res_gce_package, "min") summary(res_gce_package) summary(res_gce_package_change)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) res_gce_package_change <- changesupport(res_gce_package, "min") summary(res_gce_package) summary(res_gce_package_change)
cv.lmgce CoefficientsExtract coefficients from a cv.lmgce object
## S3 method for class 'cv.lmgce' coef(object, ...)## S3 method for class 'cv.lmgce' coef(object, ...)
object |
Fitted |
... |
Additional arguments (not used). |
Returns the coefficients from a cv.lmgce object. The
coefficients are obtained from the lmgce object with best
performance. These coefficients are stored in
object$best$coefficients.
Jorge Cabral, [email protected]
cv.tsbootgce Model CoefficientsExtract coefficients from a cv.tsbootgce object
## S3 method for class 'cv.tsbootgce' coef(object, which = NULL, OLS = FALSE, seed = object$seed, ...)## S3 method for class 'cv.tsbootgce' coef(object, which = NULL, OLS = FALSE, seed = object$seed, ...)
object |
Fitted |
which |
The default is |
OLS |
Boolean value. If |
seed |
A single value, interpreted as an integer, for reproducibility
or |
... |
Additional arguments. |
Returns the coefficients from a cv.tsbootgce object
Jorge Cabral, [email protected]
Coefficients used in simulated data, used to demonstrate the functions of GCEstim.
coef.dataThesiscoef.dataThesis
A vector containing the coefficients used to generate dataThesis
coef.dataThesiscoef.dataThesis
lmgce Model CoefficientsExtract coefficients from a lmgce object
## S3 method for class 'lmgce' coef(object, ...)## S3 method for class 'lmgce' coef(object, ...)
object |
Fitted |
... |
Additional arguments (not used). |
Returns the coefficients from a lmgce object
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) coef(res_gce_package)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) coef(res_gce_package)
neagging CoefficientsExtract coefficients from a neagging object
## S3 method for class 'neagging' coef(object, which = which.min(object$error)[[1]], ...)## S3 method for class 'neagging' coef(object, which = which.min(object$error)[[1]], ...)
object |
Fitted |
which |
Number of aggregated models. The coefficients returned are by default the ones that produced the lowest in sample error. |
... |
Additional arguments. |
Returns the coefficients from a neagging object
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) res_neagging <- neagging(res_gce_package) coef(res_neagging) coef(res_neagging, which = ncol(res_neagging$matrix))res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) res_neagging <- neagging(res_gce_package) coef(res_neagging) coef(res_neagging, which = ncol(res_neagging$matrix))
ridgetrace Model CoefficientsExtract coefficients from a ridgetrace object
## S3 method for class 'ridgetrace' coef(object, which = "min.error", ...)## S3 method for class 'ridgetrace' coef(object, which = "min.error", ...)
object |
Fitted |
which |
One of |
... |
Additional arguments (not used). |
Returns the coefficients from a ridgetrace object
Jorge Cabral, [email protected]
res.ridgetrace <- ridgetrace( formula = y ~ X001 + X002 + X003 + X004, data = dataThesis) coef(res.ridgetrace)res.ridgetrace <- ridgetrace( formula = y ~ X001 + X002 + X003 + X004, data = dataThesis) coef(res.ridgetrace)
tsbootgce Model CoefficientsExtract coefficients from a tsbootgce object
## S3 method for class 'tsbootgce' coef(object, which = NULL, OLS = FALSE, seed = object$seed, ...)## S3 method for class 'tsbootgce' coef(object, which = NULL, OLS = FALSE, seed = object$seed, ...)
object |
Fitted |
which |
The default is |
OLS |
Boolean value. If |
seed |
A single value, interpreted as an integer, for reproducibility
or |
... |
Additional arguments. |
Returns the coefficients from a tsbootgce object
Jorge Cabral, [email protected]
res.tsbootgce <- tsbootgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) coef(res.tsbootgce)res.tsbootgce <- tsbootgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) coef(res.tsbootgce)
cv.lmgce CoefficientsExtract coefficients from a cv.lmgce object
## S3 method for class 'cv.lmgce' coefficients(object, ...)## S3 method for class 'cv.lmgce' coefficients(object, ...)
object |
Fitted |
... |
Additional arguments (not used). |
Returns the coefficients from a cv.lmgce object. The
coefficients are obtained from the lmgce object with best
performance. These coefficients are stored in
object$best$coefficients.
Jorge Cabral, [email protected]
cv.tsbootgce Model CoefficientsExtract coefficients from a cv.tsbootgce object
## S3 method for class 'cv.tsbootgce' coefficients(object, which = NULL, OLS = FALSE, seed = object$seed, ...)## S3 method for class 'cv.tsbootgce' coefficients(object, which = NULL, OLS = FALSE, seed = object$seed, ...)
object |
Fitted |
which |
The default is |
OLS |
Boolean value. If |
seed |
A single value, interpreted as an integer, for reproducibility
or |
... |
Additional arguments. |
Returns the coefficients from a cv.tsbootgce object
Jorge Cabral, [email protected]
lmgce Model CoefficientsExtract coefficients from a lmgce object
## S3 method for class 'lmgce' coefficients(object, ...)## S3 method for class 'lmgce' coefficients(object, ...)
object |
Fitted |
... |
Additional arguments (not used). |
Returns the coefficients from a lmgce object
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) coefficients(res_gce_package)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) coefficients(res_gce_package)
neagging CoefficientsExtract coefficients from a neagging object
## S3 method for class 'neagging' coefficients(object, which = which.min(object$error)[[1]], ...)## S3 method for class 'neagging' coefficients(object, which = which.min(object$error)[[1]], ...)
object |
Fitted |
which |
Number of aggregated models. The coefficients returned are by default the ones that produced the lowest in sample error. |
... |
Additional arguments. |
Returns the coefficients from a neagging object
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) res_neagging <- neagging(res_gce_package) coefficients(res_neagging) coefficients(res_neagging, which = ncol(res_neagging$matrix))res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) res_neagging <- neagging(res_gce_package) coefficients(res_neagging) coefficients(res_neagging, which = ncol(res_neagging$matrix))
ridgetrace Model CoefficientsExtract coefficients from a ridgetrace object
## S3 method for class 'ridgetrace' coefficients(object, which = "min.error", ...)## S3 method for class 'ridgetrace' coefficients(object, which = "min.error", ...)
object |
Fitted |
which |
One of |
... |
Additional arguments. |
Returns the coefficients from a ridgetrace object
Jorge Cabral, [email protected]
res.ridgetrace <- ridgetrace( formula = y ~ X001 + X002 + X003 + X004, data = dataThesis) coefficients(res.ridgetrace)res.ridgetrace <- ridgetrace( formula = y ~ X001 + X002 + X003 + X004, data = dataThesis) coefficients(res.ridgetrace)
tsbootgce Model CoefficientsExtract coefficients from a tsbootgce object
## S3 method for class 'tsbootgce' coefficients(object, which = NULL, OLS = FALSE, seed = object$seed, ...)## S3 method for class 'tsbootgce' coefficients(object, which = NULL, OLS = FALSE, seed = object$seed, ...)
object |
Fitted |
which |
The default is |
OLS |
Boolean value. If |
seed |
A single value, interpreted as an integer, for reproducibility
or |
... |
Additional arguments. |
Returns the coefficients from a tsbootgce object
Jorge Cabral, [email protected]
res.tsbootgce <- tsbootgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) coefficients(res.tsbootgce)res.tsbootgce <- tsbootgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) coefficients(res.tsbootgce)
cv.tsbootgce Model Parameters and
Normalized EntropyComputes confidence intervals for one or more parameters or Normalized
Entropy in a cv.tsbootgce fitted model.
## S3 method for class 'cv.tsbootgce' confint( object, parm, level = 0.95, which = c("estimates", "NormEnt"), method = c("hdr", "percentile", "basic"), seed = object$seed, OLS = FALSE, ... )## S3 method for class 'cv.tsbootgce' confint( object, parm, level = 0.95, which = c("estimates", "NormEnt"), method = c("hdr", "percentile", "basic"), seed = object$seed, OLS = FALSE, ... )
object |
Fitted |
parm |
a specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered. |
level |
the confidence level required. The default is
|
which |
One of |
method |
method used to compute the interval. One of
c("hdr", "percentile", "basic"). The default is |
seed |
A single value, interpreted as an integer, for reproducibility
or |
OLS |
Boolean value. If |
... |
additional arguments. |
A matrix (or vector) with columns giving lower and upper confidence limits for each parameter. Generally, these will be labelled as (1-level)/2 and 1 - (1-level)/2 in percentage (by default 2.5 percent and 97.5 percent).
Jorge Cabral, [email protected]
lmgce Model Parameters and
Normalized EntropyComputes confidence intervals for one or more parameters or Normalized
Entropy in a lmgce fitted model.
## S3 method for class 'lmgce' confint( object, parm, level = 0.95, which = c("estimates", "NormEnt"), method = { if (which == "estimates") { c("z", "percentile", "basic") } else { c("percentile", "basic") } }, boot.B = ifelse(object$boot.B == 0, 100, object$boot.B), boot.method = object$boot.method, ... )## S3 method for class 'lmgce' confint( object, parm, level = 0.95, which = c("estimates", "NormEnt"), method = { if (which == "estimates") { c("z", "percentile", "basic") } else { c("percentile", "basic") } }, boot.B = ifelse(object$boot.B == 0, 100, object$boot.B), boot.method = object$boot.method, ... )
object |
Fitted |
parm |
a specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered. |
level |
the confidence level required. The default is
|
which |
One of |
method |
method used to compute the interval. One of
|
boot.B |
A single positive integer greater or equal to 10 for the number
of bootstrap replicates for the computation of the bootstrap confidence
interval(s), to be used when |
boot.method |
Method used for bootstrapping. One of
|
... |
additional arguments. |
A matrix (or vector) with columns giving lower and upper confidence limits for each parameter. These will be labelled as (1-level)/2 and 1 - (1-level)/2 in percentage (by default 2.5 percent and 97.5 percent).
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) confint(res_gce_package, method = "percentile") confint(res_gce_package, which = "NormEnt", level = 0.99) confint(res_gce_package, parm = c("X004"), level = 0.99)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) confint(res_gce_package, method = "percentile") confint(res_gce_package, which = "NormEnt", level = 0.99) confint(res_gce_package, parm = c("X004"), level = 0.99)
tsbootgce Model Parameters and
Normalized EntropyComputes confidence intervals for one or more parameters or Normalized
Entropy in a tsbootgce fitted model.
## S3 method for class 'tsbootgce' confint( object, parm, level = 0.95, which = c("estimates", "NormEnt"), method = c("hdr", "percentile", "basic"), seed = object$seed, OLS = FALSE, ... )## S3 method for class 'tsbootgce' confint( object, parm, level = 0.95, which = c("estimates", "NormEnt"), method = c("hdr", "percentile", "basic"), seed = object$seed, OLS = FALSE, ... )
object |
Fitted |
parm |
a specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered. |
level |
the confidence level required. The default is
|
which |
One of |
method |
method used to compute the interval. One of
c("hdr", "percentile", "basic"). The default is |
seed |
A single value, interpreted as an integer, for reproducibility
or |
OLS |
Boolean value. If |
... |
additional arguments. |
A matrix (or vector) with columns giving lower and upper confidence limits for each parameter. Generally, these will be labelled as (1-level)/2 and 1 - (1-level)/2 in percentage (by default 2.5 percent and 97.5 percent).
Jorge Cabral, [email protected]
res.tsbootgce <- tsbootgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) confint(res.tsbootgce, method = "percentile") confint(res.tsbootgce, which = "NormEnt", level = 0.99) confint(res.tsbootgce, parm = c("L(GDP, 0)"), level = 0.99)res.tsbootgce <- tsbootgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) confint(res.tsbootgce, method = "percentile") confint(res.tsbootgce, which = "NormEnt", level = 0.99) confint(res.tsbootgce, parm = c("L(GDP, 0)"), level = 0.99)
dynlmgce
Performs k-fold cross-validation for some of the dynlmgce
parameters.
cv.dynlmgce( formula, data, subset, na.action, offset, contrasts = NULL, start = NULL, end = NULL, 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.ridge.lambda = NULL, support.method.ridge.lambda.min = 10^-3, support.method.ridge.lambda.max = 10^3, support.method.ridge.lambda.n = 100, support.method.ridge.standardize = TRUE, support.method.ridge.penalize.intercept = TRUE, support.method.ridge.symm = TRUE, support.method.ridge.maxresid = 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(3, 5, 7, 9), support.noise = NULL, support.noise.points = c(3, 5, 7, 9), weight = c(0.1, 0.3, 0.5, 0.7, 0.9), twosteps.n = 1, method = c("dual.BFGS", "dual.lbfgsb3c", "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, coef = NULL )cv.dynlmgce( formula, data, subset, na.action, offset, contrasts = NULL, start = NULL, end = NULL, 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.ridge.lambda = NULL, support.method.ridge.lambda.min = 10^-3, support.method.ridge.lambda.max = 10^3, support.method.ridge.lambda.n = 100, support.method.ridge.standardize = TRUE, support.method.ridge.penalize.intercept = TRUE, support.method.ridge.symm = TRUE, support.method.ridge.maxresid = 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(3, 5, 7, 9), support.noise = NULL, support.noise.points = c(3, 5, 7, 9), weight = c(0.1, 0.3, 0.5, 0.7, 0.9), twosteps.n = 1, method = c("dual.BFGS", "dual.lbfgsb3c", "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, coef = NULL )
formula |
a "formula" describing the linear model to be fit. For details
see |
data |
A |
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 |
start |
The time of the first observation. Either a single number
or a vector of two numbers (the second of which is an integer), which
specify a natural time unit and a (1-based) number of samples into the time
unit (see |
end |
The time of the last observation, specified in the same way as
|
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.ridge.lambda |
Ridge parameter. The default is
|
support.method.ridge.lambda.min |
Minimum value for the
|
support.method.ridge.lambda.max |
Maximum value for the
|
support.method.ridge.lambda.n |
The number of ridge parameters values.
The default is |
support.method.ridge.standardize |
Boolean value. If |
support.method.ridge.penalize.intercept |
Boolean value. if |
support.method.ridge.symm |
Boolean value. If |
support.method.ridge.maxresid |
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 vector of positive integers defining the
number of points for the signal support to be tested .The default is
|
support.noise |
An interval, preferably centered around zero, given in
the form |
support.noise.points |
A vector of positive integers defining the number
of points for the noise support to be tested. The default is
|
weight |
a vector of values between zero and one representing the
prediction-precision loss trade-off. The default is
|
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 |
coef |
A vector of the true coefficients, when available. |
The cv.dynlmgce function fits several dynamic linear regression
models via generalized cross according to the defined arguments.
In particular, support.signal.points, support.noise.points and
weight can be defined as vectors.
cv.dynlmgce returns an object of class
cv.lmgce containing at least the following components:
results |
a |
best |
a |
support.signal.points |
a vector of the |
support.signal.points.best |
the value of |
support.noise.points |
a vector of the |
support.noise.points.best |
the value of |
weight |
a vector of the |
weight.best |
the value of |
Jorge Cabral, [email protected]
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
See the generic functions plot.cv.lmgce,
print.cv.lmgce and coef.cv.lmgce.
res.cv.dynlmgce <- cv.dynlmgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) res.cv.dynlmgceres.cv.dynlmgce <- cv.dynlmgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) res.cv.dynlmgce
lmgce
Performs k-fold cross-validation for some of the lmgce
parameters.
cv.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.ridge.lambda = NULL, support.method.ridge.lambda.min = 10^-3, support.method.ridge.lambda.max = 10^3, support.method.ridge.lambda.n = 100, support.method.ridge.standardize = TRUE, support.method.ridge.penalize.intercept = TRUE, support.method.ridge.symm = TRUE, support.method.ridge.maxresid = 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(3, 5, 7, 9), support.noise = NULL, support.noise.points = c(3, 5, 7, 9), weight = c(0.1, 0.3, 0.5, 0.7, 0.9), twosteps.n = 1, method = c("dual.BFGS", "dual.lbfgsb3c", "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, coef = NULL )cv.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.ridge.lambda = NULL, support.method.ridge.lambda.min = 10^-3, support.method.ridge.lambda.max = 10^3, support.method.ridge.lambda.n = 100, support.method.ridge.standardize = TRUE, support.method.ridge.penalize.intercept = TRUE, support.method.ridge.symm = TRUE, support.method.ridge.maxresid = 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(3, 5, 7, 9), support.noise = NULL, support.noise.points = c(3, 5, 7, 9), weight = c(0.1, 0.3, 0.5, 0.7, 0.9), twosteps.n = 1, method = c("dual.BFGS", "dual.lbfgsb3c", "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, coef = NULL )
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.ridge.lambda |
Ridge parameter. The default is
|
support.method.ridge.lambda.min |
Minimum value for the
|
support.method.ridge.lambda.max |
Maximum value for the
|
support.method.ridge.lambda.n |
The number of ridge parameters values.
The default is |
support.method.ridge.standardize |
Boolean value. If |
support.method.ridge.penalize.intercept |
Boolean value. if |
support.method.ridge.symm |
Boolean value. If |
support.method.ridge.maxresid |
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 vector of positive integers defining the
number of points for the signal support to be tested .The default is
|
support.noise |
An interval, preferably centered around zero, given in
the form |
support.noise.points |
A vector of positive integers defining the number
of points for the noise support to be tested .The default is
|
weight |
a vector of values between zero and one representing the
prediction-precision loss trade-off. The default is
|
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 |
coef |
A vector of the true coefficients, when available. |
The cv.lmgce function fits several linear regression models via
generalized cross according to the defined arguments. In particular,
support.signal.points, support.noise.points and
weight can be defined as vectors.
cv.lmgce returns an object of class
cv.lmgce.
An object of class cv.lmgce is a list containing
at least the following components:
results |
a |
best |
a |
support.signal.points |
a vector of the |
support.signal.points.best |
the value of |
support.noise.points |
a vector of the |
support.noise.points.best |
the value of |
weight |
a vector of the |
weight.best |
the value of |
Jorge Cabral, [email protected]
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
See the generic functions plot.cv.lmgce,
print.cv.lmgce and coef.cv.lmgce.
This generic function fits a linear regression model using bootstrapped time series via generalized cross entropy.
cv.tsbootgce( formula, data, subset, na.action, offset, contrasts = NULL, trim = 0.05, reps = 1000, start = NULL, end = NULL, coef.method = c("median", "mode"), 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.ridge.lambda = NULL, support.method.ridge.lambda.min = 10^-3, support.method.ridge.lambda.max = 10^3, support.method.ridge.lambda.n = 100, support.method.ridge.standardize = TRUE, support.method.ridge.penalize.intercept = TRUE, support.method.ridge.symm = TRUE, support.method.ridge.maxresid = 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(3, 5, 7, 9), support.noise = NULL, support.noise.points = c(3, 5, 7, 9), weight = c(0.1, 0.3, 0.5, 0.7, 0.9), twosteps.n = 1, method = c("dual.BFGS", "dual.lbfgsb3c", "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 )cv.tsbootgce( formula, data, subset, na.action, offset, contrasts = NULL, trim = 0.05, reps = 1000, start = NULL, end = NULL, coef.method = c("median", "mode"), 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.ridge.lambda = NULL, support.method.ridge.lambda.min = 10^-3, support.method.ridge.lambda.max = 10^3, support.method.ridge.lambda.n = 100, support.method.ridge.standardize = TRUE, support.method.ridge.penalize.intercept = TRUE, support.method.ridge.symm = TRUE, support.method.ridge.maxresid = 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(3, 5, 7, 9), support.noise = NULL, support.noise.points = c(3, 5, 7, 9), weight = c(0.1, 0.3, 0.5, 0.7, 0.9), twosteps.n = 1, method = c("dual.BFGS", "dual.lbfgsb3c", "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 )
formula |
a "formula" describing the linear model to be fit. For details
see |
data |
A |
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 |
trim |
The trimming proportion (see |
reps |
The number of replicates to generate (see
|
start |
The time of the first observation. Either a single number
or a vector of two numbers (the second of which is an integer), which
specify a natural time unit and a (1-based) number of samples into the time
unit (see |
end |
The time of the last observation, specified in the same way as
|
coef.method |
Method used to estimate the coefficients. One of
|
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.ridge.lambda |
Ridge parameter. The default is
|
support.method.ridge.lambda.min |
Minimum value for the
|
support.method.ridge.lambda.max |
Maximum value for the
|
support.method.ridge.lambda.n |
The number of ridge parameters values.
The default is |
support.method.ridge.standardize |
Boolean value. If |
support.method.ridge.penalize.intercept |
Boolean value. if |
support.method.ridge.symm |
Boolean value. If |
support.method.ridge.maxresid |
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 vector of positive integers defining the
number of points for the signal support to be tested .The default is
|
support.noise |
An interval, preferably centered around zero, given in
the form |
support.noise.points |
A vector of positive integers defining the number
of points for the noise support to be tested .The default is
|
weight |
a vector of values between zero and one representing the
prediction-precision loss trade-off. The default is
|
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 |
The cv.tsbootgce function fits several linear regression models via
generalized cross entropy in replicas of time series obtained using
meboot. Models for cv.tsbootgce are
specified symbolically (see lm and
dynlm).
cv.tsbootgce returns an object of class
cv.tsbootgce. The generic accessory functions
coef.cv.tsbootgce, confint.tsbootgce and
plot.tsbootgce extract various useful features of the value
returned by object of class tsbootgce.
An object of class tsbootgce is a list
containing at least the following components:
call |
the matched call. |
coefficients |
a named data frame of coefficients determined by
|
data.ts |
|
error |
loss function (error) used for the selection of the support spaces. |
error.measure |
in sample error for the selected support space. |
fitted.values |
the fitted mean values. |
frequency |
see |
index |
see |
lmgce |
|
meboot |
|
model |
the model frame used. |
nep |
normalized entropy of the signal of the model. |
nepk |
normalized entropy of the signal of each coefficient. |
residuals |
the residuals, that is response minus fitted values. |
results |
a list containing the bootstrap results: "coef.matrix", a named data frame of all the coefficients; "nepk.matrix", a named data frame of all the normalized entropy values of each parameter; "nep.vector", a vector of all the normalized entropy values of the model. |
seed |
the seed used. |
terms |
the |
x |
if requested (the default), the model matrix used. |
xlevels |
(only where relevant) a record of the levels of the factors used in fitting. |
y |
if requested (the default), the response used. |
Jorge Cabral, [email protected]
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
Hyndman, R.J. (1996)
Computing and graphing highest density regions.
American Statistician, 50, 120-126.
doi:10.2307/2684423
Pukelsheim, F. (1994)
The Three Sigma Rule.
The American Statistician, 48(2), 88–91.
doi:10.2307/2684253
Vinod, H. D., & Lopez-de-Lacalle, J. (2009). Maximum Entropy Bootstrap for Time Series: The meboot R Package. Journal of Statistical Software, 29(5), 1–19. doi:10.18637/jss.v029.i05
The generic functions plot.tsbootgce,
print.tsbootgce, and coef.tsbootgce.
Simulated data, used to demonstrate the functions of GCEstim.
dataExampledataExample
A data.frame containing:
A N(0,1) independent variable.
A N(0,1) independent variable.
A Dependent variable: y = 1 - 6 * X001 + 9 * X002 + error; the error follows a normal distribution with mean equal to zero and variance such that the signal to noise ratio is equal to 1; N = 8.
data(dataExample) plot(dataExample)data(dataExample) plot(dataExample)
Simulated data, used to demonstrate the functions of GCEstim. The seed used
is the different from the one used to generate dataGCE.test but the
remaining parameters are the same.
dataGCEdataGCE
A data.frame containing:
A N(0,1) independent variable.
A N(0,1) independent variable.
A N(0,1) independent variable.
A N(0,1) independent variable.
A N(0,1) independent variable.
A Dependent variable: y = 1 + 3 * X003 + 6 * X004 + 9 * X005 + error; the error follows a normal distribution with mean equal to zero and variance such that the signal to noise ratio is equal to 5.
data(dataGCE) plot(dataGCE)data(dataGCE) plot(dataGCE)
Simulated data, used to demonstrate the functions of GCEstim. The seed used
is the different from the one used to generate dataGCE but the
remaining parameters are the same.
dataGCE.testdataGCE.test
A data.frame containing:
A N(0,1) independent variable.
A N(0,1) independent variable.
A N(0,1) independent variable.
A N(0,1) independent variable.
A N(0,1) independent variable.
A Dependent variable: y = 1 + 3 * X003 + 6 * X004 + 9 * X005 + error; the error follows a normal distribution with mean equal to zero and variance such that the signal to noise ratio is equal to 5.
data(dataGCE.test) plot(dataGCE.test)data(dataGCE.test) plot(dataGCE.test)
Simulated data, used to demonstrate the functions of GCEstim.
dataincRidGMEdataincRidGME
A data.frame containing:
A N(0,1) independent variable.
A N(0,1) independent variable.
A N(0,1) independent variable.
A N(0,1) independent variable.
A N(0,1) independent variable.
A N(0,1) independent variable.
A Dependent variable: y = 2.5 - 8 * X004 + 19 * X005 - 13 * X006 + error; the error follows a normal distribution with mean equal to zero and variance such that the signal to noise ratio is equal to 1.
data(dataincRidGME) plot(dataincRidGME)data(dataincRidGME) plot(dataincRidGME)
Simulated data, used to demonstrate the functions of GCEstim.
dataincRidGME.testdataincRidGME.test
A data.frame containing:
A N(0,1) independent variable.
A N(0,1) independent variable.
A N(0,1) independent variable.
A N(0,1) independent variable.
A N(0,1) independent variable.
A N(0,1) independent variable.
A Dependent variable: y = 2.5 - 8 * X004 + 19 * X005 - 13 * X006 + error; the error follows a normal distribution with mean equal to zero and variance such that the signal to noise ratio is equal to 1.
data(dataincRidGME.test) plot(dataincRidGME.test)data(dataincRidGME.test) plot(dataincRidGME.test)
Simulated data, used to demonstrate the functions of GCEstim.
dataThesisdataThesis
A data.frame containing:
A N(0,1) independent variable.
A N(0,1) independent variable.
A N(0,1) independent variable.
A N(0,1) independent variable.
A Dependent variable: y = -4 - 16 * X002 - 12 * X003 - 5 * X004 + error; the error follows a normal distribution with mean equal to zero and variance such that the signal to noise ratio is equal to 5; N = 75.
data(dataThesis) plot(dataThesis)data(dataThesis) plot(dataThesis)
Returns the residual degrees-of-freedom extracted from a fitted model
lmgce object.
## S3 method for class 'lmgce' df.residual(object, ...)## S3 method for class 'lmgce' df.residual(object, ...)
object |
Fitted |
... |
additional arguments. |
The value of the residual degrees-of-freedom extracted from a
lmgce object.
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) df.residual(res_gce_package)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) df.residual(res_gce_package)
This generic function fits dynamic linear models using time series via generalized cross entropy.
dynlmgce( formula, data, subset, na.action, offset, contrasts = NULL, start = NULL, end = NULL, 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.ridge.lambda = NULL, support.method.ridge.lambda.min = 10^-3, support.method.ridge.lambda.max = 10^3, support.method.ridge.lambda.n = 100, support.method.ridge.standardize = TRUE, support.method.ridge.penalize.intercept = TRUE, support.method.ridge.symm = TRUE, support.method.ridge.maxresid = 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", "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 )dynlmgce( formula, data, subset, na.action, offset, contrasts = NULL, start = NULL, end = NULL, 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.ridge.lambda = NULL, support.method.ridge.lambda.min = 10^-3, support.method.ridge.lambda.max = 10^3, support.method.ridge.lambda.n = 100, support.method.ridge.standardize = TRUE, support.method.ridge.penalize.intercept = TRUE, support.method.ridge.symm = TRUE, support.method.ridge.maxresid = 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", "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 )
formula |
a "formula" describing the linear model to be fit. For details
see |
data |
A |
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 |
start |
The time of the first observation. Either a single number
or a vector of two numbers (the second of which is an integer), which
specify a natural time unit and a (1-based) number of samples into the time
unit (see |
end |
The time of the last observation, specified in the same way as
|
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.ridge.lambda |
Ridge parameter. The default is
|
support.method.ridge.lambda.min |
Minimum value for the
|
support.method.ridge.lambda.max |
Maximum value for the
|
support.method.ridge.lambda.n |
The number of ridge parameters values.
The default is |
support.method.ridge.standardize |
Boolean value. If |
support.method.ridge.penalize.intercept |
Boolean value. if |
support.method.ridge.symm |
Boolean value. If |
support.method.ridge.maxresid |
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 |
The dynlmgce function fits linear regression models via
generalized cross entropy time series. Models for dynlmgce are
specified symbolically (see lm and
dynlm).
dynlmgce returns an object of class
lmgce. The generic accessory functions
coef.lmgce, confint.lmgce and
plot.lmgce extract various useful features of the value
returned by object of class lmgce.
The dynlmgce function returns a list containing at
least the following components:
call |
the matched call. |
coefficients |
a named data frame of coefficients. |
data.ts |
|
error |
loss function (error) used for the selection of the support spaces. |
error.measure |
in sample error for the selected support space. |
fitted.values |
the fitted mean values. |
frequency |
see |
index |
see |
lmgce |
|
model |
the model frame used. |
nep |
normalized entropy of the signal of the model. |
nepk |
normalized entropy of the signal of each coefficient. |
residuals |
the residuals, that is response minus fitted values. |
results |
a list containing the bootstrap results: "coef.matrix", a named data frame of all the coefficients; "nepk.matrix", a named data frame of all the normalized entropy values of each parameter; "nep.vector", a vector of all the normalized entropy values of the model. |
seed |
the seed used. |
terms |
the |
x |
if requested (the default), the model matrix used. |
xlevels |
(only where relevant) a record of the levels of the factors used in fitting. |
y |
if requested (the default), the response used. |
Jorge Cabral, [email protected]
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
The generic functions plot.lmgce, print.lmgce,
and coef.lmgce.
res.dynlmgce <- dynlmgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) res.dynlmgceres.dynlmgce <- dynlmgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) res.dynlmgce
The Entropy Ratio test - which corresponds to the likelihood ratio, or empirical ratio, test - measures the entropy discrepancy between the constrained and the unconstrained models.
ER.test(object)ER.test(object)
object |
fitted |
A matrix with the X-squared statistics, degrees of freedom and p-value for each parameter.
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) ER.test(res_gce_package)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) ER.test(res_gce_package)
lmgce Fitted ValuesThe fitted values for the linear model represented by a lmgce
object are extracted.
## S3 method for class 'lmgce' fitted(object, ...)## S3 method for class 'lmgce' fitted(object, ...)
object |
Fitted |
... |
additional arguments. |
Returns a vector with the fitted values for the linear model
represented by a lmgce object.
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) fitted(res_gce_package)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) fitted(res_gce_package)
lmgce Fitted ValuesThe fitted values for the linear model represented by a lmgce
object are extracted.
## S3 method for class 'lmgce' fitted.values(object, ...)## S3 method for class 'lmgce' fitted.values(object, ...)
object |
Fitted |
... |
additional arguments. |
Returns a vector with the fitted values for the linear model
represented by a lmgce object.
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) fitted.values(res_gce_package)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) fitted.values(res_gce_package)
Generates data
fngendata( n, bin.k = 0, bin.prob = NULL, cont.k = 5, y.gen.bin.k = 0, y.gen.bin.beta = NULL, y.gen.bin.prob = NULL, y.gen.cont.beta = c(2, 4, 6, 8, 10), y.gen.cont.mod.k = 0, y.gen.cont.mod.beta = matrix(c(-2, 2), 1, 2, byrow = TRUE), y.gen.bin.mod.prob = c(0.5), y.gen.cont.sp.k = 0, y.gen.cont.sp.groups = 2, y.gen.cont.sp.rho = 0.2, y.gen.cont.sp.dif = 1, intercept.beta = 0, Xgenerator.method = "simstudy", corMatrix = 100, rho = NULL, corstr = NULL, condnumber = 1, mu = 0, muvect = NULL, sd = 1, sdvect = NULL, error.dist = "normal", error.dist.mean = 0, error.dist.sd = 1, error.dist.snr = NULL, error.dist.df = 2, dataframe = TRUE, seed = NULL )fngendata( n, bin.k = 0, bin.prob = NULL, cont.k = 5, y.gen.bin.k = 0, y.gen.bin.beta = NULL, y.gen.bin.prob = NULL, y.gen.cont.beta = c(2, 4, 6, 8, 10), y.gen.cont.mod.k = 0, y.gen.cont.mod.beta = matrix(c(-2, 2), 1, 2, byrow = TRUE), y.gen.bin.mod.prob = c(0.5), y.gen.cont.sp.k = 0, y.gen.cont.sp.groups = 2, y.gen.cont.sp.rho = 0.2, y.gen.cont.sp.dif = 1, intercept.beta = 0, Xgenerator.method = "simstudy", corMatrix = 100, rho = NULL, corstr = NULL, condnumber = 1, mu = 0, muvect = NULL, sd = 1, sdvect = NULL, error.dist = "normal", error.dist.mean = 0, error.dist.sd = 1, error.dist.snr = NULL, error.dist.df = 2, dataframe = TRUE, seed = NULL )
n |
Number of individuals. |
bin.k |
Number of binary variables not used for generating y. |
bin.prob |
A vector of probabilities with length equal to |
cont.k |
Number of continuous variables not used for generating y. |
y.gen.bin.k |
Number of binary variables used for generating y. |
y.gen.bin.beta |
A vector of coefficients with length equal to
|
y.gen.bin.prob |
A vector of probabilities with length equal
to |
y.gen.cont.beta |
A vector of coefficients with length equal to
|
y.gen.cont.mod.k |
Experimental |
y.gen.cont.mod.beta |
Experimental |
y.gen.bin.mod.prob |
Experimental |
y.gen.cont.sp.k |
Experimental |
y.gen.cont.sp.groups |
Experimental |
y.gen.cont.sp.rho |
Experimental |
y.gen.cont.sp.dif |
Experimental |
intercept.beta |
Value for the constant used to generate y. |
Xgenerator.method |
Method used to generate X data ( |
corMatrix |
A positive number for alphad
(see |
rho |
Correlation coefficient, |
corstr |
correlation structure ( |
condnumber |
A value for the condition number of the X matrix to be used
when |
mu |
The mean of the variables. To be used when all variables have the same mean. |
muvect |
A vector of means. To be used when variables have different
means. The length of |
sd |
Standard deviation of the variables. To be used when all variables have the same standard deviation. |
sdvect |
A vector of standard deviations. To be used when variables have
different standard deviations. The length of |
error.dist |
Distribution of the error. |
error.dist.mean |
Mean value used when |
error.dist.sd |
Standard deviation value used when |
error.dist.snr |
Signal to noise ratio. If not |
error.dist.df |
Degrees of freedom used when |
dataframe |
Logical. If |
seed |
A seed for reproducibility. |
A data.frame or a list composed of a matrix of
independent variables values (X), a vector of the dependent variable values
(y), a vector of coefficient values (coefficients), a vector of non-zero
coefficients (y.coefficients), and a vector of the error values (epsilon).
Jorge Cabral, [email protected]
dataThesis <- fngendata( n = 75, cont.k = 1, y.gen.cont.beta = c(-16, -12, -5), intercept.beta = -4, Xgenerator.method = "svd", condnumber = 200, mu = 0, sd = 1, error.dist = "normal", error.dist.mean = 0, error.dist.snr = 5, dataframe = TRUE, seed = 230687) summary(dataThesis)dataThesis <- fngendata( n = 75, cont.k = 1, y.gen.cont.beta = c(-16, -12, -5), intercept.beta = -4, Xgenerator.method = "svd", condnumber = 200, mu = 0, sd = 1, error.dist = "normal", error.dist.mean = 0, error.dist.snr = 5, dataframe = TRUE, seed = 230687) summary(dataThesis)
lmgce objectReturns the model used to fit lmgce object.
## S3 method for class 'lmgce' formula(x, ...)## S3 method for class 'lmgce' formula(x, ...)
x |
fitted |
... |
additional arguments. |
An object of class formula representing the model formula.
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) formula(res_gce_package)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) formula(res_gce_package)
This generic function fits a linear regression model via generalized cross entropy. Initial support spaces can be provided or computed.
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.ridge.lambda = NULL, support.method.ridge.lambda.min = 10^-3, support.method.ridge.lambda.max = 10^3, support.method.ridge.lambda.n = 100, support.method.ridge.standardize = TRUE, support.method.ridge.penalize.intercept = TRUE, support.method.ridge.symm = TRUE, support.method.ridge.maxresid = 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", "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 )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.ridge.lambda = NULL, support.method.ridge.lambda.min = 10^-3, support.method.ridge.lambda.max = 10^3, support.method.ridge.lambda.n = 100, support.method.ridge.standardize = TRUE, support.method.ridge.penalize.intercept = TRUE, support.method.ridge.symm = TRUE, support.method.ridge.maxresid = 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", "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 )
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.ridge.lambda |
Ridge parameter. The default is
|
support.method.ridge.lambda.min |
Minimum value for the
|
support.method.ridge.lambda.max |
Maximum value for the
|
support.method.ridge.lambda.n |
The number of ridge parameters values.
The default is |
support.method.ridge.standardize |
Boolean value. If |
support.method.ridge.penalize.intercept |
Boolean value. if |
support.method.ridge.symm |
Boolean value. If |
support.method.ridge.maxresid |
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 |
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.
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. |
Jorge Cabral, [email protected]
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
summary.lmgce for more detailed summaries.
The generic functions plot.lmgce, print.lmgce,
coef.lmgce and confint.lmgce.
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) res_gce_packageres_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) res_gce_package
lmgce
or cv.lmgce analysisSelect data and choose the arguments to be used. The execution of the code is also possible within the addin.
lmgceAddin()lmgceAddin()
An addin for lmgce and cv.lmgce
The code to be use in the lmgce analysis.
lmgceAddin()lmgceAddin()
lmgce Shiny applicationA Shiny application to execute lmgce
lmgceAPP()lmgceAPP()
NULL. This function is called for its side effect
(launching the app).
Jorge Cabral, [email protected]
lmgce objectReturns the design matrix used to fit lmgce object.
## S3 method for class 'lmgce' model.matrix(object, ...)## S3 method for class 'lmgce' model.matrix(object, ...)
object |
fitted |
... |
additional arguments. |
A numeric matrix with one row for each observation and one column for each parameter in the model.
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) model.matrix(res_gce_package)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) model.matrix(res_gce_package)
Mozambique's CO2, GDP, EPC e EUS time series (1991-2014) from https://databank.worldbank.org/ (Downloaded in 2024/12/03).
moz_tsmoz_ts
A ts object containing:
Year to which data refers
CO2 emissions (metric tons per capita); Data from: IDA Results Measurement System, Tier I Database – WDI;
Electric power consumption (kWh per capita). Data from database: Jobs;
Energy use (kg of oil equivalent per capita). Data from database: World Development Indicators;
Gross domestic product per capita (current US$); Data from: World Development Indicators.
data(moz_ts) plot(moz_ts)data(moz_ts) plot(moz_ts)
Computes the estimates for the Normalized Entropy Aggregation
neagging( object, boot.B = ifelse(object$boot.B == 0, 100, object$boot.B), boot.method = object$boot.method, error = object$error )neagging( object, boot.B = ifelse(object$boot.B == 0, 100, object$boot.B), boot.method = object$boot.method, error = object$error )
object |
|
boot.B |
To use with a |
boot.method |
To use with a |
error |
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
|
An object of class neagging is a list containing
at least the following components:
matrix |
a matrix where each column contains sequentially the aggregated estimates. |
error |
a named vector with the in sample error for each aggregated set of estimates. |
error.object |
the in sample error of the |
coefficients |
the aggregated coefficients that produced the lowest in sample error. |
coefficients.object |
the coefficients of the |
Jorge Cabral, [email protected]
da Conceição Costa, M. and Macedo, P. (2019). Normalized Entropy Aggregation for Inhomogeneous Large-Scale Data. In O. Valenzuela, F. Rojas, H. Pomares, & I. Rojas (Eds.), Theory and Applications of Time Series Analysis (pp. 19–29). Springer International Publishing. doi:10.1007/978-3-030-26036-1_2
The generic functions plot.neagging and
coef.neagging.
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) res_neagging <- neagging(res_gce_package, boot.method = "cases") res_neagging res.tsbootgce <- tsbootgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) neagging(res.tsbootgce)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) res_neagging <- neagging(res_gce_package, boot.method = "cases") res_neagging res.tsbootgce <- tsbootgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) neagging(res.tsbootgce)
lmgce model fitExtract the number of ‘observations’ from a lmgce model fit.
## S3 method for class 'lmgce' nobs(object, ...)## S3 method for class 'lmgce' nobs(object, ...)
object |
Fitted |
... |
additional arguments. |
An integer scalar representing the number of observations (rows) used
in fitting the lmgce model object.
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) nobs(res_gce_package)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) nobs(res_gce_package)
Returns the normalized entropy of the model or the normalized entropy of the predictors.
NormEnt(object, model = TRUE, parm)NormEnt(object, model = TRUE, parm)
object |
|
model |
Boolean value. If |
parm |
a specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered. |
the value of the normalized entropy of the model or parameters.
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) NormEnt(res_gce_package)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) NormEnt(res_gce_package)
cv.lmgce ObjectTwo plots (selectable by which) are currently available to
evaluate a cv.lmgce object. The plots depicts the error change
with the combination of different arguments of cv.lmgce and
also the best combination.
## S3 method for class 'cv.lmgce' plot(x, which = c(1, 2), ncol = 1, scales = "free", ...)## S3 method for class 'cv.lmgce' plot(x, which = c(1, 2), ncol = 1, scales = "free", ...)
x |
Fitted |
which |
A subset of the numbers 1:2. |
ncol |
Number of columns of the plot (see
|
scales |
One of c("free", "fixed") (see
|
... |
additional arguments. |
A list of ggplot objects.
Jorge Cabral, [email protected]
cv.tsbootgce objectFour plots (selectable by which) are currently available to
evaluate a cv.tsbootgce object.
## S3 method for class 'cv.tsbootgce' plot( x, which = c(1, 2), group = TRUE, group.ncol = NULL, group.nrow = NULL, ci.levels = c(0.9, 0.95, 0.99), ci.method = c("hdr", "basic", "percentile"), seed = object$seed, lambda = 1, col = NULL, plot.lines = TRUE, legend.position = "bottom", ... )## S3 method for class 'cv.tsbootgce' plot( x, which = c(1, 2), group = TRUE, group.ncol = NULL, group.nrow = NULL, ci.levels = c(0.9, 0.95, 0.99), ci.method = c("hdr", "basic", "percentile"), seed = object$seed, lambda = 1, col = NULL, plot.lines = TRUE, legend.position = "bottom", ... )
x |
Fitted |
which |
Integers from 1 to 4. The default is |
group |
Boolean value. If |
group.ncol |
Number of columns (see |
group.nrow |
Number of rows. (see |
ci.levels |
the confidence levels (maximum of 4) required to compute the
confidence interval. The default is |
ci.method |
One of |
seed |
A single value, interpreted as an integer, for reproducibility
or |
lambda |
Box-Cox transformation parameter. Value between 0 and 1. The
default is |
col |
Vector of colors for regions. The default is |
plot.lines |
Boolean. The default is |
legend.position |
The default is |
... |
additional arguments. |
A ggplot object.
Jorge Cabral, [email protected]
lmgce ObjectSeven plots (selectable by which) are currently available to
evaluate a lmgce object: a plot of the Estimates and confidence
intervals; four plots of supports against Prediction Error, Estimates,
Normalized Entropy and Precision Error; two plots of GCE reestimation against
Prediction and Precision Errors. Note that plots regarding Precision Error
are only produced if the argument coef is not NULL.
## S3 method for class 'lmgce' plot( x, type = c("ggplot2", "plotly"), which = 1:7, ci.level = 0.95, ci.method = c("z", "percentile", "basic"), boot.B = ifelse(x$boot.B == 0, 100, x$boot.B), boot.method = x$boot.method, coef = NULL, OLS = TRUE, NormEnt = TRUE, caption = list(paste0("Estimates (", ci.method[1], " ", ci.level * 100, "% CI)"), "Prediction Error vs supports", "Estimates vs supports", "Normalized Entropy vs supports", "Precision Error vs supports", "Prediction Error vs GCE reestimation", "Precision Error vs GCE reestimation"), ... )## S3 method for class 'lmgce' plot( x, type = c("ggplot2", "plotly"), which = 1:7, ci.level = 0.95, ci.method = c("z", "percentile", "basic"), boot.B = ifelse(x$boot.B == 0, 100, x$boot.B), boot.method = x$boot.method, coef = NULL, OLS = TRUE, NormEnt = TRUE, caption = list(paste0("Estimates (", ci.method[1], " ", ci.level * 100, "% CI)"), "Prediction Error vs supports", "Estimates vs supports", "Normalized Entropy vs supports", "Precision Error vs supports", "Prediction Error vs GCE reestimation", "Precision Error vs GCE reestimation"), ... )
x |
Fitted |
type |
One of |
which |
A subset of the numbers 1:7. |
ci.level |
the confidence level (0,1) required to compute the confidence interval. |
ci.method |
the method used to compute the confidence interval. One of
c("z","percentile", "basic"). The default is |
boot.B |
A single positive integer greater or equal to 10 for the number
of bootstrap replicates for the computation of the bootstrap confidence
interval(s), to be used when |
boot.method |
Method used for bootstrapping. One of
|
coef |
A vector of true coefficients to be used when
|
OLS |
Boolean value. if |
NormEnt |
Boolean value. if |
caption |
Captions to appear above the plots;
|
... |
additional arguments. |
A named list of ggplot or plotly objects, each
representing a separate plot.
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) plot(res_gce_package)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) plot(res_gce_package)
neagging ObjectTwo plots (selectable by which) are currently available to
evaluate a neagging object: plots of the estimates and in
sample error against the number of bootstrap samples aggregated.
## S3 method for class 'neagging' plot(x, which = 1, ...)## S3 method for class 'neagging' plot(x, which = 1, ...)
x |
Fitted |
which |
Numbers 1 or 2. |
... |
additional arguments. |
A ggplot object.
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) res_neagging <- neagging(res_gce_package) plot(res_neagging)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) res_neagging <- neagging(res_gce_package) plot(res_neagging)
ridgetrace ObjectPlot Diagnostics for a ridgetrace Object
## S3 method for class 'ridgetrace' plot(x, coef = NULL, log = TRUE, range = TRUE, ...)## S3 method for class 'ridgetrace' plot(x, coef = NULL, log = TRUE, range = TRUE, ...)
x |
Fitted |
coef |
A vector of true coefficients if available. |
log |
Boolean. If |
range |
Boolean. If |
... |
additional arguments. |
Supports are returned.
Jorge Cabral, [email protected]
res.ridgetrace <- ridgetrace( formula = y ~ X001 + X002 + X003 + X004, data = dataThesis)
plot(res.ridgetrace)
tsbootgce objectFour plots (selectable by which) are currently available to
evaluate a tsbootgce object.
## S3 method for class 'tsbootgce' plot( x, which = c(1, 2), group = TRUE, group.ncol = NULL, group.nrow = NULL, ci.levels = c(0.9, 0.95, 0.99), ci.method = c("hdr", "basic", "percentile"), seed = object$seed, lambda = 1, col = NULL, plot.lines = TRUE, legend.position = "bottom", ... )## S3 method for class 'tsbootgce' plot( x, which = c(1, 2), group = TRUE, group.ncol = NULL, group.nrow = NULL, ci.levels = c(0.9, 0.95, 0.99), ci.method = c("hdr", "basic", "percentile"), seed = object$seed, lambda = 1, col = NULL, plot.lines = TRUE, legend.position = "bottom", ... )
x |
Fitted |
which |
Integers from 1 to 4. The default is |
group |
Boolean value. If |
group.ncol |
Number of columns (see |
group.nrow |
Number of rows. (see |
ci.levels |
the confidence levels (maximum of 4) required to compute the
confidence interval. The default is |
ci.method |
One of |
seed |
A single value, interpreted as an integer, for reproducibility
or |
lambda |
Box-Cox transformation parameter. Value between 0 and 1. The
default is |
col |
Vector of colors for regions. The default is |
plot.lines |
Boolean. The default is |
legend.position |
The default is |
... |
additional arguments. |
A ggplot object.
Jorge Cabral, [email protected]
res.tsbootgce <- tsbootgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) plot(res.tsbootgce, which = 2, group = TRUE)res.tsbootgce <- tsbootgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) plot(res.tsbootgce, which = 2, group = TRUE)
lmgce Linear Model FitsPredicted values based on a fitted model lmgce object.
## S3 method for class 'lmgce' predict( object, newdata, interval = c("none", "confidence"), type = c("response", "terms"), level = 0.95, terms = NULL, na.action = na.pass, ... )## S3 method for class 'lmgce' predict( object, newdata, interval = c("none", "confidence"), type = c("response", "terms"), level = 0.95, terms = NULL, na.action = na.pass, ... )
object |
Fitted |
newdata |
An optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used. |
interval |
One of |
type |
One of |
level |
Tolerance/confidence level (0,1). |
terms |
if |
na.action |
function determining what should be done with missing values
in |
... |
additional arguments. |
predict.lmgce produces a vector of predictions.
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) predict(res_gce_package, dataThesis)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) predict(res_gce_package, dataThesis)
cv.lmgce objectPrint cv.lmgce object
## S3 method for class 'cv.lmgce' print(x, digits = max(3L, getOption("digits") - 3L), ...)## S3 method for class 'cv.lmgce' print(x, digits = max(3L, getOption("digits") - 3L), ...)
x |
fitted |
digits |
significant digits in printout. |
... |
additional print arguments. |
A small summary of a cv.lmgce object is returned.
Jorge Cabral, [email protected]
cv.tsbootgce objectPrint cv.tsbootgce object
## S3 method for class 'cv.tsbootgce' print(x, digits = max(3L, getOption("digits") - 3L), ...)## S3 method for class 'cv.tsbootgce' print(x, digits = max(3L, getOption("digits") - 3L), ...)
x |
fitted |
digits |
significant digits in printout. |
... |
additional print arguments. |
A small summary of a tsbootgce object is returned.
Jorge Cabral, [email protected]
lmgce objectConcise summary of a lmgce object
## S3 method for class 'lmgce' print(x, digits = max(3L, getOption("digits") - 3L), ...)## S3 method for class 'lmgce' print(x, digits = max(3L, getOption("digits") - 3L), ...)
x |
fitted |
digits |
significant digits in printout. |
... |
additional print arguments. |
A small summary of a lmgce object is returned.
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) res_gce_packageres_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) res_gce_package
ridgetrace objectConcise summary of a ridgetrace object
## S3 method for class 'ridgetrace' print(x, digits = max(3L, getOption("digits") - 3L), ...)## S3 method for class 'ridgetrace' print(x, digits = max(3L, getOption("digits") - 3L), ...)
x |
fitted |
digits |
significant digits in printout. |
... |
additional print arguments. |
A small summary of a ridgetrace object is returned.
Jorge Cabral, [email protected]
res.ridgetrace <- ridgetrace( formula = y ~ X001 + X002 + X003 + X004, data = dataThesis) res.ridgetraceres.ridgetrace <- ridgetrace( formula = y ~ X001 + X002 + X003 + X004, data = dataThesis) res.ridgetrace
lmgce Model Fitsprint.summary method for class lmgce.
## S3 method for class 'summary.lmgce' print( x, digits = max(3L, getOption("digits") - 3L), symbolic.cor = x$symbolic.cor, signif.stars = getOption("show.signif.stars"), ... )## S3 method for class 'summary.lmgce' print( x, digits = max(3L, getOption("digits") - 3L), symbolic.cor = x$symbolic.cor, signif.stars = getOption("show.signif.stars"), ... )
x |
an object of class |
digits |
The number of significant digits to use when printing. |
symbolic.cor |
Boolean value. if |
signif.stars |
Boolean value. if |
... |
Further arguments passed to or from other methods. |
The function print.summary.lmgce prints the information in a
summary.lmgce object.
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) summary(res_gce_package) summary(res_gce_package, ci.level = 0.90, ci.method = "basic")res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) summary(res_gce_package) summary(res_gce_package, ci.level = 0.90, ci.method = "basic")
tsbootgce objectPrint tsbootgce object
## S3 method for class 'tsbootgce' print(x, digits = max(3L, getOption("digits") - 3L), ...)## S3 method for class 'tsbootgce' print(x, digits = max(3L, getOption("digits") - 3L), ...)
x |
fitted |
digits |
significant digits in printout. |
... |
additional print arguments. |
A small summary of a tsbootgce object is returned.
Jorge Cabral, [email protected]
res.tsbootgce <- tsbootgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) res.tsbootgceres.tsbootgce <- tsbootgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) res.tsbootgce
An example of an object of class 'lmgce' used for demonstration.
res_gce_packageres_gce_package
An object of class '"lmgce"'.
generated by the package.
lmgce Model Residualsresid is a function which extracts model residuals from
lmgce objects.
## S3 method for class 'lmgce' resid(object, ...)## S3 method for class 'lmgce' resid(object, ...)
object |
Fitted |
... |
additional arguments. |
Returns the residuals from a lmgce object
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) resid(res_gce_package)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) resid(res_gce_package)
lmgce Model Residualsresiduals is a function which extracts model residuals from
lmgce objects.
The abbreviated form resid is an alias for residuals.
## S3 method for class 'lmgce' residuals(object, ...)## S3 method for class 'lmgce' residuals(object, ...)
object |
Fitted |
... |
additional arguments. |
Returns the residuals from a lmgce object
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) residuals(res_gce_package)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) residuals(res_gce_package)
Function to obtain the ridge trace and choose the support limits given a formula
ridgetrace( formula, data, subset, na.action, offset, contrasts = NULL, lambda = NULL, lambda.min = 10^-3, lambda.max = 10^3, lambda.n = 100, standardize = TRUE, penalize.intercept = TRUE, errormeasure = c("RMSE", "MSE", "MAE", "MAPE", "sMAPE", "MASE"), cv = TRUE, cv.nfolds = 5, seed = 230676 )ridgetrace( formula, data, subset, na.action, offset, contrasts = NULL, lambda = NULL, lambda.min = 10^-3, lambda.max = 10^3, lambda.n = 100, standardize = TRUE, penalize.intercept = TRUE, errormeasure = c("RMSE", "MSE", "MAE", "MAPE", "sMAPE", "MASE"), cv = TRUE, cv.nfolds = 5, seed = 230676 )
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 |
lambda |
Ridge parameter. The default is |
lambda.min |
Minimum value for the |
lambda.max |
Maximum value for the |
lambda.n |
The number of lambda values. The default is
|
standardize |
Boolean value. If |
penalize.intercept |
Boolean value. If |
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
|
cv |
Boolean value. If |
cv.nfolds |
number of folds used for cross-validation when
|
seed |
A single value, interpreted as an integer, for reproducibility
or |
An object of class ridgetrace is a list
containing at least the following components:
lambda |
the lambda sequence used |
min.coef |
a named vector of coefficients (minimum coefficients) |
max.coef |
a named vector of coefficients (maximum coefficients) |
max.abs.coef |
a named vector of coefficients (maximum absolute coefficients) |
max.abs.residual |
the maximum absolute residual |
coef.lambda |
a data.frame with the coefficients for each lambda tested |
coef.lambda.cv |
a list of length |
error.lambda |
a vector with the in sample error |
error.lambda.cv |
a data.frame with cross-validation errors |
call |
the matched call |
Jorge Cabral, [email protected]
res.ridgetrace <- ridgetrace( formula = y ~ X001 + X002 + X003 + X004, data = dataThesis) res.ridgetraceres.ridgetrace <- ridgetrace( formula = y ~ X001 + X002 + X003 + X004, data = dataThesis) res.ridgetrace
Given a vector of scaled (standardized) regression coefficients the function returns the unscaled (in the original scale) regression coefficients
scalebackcoef(X.scaled, y.scaled, betas.scaled, intercept = TRUE)scalebackcoef(X.scaled, y.scaled, betas.scaled, intercept = TRUE)
X.scaled |
A matrix scaled with |
y.scaled |
A vector scaled with |
betas.scaled |
A vector of given scaled coefficients. |
intercept |
logical indicating if intercept is to be calculated |
Returns a vector of unscaled numeric regression coefficients.
Jorge Cabral, [email protected]
summary method for class lmgce. Function used to produce
summary information from a fitted linear regression model via generalized
cross entropy as represented by object of class lmgce.
## S3 method for class 'lmgce' summary( object, call = TRUE, correlation = FALSE, symbolic.cor = FALSE, ci.level = NULL, ci.method = c("z", "percentile", "basic"), boot.B = ifelse(object$boot.B == 0, 100, object$boot.B), boot.method = object$boot.method, ... )## S3 method for class 'lmgce' summary( object, call = TRUE, correlation = FALSE, symbolic.cor = FALSE, ci.level = NULL, ci.method = c("z", "percentile", "basic"), boot.B = ifelse(object$boot.B == 0, 100, object$boot.B), boot.method = object$boot.method, ... )
object |
Fitted |
call |
Boolean value. if |
correlation |
Boolean value. if |
symbolic.cor |
Boolean value. if |
ci.level |
the confidence level (0,1) required to compute the confidence
interval. The default is |
ci.method |
method used to compute a confidence interval. One of
c("z","percentile", "basic"). The default is |
boot.B |
A single positive integer greater or equal to 10 for the number
of bootstrap replicates for the computation of the bootstrap confidence
interval(s), to be used when |
boot.method |
Method used for bootstrapping. One of
|
... |
additional arguments. |
The function summary.lmgce computes and returns a list of
summary statistics of the fitted lmgce linear model given in
object, using the components (list elements) "call" and "terms" from
its argument, plus
residuals |
the residuals, that is response minus fitted values. |
coefficients |
a |
support |
a |
aliased |
named logical vector showing if the original coefficients are aliased. |
sigma |
the square root of the estimated variance of the random error. |
df |
degrees of freedom, a 3-vector |
r.squared |
|
adj.r.squared |
the above |
cov.unscaled |
a |
support.stdUL |
when applicable, the upper limit of the standardized
support chosen, when |
support.method |
method chosen for the support's limits |
nep |
the normalized entropy of the model. |
nep.cv.mean |
the cross-validation normalized entropy of the model. |
nep.cv.sd |
the standard deviation of the cross-validation normalized entropy of the model. |
error |
the error measure chosen |
error.which |
which criterion/standardized/factor support was used |
error.measure |
the value of the error measure |
error.measure.cv.mean |
the cross-validation value of the error measure |
error.measure.cv.sd |
the standard deviation of the cross-validation value of the error measure |
correlation |
the correlation matrix corresponding to the above
cov.unscaled, if |
symbolic.cor |
(only if |
na.action |
from object, if present there. |
ci.method |
method used to compute a confidence interval |
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) sm_res_gce_package <- summary(res_gce_package) str(sm_res_gce_package) sm_res_gce_package$coefficientsres_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) sm_res_gce_package <- summary(res_gce_package) str(sm_res_gce_package) sm_res_gce_package$coefficients
This generic function fits a linear regression model using bootstrapped time series via generalized cross entropy.
tsbootgce( formula, data, subset, na.action, offset, contrasts = NULL, trim = 0.05, reps = 1000, start = NULL, end = NULL, coef.method = c("median", "mode"), 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.ridge.lambda = NULL, support.method.ridge.lambda.min = 10^-3, support.method.ridge.lambda.max = 10^3, support.method.ridge.lambda.n = 100, support.method.ridge.standardize = TRUE, support.method.ridge.penalize.intercept = TRUE, support.method.ridge.symm = TRUE, support.method.ridge.maxresid = 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", "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 )tsbootgce( formula, data, subset, na.action, offset, contrasts = NULL, trim = 0.05, reps = 1000, start = NULL, end = NULL, coef.method = c("median", "mode"), 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.ridge.lambda = NULL, support.method.ridge.lambda.min = 10^-3, support.method.ridge.lambda.max = 10^3, support.method.ridge.lambda.n = 100, support.method.ridge.standardize = TRUE, support.method.ridge.penalize.intercept = TRUE, support.method.ridge.symm = TRUE, support.method.ridge.maxresid = 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", "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 )
formula |
a "formula" describing the linear model to be fit. For details
see |
data |
A |
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 |
trim |
The trimming proportion (see |
reps |
The number of replicates to generate (see
|
start |
The time of the first observation. Either a single number
or a vector of two numbers (the second of which is an integer), which
specify a natural time unit and a (1-based) number of samples into the time
unit (see |
end |
The time of the last observation, specified in the same way as
|
coef.method |
Method used to estimate the coefficients. One of
|
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.ridge.lambda |
Ridge parameter. The default is
|
support.method.ridge.lambda.min |
Minimum value for the
|
support.method.ridge.lambda.max |
Maximum value for the
|
support.method.ridge.lambda.n |
The number of ridge parameters values.
The default is |
support.method.ridge.standardize |
Boolean value. If |
support.method.ridge.penalize.intercept |
Boolean value. if |
support.method.ridge.symm |
Boolean value. If |
support.method.ridge.maxresid |
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 |
The tsbootgce function fits several linear regression models via
generalized cross entropy in replicas of time series obtained using
meboot. Models for tsbootgce are
specified symbolically (see lm and
dynlm).
tsbootgce returns an object of class
tsbootgce. The generic accessory functions
coef.tsbootgce, confint.tsbootgce and
plot.tsbootgce extract various useful features of the value
returned by object of class tsbootgce.
An object of class tsbootgce is a list
containing at least the following components:
call |
the matched call. |
coefficients |
a named data frame of coefficients determined by
|
data.ts |
|
error |
loss function (error) used for the selection of the support spaces. |
error.measure |
in sample error for the selected support space. |
fitted.values |
the fitted mean values. |
frequency |
see |
index |
see |
lmgce |
|
meboot |
|
model |
the model frame used. |
nep |
normalized entropy of the signal of the model. |
nepk |
normalized entropy of the signal of each coefficient. |
residuals |
the residuals, that is response minus fitted values. |
results |
a list containing the bootstrap results: "coef.matrix", a named data frame of all the coefficients; "nepk.matrix", a named data frame of all the normalized entropy values of each parameter; "nep.vector", a vector of all the normalized entropy values of the model. |
seed |
the seed used. |
terms |
the |
x |
if requested (the default), the model matrix used. |
xlevels |
(only where relevant) a record of the levels of the factors used in fitting. |
y |
if requested (the default), the response used. |
Jorge Cabral, [email protected]
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
Hyndman, R.J. (1996)
Computing and graphing highest density regions.
American Statistician, 50, 120-126.
doi:10.2307/2684423
Pukelsheim, F. (1994)
The Three Sigma Rule.
The American Statistician, 48(2), 88–91.
doi:10.2307/2684253
Vinod, H. D., & Lopez-de-Lacalle, J. (2009). Maximum Entropy Bootstrap for Time Series: The meboot R Package. Journal of Statistical Software, 29(5), 1–19. doi:10.18637/jss.v029.i05
The generic functions plot.tsbootgce,
print.tsbootgce, and coef.tsbootgce.
res.tsbootgce <- tsbootgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) res.tsbootgceres.tsbootgce <- tsbootgce( formula = CO2 ~ 1 + L(EPC, 1) + L(EUS, 2) + L(GDP, 0), data = moz_ts) res.tsbootgce
lmgce Fitted ModelsSimple utility returning variable names.
## S3 method for class 'lmgce' variable.names(object, ...)## S3 method for class 'lmgce' variable.names(object, ...)
object |
Fitted |
... |
additional arguments. |
A character vector containing the names of the variables in the
lmgce model object.
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) variable.names(res_gce_package)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) variable.names(res_gce_package)
lmgce Model's Variance-Covariance MatrixReturns the variance-covariance matrix of the main parameters of a
lmgce object
## S3 method for class 'lmgce' vcov(object, ...)## S3 method for class 'lmgce' vcov(object, ...)
object |
Fitted |
... |
additional arguments. |
A matrix of the estimated covariances between the parameter estimates
in the linear predictor of the lmgce model.
Jorge Cabral, [email protected]
res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) vcov(res_gce_package)res_gce_package <- lmgce(y ~ ., data = dataThesis, twosteps.n = 1, boot.B = 100, seed = 230676) vcov(res_gce_package)