fitTsfm.control: List of control parameters for 'fitTsfm'

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Creates a list of control parameters for fitTsfm. All control parameters that are not passed to this function are set to default values. This function is meant for internal use only!!

Usage

1
2
3
4
5
6
fitTsfm.control(decay = 0.95, weights, model = TRUE, x = FALSE,
  y = FALSE, qr = TRUE, nrep = NULL, efficiency = 0.9, mxr = 50,
  mxf = 50, mxs = 50, scope, scale, direction, trace = FALSE,
  steps = 1000, k = 2, nvmin = 1, nvmax = 8, force.in = NULL,
  force.out = NULL, method, really.big = FALSE, type, normalize = TRUE,
  eps = .Machine$double.eps, max.steps, lars.criterion = "Cp", K = 10)

Arguments

decay

a scalar in (0, 1] to specify the decay factor for "DLS". Default is 0.95.

weights

an optional vector of weights to be used in the fitting process for fit.method="LS","Robust", or variable.selection="subsets". Should be NULL or a numeric vector. The length of weights must be the same as the number of observations. The weights must be nonnegative and it is strongly recommended that they be strictly positive.

model,x,y,qr

logicals passed to lm for fit.method="LS". If TRUE the corresponding components of the fit (the model frame, the model matrix, the response, the QR decomposition) are returned.

nrep

the number of random subsamples to be drawn for fit.method="Robust". If the data set is small and "Exhaustive" resampling is being used, the value of nrep is ignored.

efficiency

the asymptotic efficiency of the final estimate for fit.method="Robust". Default is 0.9.

mxr

the maximum number of iterations in the refinement step. Default is 50.

mxf

the maximum number of iterations for computing final coefficient estimates. Default is 50.

mxs

the maximum number of iterations for computing scale estimate. Default is 50.

scope

defines the range of models examined in the "stepwise" search. This should be either a single formula, or a list containing components upper and lower, both formulae. See step for how to specify the formulae and usage.

scale

optional parameter for variable.selection="stepwise". The argument is passed to step or step.lmRob as appropriate.

direction

the mode of "stepwise" search, can be one of "both", "backward", or "forward", with a default of "both". If the scope argument is missing the default for direction is "backward".

trace

If positive (or, not FALSE), info is printed during the running of lmRob, step, step.lmRob, lars or cv.lars as relevant. Larger values may give more detailed information. Default is FALSE.

steps

the maximum number of steps to be considered for "stepwise". Default is 1000 (essentially as many as required). It is typically used to stop the process early.

k

the multiple of the number of degrees of freedom used for the penalty in "stepwise". Only k = 2 gives the genuine AIC. k = log(n) is sometimes referred to as BIC or SBC. Default is 2.

nvmin

minimum size of subsets to examine for "subsets". Default is 1.

nvmax

maximum size of subsets to examine for "subsets". Default is 8.

force.in

index to columns of design matrix that should be in all models for "subsets". Default is NULL.

force.out

index to columns of design matrix that should be in no models for "subsets". Default is NULL.

method

one of "exhaustive", "forward", "backward" or "seqrep" (sequential replacement) to specify the type of subset search/selection. Required if variable selection="subsets" is chosen. Default is "exhaustive".

really.big

option for "subsets"; Must be TRUE to perform exhaustive search on more than 50 variables.

type

option for "lars". One of "lasso", "lar", "forward.stagewise" or "stepwise". The names can be abbreviated to any unique substring. Default is "lasso".

normalize

option for "lars". If TRUE, each variable is standardized to have unit L2 norm, otherwise they are left alone. Default is TRUE.

eps

option for "lars"; An effective zero.

max.steps

Limit the number of steps taken for "lars"; the default is 8 * min(m, n-intercept), with m the number of variables, and n the number of samples. For type="lar" or type="stepwise", the maximum number of steps is min(m,n-intercept). For type="lasso" and especially type="forward.stagewise", there can be many more terms, because although no more than min(m,n-intercept) variables can be active during any step, variables are frequently droppped and added as the algorithm proceeds. Although the default usually guarantees that the algorithm has proceeded to the saturated fit, users should check.

lars.criterion

an option to assess model selection for the "lars" method; one of "Cp" or "cv". See details. Default is "Cp".

K

number of folds for computing the K-fold cross-validated mean squared prediction error for "lars". Default is 10.

Details

This control function is used to process optional arguments passed via ... to fitTsfm. These arguments are validated and defaults are set if necessary before being passed internally to one of the following functions: lm, lmRob, step, regsubsets, lars and cv.lars. See their respective help files for more details. The arguments to each of these functions are listed above in approximately the same order for user convenience.

The scalar decay is used by fitTsfm to compute exponentially decaying weights for fit.method="DLS". Alternately, one can directly specify weights, a weights vector, to be used with "LS" or "Robust". Especially when fitting multiple assets, care should be taken to ensure that the length of the weights vector matches the number of observations (excluding cases ignored due to NAs).

lars.criterion selects the criterion (one of "Cp" or "cv") to determine the best fitted model for variable.selection="lars". The "Cp" statistic (defined in page 17 of Efron et al. (2004)) is calculated using summary.lars. While, "cv" computes the K-fold cross-validated mean squared prediction error using cv.lars.

Value

A list of the above components. This is only meant to be used by fitTsfm.

Author(s)

Sangeetha Srinivasan

References

Efron, B., Hastie, T., Johnstone, I., & Tibshirani, R. (2004). Least angle regression. The Annals of statistics, 32(2), 407-499.

See Also

fitTsfm, lm, lmRob, step, regsubsets, lars and cv.lars

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# check argument list passed by fitTsfm.control
tsfm.ctrl <- fitTsfm.control(method="exhaustive", nvmin=2)
print(tsfm.ctrl)

## End(Not run)

# used internally by fitTsfm in the example below
data(managers)
fit <- fitTsfm(asset.names=colnames(managers[,(1:6)]),
               factor.names=colnames(managers[,(7:9)]),
               data=managers, variable.selection="subsets",
               method="exhaustive", nvmin=2)

arorar/FactorAnalytics documentation built on May 10, 2019, 1:47 p.m.