[Returnanalytics-commits] r4020 - in pkg/FactorAnalytics: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon May 9 11:00:27 CEST 2016


Author: pragnya
Date: 2016-05-09 11:00:26 +0200 (Mon, 09 May 2016)
New Revision: 4020

Modified:
   pkg/FactorAnalytics/DESCRIPTION
   pkg/FactorAnalytics/R/fitFfm.R
Log:
Renamed zScore function in fitFfm

Modified: pkg/FactorAnalytics/DESCRIPTION
===================================================================
--- pkg/FactorAnalytics/DESCRIPTION	2016-05-06 14:14:25 UTC (rev 4019)
+++ pkg/FactorAnalytics/DESCRIPTION	2016-05-09 09:00:26 UTC (rev 4020)
@@ -1,8 +1,8 @@
 Package: factorAnalytics
 Type: Package
 Title: Factor Analytics
-Version: 2.0.30
-Date: 2016-03-17
+Version: 2.0.31
+Date: 2016-05-09
 Author: Eric Zivot, Sangeetha Srinivasan and Yi-An Chen
 Maintainer: Sangeetha Srinivasan <sangee at uw.edu>
 Description: Linear factor model fitting for asset returns (three major types-

Modified: pkg/FactorAnalytics/R/fitFfm.R
===================================================================
--- pkg/FactorAnalytics/R/fitFfm.R	2016-05-06 14:14:25 UTC (rev 4019)
+++ pkg/FactorAnalytics/R/fitFfm.R	2016-05-09 09:00:26 UTC (rev 4020)
@@ -231,7 +231,7 @@
     }
     # calculate z-scores looping through all numeric exposures
     for (i in exposures.num) {
-      std.expo.num <- by(data=data, INDICES=data[[date.var]], FUN=z.score,
+      std.expo.num <- by(data=data, INDICES=data[[date.var]], FUN=zScore,
                          i=i, w=w, rob.stats=rob.stats)
       data[[i]] <- unlist(std.expo.num)
     }
@@ -375,7 +375,7 @@
 ## x is a data.frame object, i is a character string and w has same length as x 
 # rob.stats is a logical argument to compute robust location and scale
 
-z.score <- function (x, i, w, rob.stats) {
+zScore <- function (x, i, w, rob.stats) {
   if (rob.stats) {
     x_bar <- median(w*x[[i]])
     (x[[i]] - x_bar)/mad(x[[i]], center=x_bar)



More information about the Returnanalytics-commits mailing list