[Returnanalytics-commits] r3641 - in pkg/FactorAnalytics: . R man tests vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Apr 26 07:56:47 CEST 2015


Author: pragnya
Date: 2015-04-26 07:56:44 +0200 (Sun, 26 Apr 2015)
New Revision: 3641

Added:
   pkg/FactorAnalytics/tests/FactorAnalytics_04_25_15.pdf
Removed:
   pkg/FactorAnalytics/tests/FactorAnalytics_04_21_15.pdf
Modified:
   pkg/FactorAnalytics/DESCRIPTION
   pkg/FactorAnalytics/R/fitTsfm.R
   pkg/FactorAnalytics/R/fitTsfm.control.R
   pkg/FactorAnalytics/R/plot.tsfm.r
   pkg/FactorAnalytics/man/fitTsfm.control.Rd
   pkg/FactorAnalytics/vignettes/fitTsfm_vignette.Rnw
   pkg/FactorAnalytics/vignettes/fitTsfm_vignette.pdf
Log:
Added lmRob control parameters

Modified: pkg/FactorAnalytics/DESCRIPTION
===================================================================
--- pkg/FactorAnalytics/DESCRIPTION	2015-04-25 13:08:18 UTC (rev 3640)
+++ pkg/FactorAnalytics/DESCRIPTION	2015-04-26 05:56:44 UTC (rev 3641)
@@ -1,8 +1,8 @@
 Package: factorAnalytics
 Type: Package
 Title: Factor Analytics
-Version:2.0.18
-Date:2015-04-21
+Version:2.0.19
+Date:2015-04-25
 Author: Eric Zivot, Sangeetha Srinivasan and Yi-An Chen
 Maintainer: Sangeetha Srinivasan <sangee at uw.edu>
 Description: An R package for the estimation and risk analysis of linear factor

Modified: pkg/FactorAnalytics/R/fitTsfm.R
===================================================================
--- pkg/FactorAnalytics/R/fitTsfm.R	2015-04-25 13:08:18 UTC (rev 3640)
+++ pkg/FactorAnalytics/R/fitTsfm.R	2015-04-26 05:56:44 UTC (rev 3641)
@@ -185,8 +185,8 @@
   m1 <- match(c("weights","model","x","y","qr"), 
               names(control), 0L)
   lm.args <- control[m1, drop=TRUE]
-  m2 <-  match(c("weights","model","x","y","nrep","efficiency"), 
-               names(control), 0L)
+  m2 <-  match(c("weights","model","x","y","nrep","efficiency","mxr","mxf",
+                 "mxs","trace"), names(control), 0L)
   lmRob.args <- control[m2, drop=TRUE]
   m3 <-  match(c("scope","scale","direction","trace","steps","k"), 
                names(control), 0L)

Modified: pkg/FactorAnalytics/R/fitTsfm.control.R
===================================================================
--- pkg/FactorAnalytics/R/fitTsfm.control.R	2015-04-25 13:08:18 UTC (rev 3640)
+++ pkg/FactorAnalytics/R/fitTsfm.control.R	2015-04-26 05:56:44 UTC (rev 3641)
@@ -45,6 +45,12 @@
 #' resampling is being used, the value of \code{nrep} is ignored.
 #' @param efficiency the asymptotic efficiency of the final estimate for 
 #' \code{fit.method="Robust"}. Default is 0.9.
+#' @param mxr the maximum number of iterations in the refinement step. Default 
+#' is 50.
+#' @param mxf the maximum number of iterations for computing final coefficient 
+#' estimates. Default is 50.
+#' @param mxs the maximum number of iterations for computing scale estimate. 
+#' Default is 50.
 #' @param scope defines the range of models examined in the \code{"stepwise"} 
 #' search. This should be either a single formula, or a list containing 
 #' components \code{upper} and \code{lower}, both formulae. See 
@@ -56,9 +62,10 @@
 #' "backward", or "forward", with a default of "both". If the \code{scope} 
 #' argument is missing the default for \code{direction} is "backward". 
 #' @param trace If positive (or, not \code{FALSE}), info is printed during the 
