[Eventstudies-commits] r164 - in pkg: data man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Feb 8 08:53:10 CET 2014


Author: vikram
Date: 2014-02-08 08:53:10 +0100 (Sat, 08 Feb 2014)
New Revision: 164

Added:
   pkg/data/lmAMMData.rda
   pkg/man/lmAMM.Rd
   pkg/man/lmAMMData.Rd
Removed:
   pkg/data/firmExposuresData.rda
   pkg/data/y3c3.rda
   pkg/man/firmExposures.Rd
   pkg/man/firmExposuresData.Rd
Modified:
   pkg/man/manyfirmsAMM.Rd
Log:
Modified AMM functionality to fit like lm function with class as 'amm'

Deleted: pkg/data/firmExposuresData.rda
===================================================================
(Binary files differ)

Added: pkg/data/lmAMMData.rda
===================================================================
(Binary files differ)


Property changes on: pkg/data/lmAMMData.rda
___________________________________________________________________
Added: svn:mime-type
   + application/x-gzip

Deleted: pkg/data/y3c3.rda
===================================================================
(Binary files differ)

Deleted: pkg/man/firmExposures.Rd
===================================================================
--- pkg/man/firmExposures.Rd	2014-02-06 12:51:28 UTC (rev 163)
+++ pkg/man/firmExposures.Rd	2014-02-08 07:53:10 UTC (rev 164)
@@ -1,72 +0,0 @@
-\name{firmExposures}
-\alias{firmExposures}
-
-\title{A function that estimates exposure for a single firm in a
-single period}
-
-\description{This function typically utilises an firm.returns vector
-  and an X matrix of explanatory variables obtained 
-  using the makeX function. This would compute the exposure
-  for all columns in X.
-}
-
-\usage{
-firmExposures(firm.returns, X, nlags = NA, verbose = FALSE)
-}
-
-\arguments{
-  \item{firm.returns}{A vector of data for one firm}
-
-  \item{X}{A matrix of explanatory variables obtained from
-    the makeX function. The first variable is always the
-    stock market index. Other variables could be
-    such as currency or bond returns, or other variables as
-  desired by the user. 
-  }
-
-  \item{nlags}{Number of lags of explanatory variables. When unspecified
-    the best lag using the AIC is used.
-  }
-
-  \item{verbose}{Default is FALSE. When set to TRUE, the function
-    prints detailed results while running this function. 
-  }
-}
-
-
-\value{ The function returns the exposures, HAC adjusted standard
-  errors, the number of lags used, and the residuals from the fitted
-  model.
-
-\item{exposures}{This contains the exposure estimates for the firm
-j}
-
-\item{s.exposures}{This contains the HAC adjusted standard error
-of the exposures estimated for the firm firm.returns.}
-
-\item{nlags}{Specifies the lag length provided by the user}
-
-\item{lm.res}{The model estimates used in the analysis are stored here.}
-
-}
-
-\author{Ajay Shah, Vimal Balasubramaniam}
-
-\seealso{
-\code{\link{manyfirmsAMM}}
-}
-
-\examples{
-# firmExposures
-data("firmExposuresData")
-firm.returns  <- firmExposuresData$Company_A
-market.returns <- firmExposuresData$NIFTY_INDEX
-rM2 <- firmExposuresData$usdinr
-rM3 <- firmExposuresData$baa
-X <- makeX(market.returns, others=rM2,
-           switch.to.innov=FALSE, market.returns.purge=FALSE, verbose=FALSE)
-a <- firmExposures(firm.returns, X, nlags=0, verbose=FALSE)
-print(a)
-}
-
-\keyword{firmExposures}
\ No newline at end of file

Deleted: pkg/man/firmExposuresData.Rd
===================================================================
--- pkg/man/firmExposuresData.Rd	2014-02-06 12:51:28 UTC (rev 163)
+++ pkg/man/firmExposuresData.Rd	2014-02-08 07:53:10 UTC (rev 164)
@@ -1,19 +0,0 @@
-\name{firmExposuresData}
-\alias{firmExposuresData}
-
-
-\title{Data for testing the amm package and examples therein}
-
-\description{This is a zoo data that is used for testing purposes}
-
-\usage{data(firmExposuresData)}
-
-\author{Vimal Balasubramaniam}
-
-\examples{
-library(zoo)
-data(firmExposuresData)
-str(firmExposuresData)
-}
-
-\keyword{firmExposuresData}
\ No newline at end of file

