pFSA: pFSA: Pareto Feasible Solution Algorithm

Description Usage Arguments Value Examples

View source: R/pFSA.R

Description

A function using a Feasible Solution Algorithm to estimate a set of models which are on the Pareto frontiers for chosen criteria

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
pFSA(
  numFronts = 2,
  pselExpr = NULL,
  plot.it = TRUE,
  formula,
  data,
  fitfunc = lm,
  fixvar = NULL,
  quad = FALSE,
  m = 2,
  numrs = 1,
  cores = 1,
  interactions = T,
  criterion = AIC,
  minmax = "min",
  checkfeas = NULL,
  var4int = NULL,
  min.nonmissing = 1,
  return.models = FALSE,
  fix.formula = NULL,
  ...
)

Arguments

numFronts

integer number of estimated frontiers to return

pselExpr

expression used by function psel to estimate pareto frontiers. help(psel).

plot.it

TRUE/FALSE for whether to plot the pareto frontiers

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.

data

a data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model.

fitfunc

the method that should be used to fit the model. For Example: lm, glm, or other methods that rely on formula, data, and other inputs.

fixvar

variable(s) to fix in the model. Usually a covariate that should always be included (Example: Age, Sex). Will still consider it with interactions. Default is NULL.

quad

Include quadratic terms or not. Logical.

m

order of terms to include. If interactions is set to TRUE then m is the order of interactions to be considered. For Subset selection (interaction=F), m is the size of the subset to examine. Defaults to 2.

numrs

number of random starts to perform.

cores

number of cores to use while running. Note: Windows can only use 1 core. See mclapply for details. If function detects a Windows user it will automatically set cores=1.

interactions

whether to include interactions in model. Defaults to TRUE.

criterion

which criterion function to either maximize or minimize. For linear models one can use: r.squared, adj.r.squared, cv5.lmFSA (5 Fold Cross Validation error), cv10.lmFSA (10 Fold Cross Validation error), apress (Allen's Press Statistic), int.p.val (Interaction P-value), AIC, BIC.

minmax

whether to minimize or maximize the criterion function

checkfeas

vector of variables that could be a feasible solution. These variables will be used as the last random start.

var4int

specification of which variables to check for marginal feasiblilty. Default is NULL

min.nonmissing

the combination of predictors will be ignored unless this many of observations are not missing

return.models

bool value to specify whether return all the fitted models which have been checked

fix.formula

...

...

see arguments taken by function FSA or other functions. help(FSA).

Value

list of a matrix of all models obtained from FSA (fits) and their criteria. Also a matrix of the estimated frontiers that were requested. The Key column in fits, and pbound refers to the column number of the variables contined in the model fit. For instance, Key="42,96" would refer to the model which contains the variable in the 42nd column and 96th column of the designated dataset.

Examples

1
2
3
4
5
6
7
N <- 1000 #number of obs
P <- 100 #number of variables
data <- data.frame(matrix(rnorm(N*(P+1)), nrow = N, ncol = P+1))
sln <- pFSA(formula = "X101~1", data = data, m = 2,  criterion = c(max_abs_resid,r.squared),
   minmax = c("min","max"),numrs = 10,numFronts = 2,
   pselExpr =rPref::low(max_abs_resid)*rPref::high(r.squared),plot.it = TRUE)
   

rFSA documentation built on July 1, 2020, 10:30 p.m.

Related to pFSA in rFSA...