-#' running of \code{\link[stats]{step}}, \code{\link[robust]{step.lmRob}},
-#' \code{\link[lars]{lars}} or \code{\link[lars]{cv.lars}} as relevant. Larger 
-#' values may give more detailed information. Default is \code{FALSE}.
+#' running of \code{\link[robust]{lmRob}}, \code{\link[stats]{step}}, 
+#' \code{\link[robust]{step.lmRob}}, \code{\link[lars]{lars}} or 
+#' \code{\link[lars]{cv.lars}} as relevant. Larger values may give more 
+#' detailed information. Default is \code{FALSE}.
 #' @param steps the maximum number of steps to be considered for 
 #' \code{"stepwise"}. Default is 1000 (essentially as many as required). It is 
 #' typically used to stop the process early. 
@@ -131,11 +138,11 @@
 #'
 
 fitTsfm.control <- function(decay=0.95, weights, model=TRUE, x=FALSE, y=FALSE, 
-                            qr=TRUE, nrep=NULL, efficiency=0.9, 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, 
+                            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) {
   
   # get the user-specified arguments (that have no defaults)
@@ -186,10 +193,10 @@
   
   # return list of arguments with defaults if they are unspecified
   result <- c(args, list(decay=decay, model=model, x=x, y=y, qr=qr, nrep=nrep, 
-                         efficiency=efficiency, trace=trace, steps=steps, k=k, 
-                         nvmin=nvmin, nvmax=nvmax, force.in=force.in, 
-                         force.out=force.out, really.big=really.big, 
-                         normalize=normalize, eps=eps, 
+                         efficiency=efficiency, mxr=mxr, mxf=mxf, mxs=mxs, 
+                         trace=trace, steps=steps, k=k, nvmin=nvmin, 
+                         nvmax=nvmax, force.in=force.in, force.out=force.out, 
+                         really.big=really.big, normalize=normalize, eps=eps, 
                          lars.criterion=lars.criterion, K=K))
   return(result)
 }

Modified: pkg/FactorAnalytics/R/plot.tsfm.r
===================================================================
--- pkg/FactorAnalytics/R/plot.tsfm.r	2015-04-25 13:08:18 UTC (rev 3640)
+++ pkg/FactorAnalytics/R/plot.tsfm.r	2015-04-26 05:56:44 UTC (rev 3641)
@@ -375,7 +375,7 @@
                }
                rawdata <- coredata(merge.xts(x$data[,i], x$data[,x$factor.names]))
                plot(x=rawdata[,2], y=rawdata[,1], pch=20, main="",
-                    xlab=paste(x$factor.names, "Returns"), ylab=paste(i,"Returns"))
+                    xlab=paste(x$factor.names, "Returns"), ylab=paste(i,"Returns"), ...)
                coef <- summary(fit)$coefficients
                a=coef[1,1]; b=coef[2,1]
                se.a=round(coef[1,2],2); se.b=round(coef[2,2],2)
@@ -552,14 +552,14 @@
                  asset <- x$asset.names[i]
                  rawdata <- coredata(merge.xts(x$data[,asset], x$data[,x$factor.names]))
                  plot(x=rawdata[,2], y=rawdata[,1], pch=20, main="",
-                      xlab=paste(x$factor.names, "Returns"), ylab=paste(asset,"Returns"))
+                      xlab=paste(x$factor.names, "Returns"), ylab=paste(asset,"Returns"), ...)
                  coef <- summary(fit)$coefficients
                  a=coef[1,1]; b=coef[2,1]
                  se.a=round(coef[1,2],2); se.b=round(coef[2,2],2)
                  abline(a=a, b=b, col="red", lty=2, lwd=2)
                  lgnd <- c(bquote(.(meth) ~~ hat(alpha) == .(round(a,2))~(.(se.a))), 
                            bquote(.(meth) ~~  hat(beta) == .(round(b,2))~(.(se.b))))
-                 legend(x=legend.loc, bty="n", legend=as.expression(lgnd))
+                 legend(x=legend.loc, bty="n", legend=as.expression(lgnd), cex=0.9)
                }
                par(mfrow=c(1,1))
              },