Copied: pkg/man/lmAMM.Rd (from rev 161, pkg/man/firmExposures.Rd)
===================================================================
--- pkg/man/lmAMM.Rd	                        (rev 0)
+++ pkg/man/lmAMM.Rd	2014-02-08 07:53:10 UTC (rev 164)
@@ -0,0 +1,68 @@
+\name{lmAMM}
+\alias{lmAMM}
+
+\title{Augmented market model (AMM) estimation}
+
+\description{This function relates firm returns to the regressors using the linear model (market index movements, currency fluctuations etc.).
+It computes firm exposure for all the regressors in columns of X and subsequently estimates AMM residuals by purging out variation
+from regressand.
+}
+
+\usage{
+lmAMM(firm.returns, X, nlags = NA, verbose = FALSE)
+}
+
+\arguments{
+  \item{firm.returns}{A time series object of firm returns for AMM estimation}
+
+  \item{X}{A time series of explanatory variables obtained from
+    the makeX function. The first variable is always the
+    stock market index. Other variables could be
+    such as currency or bond returns, or other variables as
+  desired by the user. 
+  }
+
+  \item{nlags}{Number of lags of explanatory variables. When unspecified
+    the best lag using the AIC is used.
+  }
+
+  \item{verbose}{Default is FALSE. When set to TRUE, the function
+    prints detailed results while running this function. 
+  }
+}
+
+
+\value{ The function returns the exposures, HAC adjusted standard
+  errors, the number of lags used, and the residuals from the fitted
+  model.
+
+\item{exposures}{This contains the exposure estimates for the firm
+j}
+
+\item{s.exposures}{This contains the HAC adjusted standard error
+of the exposures estimated for the firm firm.returns.}
+
+\item{nlags}{Specifies the lag length provided by the user}
+
+}
+
+\author{Ajay Shah, Vimal Balasubramaniam}
+
+\seealso{
+\code{\link{manyfirmsAMM}, \link{makeX}}
+}
+
+\examples{
+# lmAMM
+data("lmAMMData")
+firm.returns <- lmAMMData[,c("Infosys")]
+market.returns <- lmAMMData[,"index.nifty"]
+currency.returns <- lmAMMData[,"currency.inrusd"]
+## Creating regressors for AMM estimation using makeX function
+X <- makeX(market.returns, others=currency.returns,
+           switch.to.innov=FALSE, market.returns.purge=FALSE, verbose=FALSE)
+a <- lmAMM(firm.returns, X, nlags=0, verbose=FALSE)
+print(a)
+}
+
+\keyword{lmAMM}
\ No newline at end of file

Copied: pkg/man/lmAMMData.Rd (from rev 161, pkg/man/firmExposuresData.Rd)
===================================================================
--- pkg/man/lmAMMData.Rd	                        (rev 0)
+++ pkg/man/lmAMMData.Rd	2014-02-08 07:53:10 UTC (rev 164)
@@ -0,0 +1,19 @@
+\name{lmAMMData}
+\alias{lmAMMData}
+
+
+\title{Firm returns, market returns (Nifty) and currency returns (INR/USD) for AMM estimation}
+
+\description{The data series is a daily time-series zoo object. The sample range for the data is from 2012-02-01 to 2014-01-31. It consists daily time series for firm returns (Infosys and TCS), market returns (Nifty returns) and currency returns (INR/USD). This data is used to demonstrate the AMM estimation.}
+
+\usage{data(lmAMMData)}
+
+\author{Vikram Bahure}
+
+\examples{
+library(zoo)
+data(lmAMMData)
+str(lmAMMData)
+}
+
+\keyword{lmAMMData}
\ No newline at end of file

Modified: pkg/man/manyfirmsAMM.Rd
===================================================================
--- pkg/man/manyfirmsAMM.Rd	2014-02-06 12:51:28 UTC (rev 163)
+++ pkg/man/manyfirmsAMM.Rd	2014-02-08 07:53:10 UTC (rev 164)
@@ -42,23 +42,21 @@
 
 \examples{
 # Running manyfirmsAMM() involves as many steps as working with onefirmAMM. 
-
-data("y3c3", package="eventstudies")       
-NIFTY_INDEX <- y3c3$NIFTY_INDEX
-INRUSD <- y3c3$INRUSD
-Company_A <- y3c3$Company_A
-Company_B <- y3c3$Company_B
-Company_C <- y3c3$Company_C
-regressors <- makeX(market.returns=NIFTY_INDEX, others=INRUSD,
-           switch.to.innov=TRUE, market.returns.purge=TRUE, nlags=1,
-           dates=as.Date(c("2005-01-15","2006-01-07","2007-01-06",
-                       "2008-01-05","2009-01-03")), verbose=FALSE)
-regressand <- cbind(Company_A,Company_B,Company_C)
+data("lmAMMData")
+regressand <- lmAMMData[,c("Infosys","TCS")]
+market.returns <- lmAMMData[,"index.nifty"]
+currency.returns <- lmAMMData[,"currency.inrusd"]
+## Creating regressors for AMM estimation using makeX function
+regressors <- makeX(market.returns, others=currency.returns,, nlags=1,
+              switch.to.innov=FALSE, market.returns.purge=FALSE, verbose=FALSE,
+	      dates=as.Date(c("2005-01-15","2006-01-07","2007-01-06",
+	      	            "2008-01-05","2009-01-03")))
+## Estimating exposure
 res <- manyfirmsAMM(regressand,regressors,lags=1,
                      dates=as.Date(c("2005-01-15","2006-01-07","2007-01-06",
                        "2008-01-05","2009-01-03")),periodnames=c("P1","P2","P3","P4"),
                      verbose=FALSE)
-
+print(res)
 }
 
 \keyword{manyfirmsAMM}
\ No newline at end of file



More information about the Eventstudies-commits mailing list