[Returnanalytics-commits] r2368 - pkg/FactorAnalytics/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 19 02:24:55 CEST 2013


Author: chenyian
Date: 2013-06-19 02:24:55 +0200 (Wed, 19 Jun 2013)
New Revision: 2368

Modified:
   pkg/FactorAnalytics/R/fitMacroeconomicFactorModel.R
Log:
add description: once lar, lasso is chosen. fit.method is ignored.  

Modified: pkg/FactorAnalytics/R/fitMacroeconomicFactorModel.R
===================================================================
--- pkg/FactorAnalytics/R/fitMacroeconomicFactorModel.R	2013-06-19 00:20:36 UTC (rev 2367)
+++ pkg/FactorAnalytics/R/fitMacroeconomicFactorModel.R	2013-06-19 00:24:55 UTC (rev 2368)
@@ -20,11 +20,11 @@
 #' "stepwise" is traditional forward/backward #' stepwise OLS regression, starting from the initial set of factors, that adds
 #' factors only if the regression fit as measured by the Bayesian Information
 #' Criteria (BIC) or Akaike Information Criteria (AIC) can be done using the R
-#' function step() from the stats package. If \code{Robust} is chosen, the
+#' function step() from the stats package. If "Robust" is chosen, the
 #' function step.lmRob in Robust package will be used. "all subsets" is
 #' Traditional all subsets regression can be done using the R function
 #' regsubsets() from the package leaps. "lar" , "lasso" is based on package
-#' "lars", linear angle regression.
+#' "lars", linear angle regression. If "lar" or "lasso" is chose. fit.method will be ignored. 
 #' @param decay.factor for DLS. Default is 0.95.
 #' @param nvmax control option for all subsets. maximum size of subsets to
 #' examine
@@ -331,7 +331,7 @@
 } else if (variable.selection == "lar" | variable.selection == "lasso") {
   # use min Cp as criteria to choose predictors
   
-    for (i in assets.names) {
+  for (i in assets.names) {
  reg.df = na.omit(reg.xts[, c(i, factors.names)])
  reg.df = as.matrix(reg.df)
  lars.fit = lars(reg.df[,factors.names],reg.df[,i],type=variable.selection,trace=FALSE)



More information about the Returnanalytics-commits mailing list