From noreply at r-forge.r-project.org Wed May 1 11:28:43 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 1 May 2013 11:28:43 +0200 (CEST) Subject: [Eventstudies-commits] r65 - pkg/vignettes Message-ID: <20130501092843.5169518487B@r-forge.r-project.org> Author: vikram Date: 2013-05-01 11:28:42 +0200 (Wed, 01 May 2013) New Revision: 65 Added: pkg/vignettes/eventstudies.bib Modified: pkg/vignettes/ees.Rnw pkg/vignettes/eventstudies.Rnw Log: Added references Modified: pkg/vignettes/ees.Rnw =================================================================== --- pkg/vignettes/ees.Rnw 2013-04-30 06:29:23 UTC (rev 64) +++ pkg/vignettes/ees.Rnw 2013-05-01 09:28:42 UTC (rev 65) @@ -17,8 +17,8 @@ %\VignettePackage{eventstudies} \maketitle \begin{abstract} -The \textit{eventstudies} package also has extreme events -functionality. This package has \textit{identifyextremeevents} +The \textit{eventstudies} package includes an extreme events +functionality. This package has \textit{ees} function which does extreme event analysis by fusing the consecutive extreme events in a single event. The methods and functions are elucidated by employing data-set of S\&P 500 and Nifty. @@ -26,17 +26,13 @@ \SweaveOpts{engine=R,pdf=TRUE} \section{Introduction} -The analysis done using this function is in tandem with Table 1,2,3,4 -and 5 of Patnaik, Shah and Singh (2013). A detail methodology is also -discussed in the paper mentioned. We use S\&P500 returns to -understand the \textit{identifyextremeevents} functionality. - -Using this function, one can to understand the distribution and run +Using this function, one can understand the distribution and run length of the clustered events, quantile values for the extreme events and yearly distribution of the extreme events. In the sections -below we replicate the analysis for S\&P 500 from the paper and we -generate the extreme event study plot for event on S\&P 500 and -response of NIFTY. +below we replicate the analysis for S\&P 500 from the Patnaik, Shah +and Singh (2013) and we generate the extreme event study plot for +event on S\&P 500 and response of NIFTY. A detail methodology is also +discussed in the paper. \section{Extreme event analysis} This function needs input in returns format on which extreme @@ -48,14 +44,17 @@ library(eventstudies) data(eesData) input <- eesData$sp500 -output <- ees(input, prob.value=5) +# Suppress messages + deprintize<-function(f){ + return(function(...) {capture.output(w<-f(...));return(w);}); + } +output <- deprintize(ees)(input, prob.value=5) @ % I don't understand this output. Maybe you should explain what it means. -The output is a list. Primarily it consists of three lists, -summary statistics for complete data-set, extreme event analysis for -lower tail and extreme event analysis for upper tail. Further, these -lower tail and upper tail list objects consists of 5 more list objects with -following output: +The output is a list and consists of summary statistics for complete +data-set, extreme event analysis for lower tail and extreme event +analysis for upper tail. Further, these lower tail and upper tail list +objects consists of 5 more list objects with following output: \begin{enumerate} \item Extreme events dataset \item Distribution of clustered and unclustered % events. @@ -68,7 +67,7 @@ Here we have data summary for the complete data-set which shows minimum, 5\%, 25\%, median, mean, 75\%, 95\%, maximum, standard deviation (sd), inter-quartile range (IQR) and number of -observations. The output shown below mathces with the fourth column +observations. The output shown below matches with the fourth column in Table 1 of the paper. <<>>== output$data.summary @@ -130,7 +129,7 @@ The yearly distribution for extreme events include unclustered event and clustered events which are fused. While in extreme event distribution of clustered and unclustered event, the clustered events are defined as -total evnets in a cluster. For example, if there is a clustered event +total events in a cluster. For example, if there is a clustered event with three consecutive extreme events then yearly distribution will treat it as one single event. Here below the relationship between the Tables is explained through equations:\\\\ @@ -174,10 +173,6 @@ \setkeys{Gin}{height=0.8\linewidth} <>= <> -# Suppress the messages - deprintize<-function(f){ - return(function(...) {capture.output(w<-f(...));return(w);}); - } res <- deprintize(eesPlot)(z=eesData, response.series.name="nifty", event.series.name="sp500",titlestring="S&P500", ylab="(Cum.) change in NIFTY", prob.value=5, width=5) @ \end{center} @@ -188,7 +183,7 @@ The package code is purely written in R. It has dependencies to zoo (\href{http://cran.r-project.org/web/packages/zoo/index.html}{Zeileis 2012}) and boot -(\href{http://cran.r-project.org/web/packages/boot/index.html}{Rlpley +(\href{http://cran.r-project.org/web/packages/boot/index.html}{Ripley 2013}). R itself as well as these packages can be obtained from \href{http://CRAN.R-project.org/}{CRAN}. %\section{Acknowledgments} Modified: pkg/vignettes/eventstudies.Rnw =================================================================== --- pkg/vignettes/eventstudies.Rnw 2013-04-30 06:29:23 UTC (rev 64) +++ pkg/vignettes/eventstudies.Rnw 2013-05-01 09:28:42 UTC (rev 65) @@ -21,19 +21,19 @@ methodology is explained in this paper. In addition to converting physical dates to event time frame, functions for re-indexing the event time returns and bootstrap inference estimation. The methods and -functions are elucidated by employing data-set ofSENSEX firms. +functions are elucidated by employing data-set of SENSEX firms. \end{abstract} \SweaveOpts{engine=R,pdf=TRUE} \section{Introduction} -Event study has a long history which dates back to 1933 (James Dolley -(1933)). It is mostly used to study the response of stock price or -value of a firm due to events such as mergers \& acquisitions, stock -splits, quarterly results and so on. It is one of the most widely -used statistical tool. +Event study has a long history which dates back to 1938 +\citep{dolley1938effect}). It is mostly used to study the response of +stock price or value of a firm due to events such as mergers \& +acquisitions, stock splits, quarterly results and so on. It is one +of the most widely used statistical tool. Event study is used to study the response or -the effect on a variable due to similar events. Efficient and liquid +the effect on a variable, due to similar events. Efficient and liquid markets are basic assumption in this methodology. It assumes the effect on response variable is without delay. As event study output is further used in econometric analysis, hence significance test such as @@ -142,10 +142,10 @@ we generate the sampling distribution for the estimate using bootstrap inference. A detailed explanation of the methodology is presented in Patnaik, Shah and Singh (2013). -This specific approach used here is based on Davinson, Hinkley and -Schectman (1986). The \textit{inference.Ecar} function does the -bootstrap to generate distribution of $\bar{CR}$. The bootstrap -generates confidence interval at 2.5\% and 97.5\% for the estimate. +This specific approach used here is based on +\citept{davison1986efficient}. The \textit{inference.Ecar} function +does the bootstrap to generate distribution of $\bar{CR}$. The +bootstrap generates confidence interval at 2.5\% and 97.5\% for the estimate. <<>>= result <- inference.Ecar(z.e=es.cs, to.plot=TRUE) @@ -168,8 +168,12 @@ The package code is purely written in R. It has dependencies to zoo (\href{http://cran.r-project.org/web/packages/zoo/index.html}{Zeileis 2012}) and boot -(\href{http://cran.r-project.org/web/packages/boot/index.html}{Rlpley +(\href{http://cran.r-project.org/web/packages/boot/index.html}{Ripley 2013}). R itself as well as these packages can be obtained from \href{http://CRAN.R-project.org/}{CRAN}. %\section{Acknowledgments} +%\newpage +\bibliographystyle{jss} +\bibliography{eventstudies} + \end{document} Added: pkg/vignettes/eventstudies.bib =================================================================== --- pkg/vignettes/eventstudies.bib (rev 0) +++ pkg/vignettes/eventstudies.bib 2013-05-01 09:28:42 UTC (rev 65) @@ -0,0 +1,21 @@ + at article{dolley1938effect, + title={The effect of government regulation in the stock-trading volume of the New York Stock Exchange}, + author={Dolley, James C}, + journal={The American Economic Review}, + volume={28}, + number={1}, + pages={8--26}, + year={1938}, + publisher={JSTOR} +} + + at article{davison1986efficient, + title={Efficient bootstrap simulation}, + author={Davinson, AC and Hinkley, David V and Schechtman, E}, + journal={Biometrika}, + volume={73}, + number={3}, + pages={555--566}, + year={1986}, + publisher={Biometrika Trust} +} \ No newline at end of file From noreply at r-forge.r-project.org Wed May 1 11:35:37 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 1 May 2013 11:35:37 +0200 (CEST) Subject: [Eventstudies-commits] r66 - pkg/vignettes Message-ID: <20130501093537.6269F18513B@r-forge.r-project.org> Author: vikram Date: 2013-05-01 11:35:37 +0200 (Wed, 01 May 2013) New Revision: 66 Modified: pkg/vignettes/eventstudies.Rnw Log: Minor modification Modified: pkg/vignettes/eventstudies.Rnw =================================================================== --- pkg/vignettes/eventstudies.Rnw 2013-05-01 09:28:42 UTC (rev 65) +++ pkg/vignettes/eventstudies.Rnw 2013-05-01 09:35:37 UTC (rev 66) @@ -27,7 +27,7 @@ \SweaveOpts{engine=R,pdf=TRUE} \section{Introduction} Event study has a long history which dates back to 1938 -\citep{dolley1938effect}). It is mostly used to study the response of +\citep{dolley1938effect}. It is mostly used to study the response of stock price or value of a firm due to events such as mergers \& acquisitions, stock splits, quarterly results and so on. It is one of the most widely used statistical tool. @@ -143,7 +143,7 @@ inference. A detailed explanation of the methodology is presented in Patnaik, Shah and Singh (2013). This specific approach used here is based on -\citept{davison1986efficient}. The \textit{inference.Ecar} function +\citet{davison1986efficient}. The \textit{inference.Ecar} function does the bootstrap to generate distribution of $\bar{CR}$. The bootstrap generates confidence interval at 2.5\% and 97.5\% for the estimate. From noreply at r-forge.r-project.org Thu May 2 11:39:31 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 2 May 2013 11:39:31 +0200 (CEST) Subject: [Eventstudies-commits] r67 - pkg/man Message-ID: <20130502093931.9AD9C184C93@r-forge.r-project.org> Author: vikram Date: 2013-05-02 11:39:31 +0200 (Thu, 02 May 2013) New Revision: 67 Modified: pkg/man/ees.Rd Log: Added references in documentation, about authors whose function we use in the package Modified: pkg/man/ees.Rd =================================================================== --- pkg/man/ees.Rd 2013-05-01 09:35:37 UTC (rev 66) +++ pkg/man/ees.Rd 2013-05-02 09:39:31 UTC (rev 67) @@ -32,7 +32,9 @@ distribution; Quantile values; Yearly distribution; Extreme event data} } +\references{To convert number to words, code uses function \href{http://finzi.psych.upenn.edu/R/Rhelp02a/archive/46843.html}{numbers2words} by \href{http://socserv.mcmaster.ca/jfox/}{John Fox} and deprintize function by \href{http://mbq.me/}{Miron Kursa} } +\author{Vikram Bahure} \examples{ library(eventstudies) data(eesData) From noreply at r-forge.r-project.org Mon May 6 06:47:56 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 6 May 2013 06:47:56 +0200 (CEST) Subject: [Eventstudies-commits] r68 - pkg Message-ID: <20130506044757.0662F18487C@r-forge.r-project.org> Author: vikram Date: 2013-05-06 06:47:56 +0200 (Mon, 06 May 2013) New Revision: 68 Modified: pkg/DESCRIPTION Log: Changed the version to 1.0 Modified: pkg/DESCRIPTION =================================================================== --- pkg/DESCRIPTION 2013-05-02 09:39:31 UTC (rev 67) +++ pkg/DESCRIPTION 2013-05-06 04:47:56 UTC (rev 68) @@ -1,7 +1,7 @@ Package: eventstudies Type: Package Title: Event study and extreme event analysis -Version: 0.05 +Version: 1.0 Date: 2013-04-02 Author: Ajay Shah, Vimal Balasubramaniam, Vikram Bahure Maintainer: Vikram Bahure From noreply at r-forge.r-project.org Wed May 8 09:14:28 2013 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Wed, 8 May 2013 09:14:28 +0200 (CEST) Subject: [Eventstudies-commits] r69 - in pkg: inst vignettes Message-ID: <20130508071428.447761846A9@r-forge.r-project.org> Author: vikram Date: 2013-05-08 09:14:27 +0200 (Wed, 08 May 2013) New Revision: 69 Removed: pkg/inst/CITATION pkg/inst/ChangeLog Modified: pkg/vignettes/ees.Rnw pkg/vignettes/eventstudies.Rnw Log: Removed change log and CITATION info; modified the figplot command in vignette due to Sweave error Deleted: pkg/inst/CITATION =================================================================== --- pkg/inst/CITATION 2013-05-06 04:47:56 UTC (rev 68) +++ pkg/inst/CITATION 2013-05-08 07:14:27 UTC (rev 69) @@ -1,18 +0,0 @@ -citHeader("To cite eventstudies in publications use:") - -citEntry(entry="Article", - title = "eventstudies: Infrastructure for performing Event Studies with R", - author = personList(as.person("Ajay Shah"), - as.person("Vikram Bahure"), - as.person("Vimal Balasubramaniam")), - journal = "Journal of Statistical Software", - year = "2013", - volume = "", - number = "", - pages = "", - url = "", - - textVersion = - paste("Ajay Shah,Vikram Bahure,Vimal Balasubramaniam", - "eventstudies: Infrastructure for performing Event Studies with R") -) Deleted: pkg/inst/ChangeLog =================================================================== --- pkg/inst/ChangeLog 2013-05-06 04:47:56 UTC (rev 68) +++ pkg/inst/ChangeLog 2013-05-08 07:14:27 UTC (rev 69) @@ -1,153 +0,0 @@ ------------------------------------------------------------------------- -r18 | ashim | 2011-09-14 11:34:09 +0530 (Wed, 14 Sep 2011) | 1 line -Changed paths: - M /pkg/DESCRIPTION - A /pkg/inst/CITATION - -Added a basic CITATION ------------------------------------------------------------------------- -r17 | ashim | 2011-09-13 20:02:26 +0530 (Tue, 13 Sep 2011) | 1 line -Changed paths: - M /pkg/man/inference.change.boot.Rd - -Changes in inference.change.boot documentation ------------------------------------------------------------------------- -r16 | ashim | 2011-09-13 19:52:25 +0530 (Tue, 13 Sep 2011) | 1 line -Changed paths: - M /pkg/man/inr.Rd - -Changes to the inr.Rd ------------------------------------------------------------------------- -r15 | ashim | 2011-09-13 19:00:32 +0530 (Tue, 13 Sep 2011) | 1 line -Changed paths: - D /pkg/man/eventslist.Rd - A /pkg/man/inr.Rd (from /pkg/man/inr.rda.Rd:14) - D /pkg/man/inr.rda.Rd - -Removing the eventslist.Rd file ------------------------------------------------------------------------- -r14 | ashim | 2011-09-13 17:11:05 +0530 (Tue, 13 Sep 2011) | 1 line -Changed paths: - A /pkg/man/inr.rda.Rd - -Documentation for the INR/USD data set ------------------------------------------------------------------------- -r13 | ashim | 2011-09-13 16:53:09 +0530 (Tue, 13 Sep 2011) | 1 line -Changed paths: - M /pkg/man/inference.Ecar.Rd - -Fixed inference.Ecar.Rd ------------------------------------------------------------------------- -r12 | ashim | 2011-09-13 16:22:42 +0530 (Tue, 13 Sep 2011) | 1 line -Changed paths: - M /pkg/DESCRIPTION - -Fixing the dependencies ------------------------------------------------------------------------- -r11 | ashim | 2011-09-13 12:34:42 +0530 (Tue, 13 Sep 2011) | 1 line -Changed paths: - M /pkg/man/inference.Ecar.Rd - -Fixing documentation ------------------------------------------------------------------------- -r10 | ashim | 2011-09-13 11:40:49 +0530 (Tue, 13 Sep 2011) | 1 line -Changed paths: - M /pkg/man/eventslist.Rd - M /pkg/man/eventstudy-package.Rd - M /pkg/man/inference.Ecar.Rd - M /pkg/man/inference.change.boot.Rd - M /pkg/man/remap.cumprod.Rd - M /pkg/man/remap.cumsum.Rd - M /pkg/man/remap.event.reindex.Rd - -Some more cleaning up of the documentation ------------------------------------------------------------------------- -r9 | ashim | 2011-09-13 11:16:18 +0530 (Tue, 13 Sep 2011) | 1 line -Changed paths: - M /pkg/R/eventstudy.R - -Added an error in case a factor is passed into events ------------------------------------------------------------------------- -r8 | ashim | 2011-09-13 10:33:14 +0530 (Tue, 13 Sep 2011) | 1 line -Changed paths: - M /pkg/R/eventstudy.R - -Now we may feed in a factor to events ------------------------------------------------------------------------- -r7 | vimsaa | 2011-09-13 10:30:49 +0530 (Tue, 13 Sep 2011) | 1 line -Changed paths: - A /pkg/inst - A /pkg/tests/eventstudy.R - -inst directory added. Ashim, the es_sim.R file with the Rnw should actually reside in here. Also, a symbolic link of the eventstudy.R file has been added to the test directory to run the test cases. ------------------------------------------------------------------------- -r6 | vimsaa | 2011-09-13 10:29:42 +0530 (Tue, 13 Sep 2011) | 1 line -Changed paths: - A /pkg/tests/data - A /pkg/tests/data/inr.rda - M /pkg/tests/subbarao.R - M /pkg/tests/test_eventstudy.R - -test directory fixed. Now it runs perfectly well. There are problems with R CMD check that are basic R formatting requirements. Ashim, over to you. ------------------------------------------------------------------------- -r5 | vimsaa | 2011-09-13 10:04:50 +0530 (Tue, 13 Sep 2011) | 1 line -Changed paths: - D /pkg/tests/es_sim.R - -Removed es_sim.R from the test directory. It takes too much time to check the package. This should be an Rnw. ------------------------------------------------------------------------- -r4 | ashim | 2011-09-12 18:20:39 +0530 (Mon, 12 Sep 2011) | 1 line -Changed paths: - M /pkg/man/eventstudy-package.Rd - M /pkg/man/inference.Ecar.Rd - M /pkg/man/inference.change.boot.Rd - M /pkg/man/remap.cumprod.Rd - M /pkg/man/remap.cumsum.Rd - M /pkg/man/remap.event.reindex.Rd - -Some cleaning up ------------------------------------------------------------------------- -r3 | vimsaa | 2011-09-12 17:08:00 +0530 (Mon, 12 Sep 2011) | 1 line -Changed paths: - M /pkg/R/eventstudy.R - D /pkg/man/a.Rd - D /pkg/man/p.Rd - D /pkg/man/rawres.Rd - -Some small changes made. Added library(boot) to eventstudy.R. Also removed some irrelevant Rd files. Ashim, can you fill up the Rd files? Once you are done with that I will add some self contained examples into the Rd files. We're off to a start... ------------------------------------------------------------------------- -r2 | ashim | 2011-09-12 10:55:48 +0530 (Mon, 12 Sep 2011) | 1 line -Changed paths: - A /pkg/DESCRIPTION - A /pkg/R - A /pkg/R/eventstudy.R - A /pkg/data - A /pkg/data/inr.rda - A /pkg/man - A /pkg/man/a.Rd - A /pkg/man/eventslist.Rd - A /pkg/man/eventstudy-package.Rd - A /pkg/man/inference.Ecar.Rd - A /pkg/man/inference.change.boot.Rd - A /pkg/man/p.Rd - A /pkg/man/phys2eventtime.Rd - A /pkg/man/rawres.Rd - A /pkg/man/remap.cumprod.Rd - A /pkg/man/remap.cumsum.Rd - A /pkg/man/remap.event.reindex.Rd - A /pkg/tests - A /pkg/tests/es_sim.R - A /pkg/tests/subbarao.R - A /pkg/tests/test_eventstudy.R - -The second version of event studies including a test case of Subbarao ------------------------------------------------------------------------- -r1 | stefan7th | 2010-09-10 15:12:37 +0530 (Fri, 10 Sep 2010) | 1 line -Changed paths: - A /README - A /pkg - A /www - A /www/index.php - -improved the README file and made some corrections to the index.php ------------------------------------------------------------------------- Modified: pkg/vignettes/ees.Rnw =================================================================== --- pkg/vignettes/ees.Rnw 2013-05-06 04:47:56 UTC (rev 68) +++ pkg/vignettes/ees.Rnw 2013-05-08 07:14:27 UTC (rev 69) @@ -11,10 +11,10 @@ \title{Introduction to the \textbf{extreme events} functionality} \author{Ajay Shah, Vimal Balasubramaniam and Vikram Bahure} \begin{document} -%\VignetteIndexEntry{eventstudies: A package with functionality to do Event Studies} -%\VignetteDepends{} -%\VignetteKeywords{event studies} -%\VignettePackage{eventstudies} +%\VignetteIndexEntry{eventstudies: Extreme events functionality} +% \VignetteDepends{} +% \VignetteKeywords{extreme event analysis} +% \VignettePackage{eventstudies} \maketitle \begin{abstract} The \textit{eventstudies} package includes an extreme events @@ -171,8 +171,7 @@ \caption{Extreme event on S\&P500 and response of NIFTY} \setkeys{Gin}{width=1\linewidth} \setkeys{Gin}{height=0.8\linewidth} -<>= -<> +<>= res <- deprintize(eesPlot)(z=eesData, response.series.name="nifty", event.series.name="sp500",titlestring="S&P500", ylab="(Cum.) change in NIFTY", prob.value=5, width=5) @ \end{center} Modified: pkg/vignettes/eventstudies.Rnw =================================================================== --- pkg/vignettes/eventstudies.Rnw 2013-05-06 04:47:56 UTC (rev 68) +++ pkg/vignettes/eventstudies.Rnw 2013-05-08 07:14:27 UTC (rev 69) @@ -155,8 +155,7 @@ \caption{Stock splits event and response of respective stock returns} \setkeys{Gin}{width=0.8\linewidth} \setkeys{Gin}{height=0.8\linewidth} -<>= -<> +<>= result <- inference.Ecar(z.e=es.cs, to.plot=TRUE) @ \end{center}