FMA: Frequentist Model Averaging

Description Usage Arguments Details Value See Also Examples

Description

Frequentist model averaging using smoothed AIC, smoothed BIC, Mallow's model averaging or Jackknife model averaging.

Usage

1
2
FMA(weighting.method, allMods, X, y, submodels, 
    include.intercept = 1, solver = "solve.QP")

Arguments

weighting.method

One of "AIC" (for smoothed AIC), "BIC" (for smoothed BIC), "MMA" (for Mallow's model averaging) and "JMA" (for Jackknife model averaging).

allMods

The list returned by EstAllModels.

X

Matrix of independent variables.

y

Vector of the dependent variable.

submodels

Either one of "all", "singleton" or "nested" (which is then passed to Generate.S), or a custom selection matrix (of appropriate size).

include.intercept

Flag for inclusion of intercept. Default is 1 for inclusion.

solver

The solver to use for quadratic programming. One of "solve.QP" (the default, uses solve.QP), "ipop" (uses ipop) and "LowRankQP" (uses LowRankQP).

Details

Either one must supply the function with the allMods argument, or the raw data and what models to average over. If one gives the function allMods, then only the weighting.method needs to be specified. If allMods is not supplied, then one must give the function the raw data and the selection matrix so that it can call EstAllModels. The first alternative is to be preferred if one will use multiple averaging techniques for the same data. See the examples.

Value

Returns a vector with the weights.

See Also

EstAllModels, Generate.S, solve.QP, ipop, LowRankQP.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## First alternative: supply allMods
## Not run: myAllMods <- EstAllModels(X = Xdata, 
         Xnew = Xnewdata, y = ydata, s = smatrix)
## End(Not run)
## Not run: wAIC <- FMA("AIC", allMods = myAllMods)
## Not run: wJMA <- FMA("JMA", allMods = myAllMods)

## Second alternative: let the function call EstAllModels
## Not run: wAIC <- FMA("AIC", X = Xdata, 
         Xnew = Xnewdata, y = ydata, submodels = "nested")
## End(Not run)
## Not run: wJMA <- FMA("JMA", X = Xdata, 
         Xnew = Xnewdata, y = ydata, submodels = "nested")
## End(Not run)

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