Modified: pkg/FactorAnalytics/man/fitTsfm.control.Rd
===================================================================
--- pkg/FactorAnalytics/man/fitTsfm.control.Rd	2015-04-25 13:08:18 UTC (rev 3640)
+++ pkg/FactorAnalytics/man/fitTsfm.control.Rd	2015-04-26 05:56:44 UTC (rev 3641)
@@ -5,11 +5,11 @@
 \title{List of control parameters for \code{fitTsfm}}
 \usage{
 fitTsfm.control(decay = 0.95, weights, model = TRUE, x = FALSE,
-  y = FALSE, qr = TRUE, nrep = NULL, efficiency = 0.9, 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)
+  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{
 \item{decay}{a scalar in (0, 1] to specify the decay factor for "DLS".
@@ -34,6 +34,15 @@
 \item{efficiency}{the asymptotic efficiency of the final estimate for
 \code{fit.method="Robust"}. Default is 0.9.}
 
+\item{mxr}{the maximum number of iterations in the refinement step. Default
+is 50.}
+
+\item{mxf}{the maximum number of iterations for computing final coefficient
+estimates. Default is 50.}
+
+\item{mxs}{the maximum number of iterations for computing scale estimate.
+Default is 50.}
+
 \item{scope}{defines the range of models examined in the \code{"stepwise"}
 search. This should be either a single formula, or a list containing
 components \code{upper} and \code{lower}, both formulae. See
@@ -48,9 +57,10 @@
 argument is missing the default for \code{direction} is "backward".}
 
 \item{trace}{If positive (or, not \code{FALSE}), info is printed during the
-running of \code{\link[stats]{step}}, \code{\link[robust]{step.lmRob}},
-\code{\link[lars]{lars}} or \code{\link[lars]{cv.lars}} as relevant. Larger
-values may give more detailed information. Default is \code{FALSE}.}
+running of \code{\link[robust]{lmRob}}, \code{\link[stats]{step}},
+\code{\link[robust]{step.lmRob}}, \code{\link[lars]{lars}} or
+\code{\link[lars]{cv.lars}} as relevant. Larger values may give more
+detailed information. Default is \code{FALSE}.}
 
 \item{steps}{the maximum number of steps to be considered for
 \code{"stepwise"}. Default is 1000 (essentially as many as required). It is

Deleted: pkg/FactorAnalytics/tests/FactorAnalytics_04_21_15.pdf
===================================================================
(Binary files differ)

Added: pkg/FactorAnalytics/tests/FactorAnalytics_04_25_15.pdf
===================================================================
(Binary files differ)


Property changes on: pkg/FactorAnalytics/tests/FactorAnalytics_04_25_15.pdf
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: pkg/FactorAnalytics/vignettes/fitTsfm_vignette.Rnw
===================================================================
--- pkg/FactorAnalytics/vignettes/fitTsfm_vignette.Rnw	2015-04-25 13:08:18 UTC (rev 3640)
+++ pkg/FactorAnalytics/vignettes/fitTsfm_vignette.Rnw	2015-04-26 05:56:44 UTC (rev 3641)
@@ -258,7 +258,7 @@
 For easy reference, here's a classified list of control parameters accepted and passed by \code{fitTsfm} to their respective model fitting (or) model selection functions in other packages. See the corresponding help files for more details on each parameter.
 \begin{itemize}
 \item \verb"lm": "weights","model","x","y","qr"
-\item \verb"lmRob": "weights","model","x","y","nrep","efficiency"
+\item \verb"lmRob": "weights","model","x","y","nrep","efficiency","mxr","mxf","mxs","trace"
 \item \verb"step": "scope","scale","direction","trace","steps","k"
 \item \verb"regsubsets": "weights","nvmax","force.in","force.out","method","really.big"
 \item \verb"lars": "type","normalize","eps","max.steps","trace"

Modified: pkg/FactorAnalytics/vignettes/fitTsfm_vignette.pdf
===================================================================
(Binary files differ)



More information about the Returnanalytics-commits mailing list