EstAllModels: Estimate all submodels

Description Usage Arguments Value See Also Examples

View source: R/RcppExports.R

Description

This function estimates all submodels.

Usage

1
EstAllModels(X, Xnew, y, s)

Arguments

X

A design matrix.

Xnew

Design matrix used for predictions.

y

Vector of the response.

s

Matrix where the rows correspond to a submodel.

Value

Returns a list with the following:

SEs

Variances of the submodels.

coefficients

Coefficients from each submodel.

K

The number of included variables in each submodel.

etilde

Matrix of residuals (for MMA). Each column corresponds to residuals from a submodel.

eJMA

The matrix of error terms for JMA. Each column corresponds to jackknife residuals in the submodels.

AIC

The AIC values for the models.

BIC

The BIC values for the models.

preds

The predictions from all submodels.

See Also

Generate.S.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Generate some data
Xdata <- matrix(rnorm(100), 25, 4)
ydata <- matrix(rowSums(Xdata) + rnorm(25), 25, 1)
Xnewdata <- matrix(rnorm(100), 25, 4)

## Get the submodel matrix
smatrix <- Generate.S(Fix.X = 1, Potential.X = 3, avertype = "nested")

## Estimate all submodels
allMods <- EstAllModels(X = Xdata, Xnew = Xnewdata, y = ydata, s = smatrix)

sebastianankargren/FMA documentation built on May 29, 2019, 4:57 p.m.