[Uwgarp-commits] r51 - in pkg/GARPFRM: R sandbox/project_plan vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 24 19:50:13 CET 2014


Author: tfillebeen
Date: 2014-01-24 19:50:12 +0100 (Fri, 24 Jan 2014)
New Revision: 51

Modified:
   pkg/GARPFRM/R/capm.R
   pkg/GARPFRM/sandbox/project_plan/project_plan.pdf
   pkg/GARPFRM/sandbox/project_plan/project_plan.tex
   pkg/GARPFRM/vignettes/CAPM_TF.pdf
Log:
CAPM hypTest complete.

Modified: pkg/GARPFRM/R/capm.R
===================================================================
--- pkg/GARPFRM/R/capm.R	2014-01-24 17:05:21 UTC (rev 50)
+++ pkg/GARPFRM/R/capm.R	2014-01-24 18:50:12 UTC (rev 51)
@@ -121,7 +121,9 @@
   if(!inherits(object, "capm_uv")) stop("object must be of class capm_uv")
   tmp_sm <- summary.lm(object)
   # gets t-value, and p-value of model
-  return(coef(tmp_sm)[,c(3,4)])
+  result = coef(tmp_sm)[,c(2:4)]
+  rownames(result) = cbind(c(paste("alpha.", colnames(object$y_data))),c(paste("beta. ", colnames(object$y_data))))
+  return(result)
 }
 
 #' @method getStatistics capm_mv
@@ -169,5 +171,42 @@
   plot(betas,mu.hat,main="Estimated SML")
   abline(sml.fit)
   legend("topleft",1, "Estimated SML",1)                  
-  
+}
+
+#' CAPM hypthTest
+#' 
+#' Description of CAPM beta/alpha test
+#' 
+#' @param object a capm object created by \code{\link{CAPM}}
+#' @export
+hypTest <- function(object,CI){
+  UseMethod("hypTest")
+}
+
+#' @method hypTest capm_uv
+#' @S3method hypTest capm_uv
+hypTest.capm_uv <- function(object,CI = 0.05){
+  if(!inherits(object, "capm_uv")) stop("object must be of class capm_uv")
+  tmp_sm = getStatistics(object)
+  tmp_A = tmp_sm[1,3] < CI
+  tstat = (tmp_sm[2,2] - 1 )/tmp_sm[2,3]
+  #' Two sided t-test
+  tmp_B = (2*(1 - pt(abs(tstat),df=nrow(object$x_data)-2))) < CI
+  result = c(tmp_A, tmp_B)
+  result = as.matrix(result)
+  rownames(result) = cbind(c(paste("alpha.", colnames(object$y_data))),c(paste("beta. ", colnames(object$y_data))))
+  return(result)
+}
+
+#' @method hypTest capm_mv
+#' @S3method hypTest capm_mv
+hypTest.capm_mv <- function(object,CI = 0.05){
+  if(!inherits(object, "capm_mv")) stop("object must be of class capm_mv")
+  tmp_sm = getStatistics(object)
+  tmp_A = tmp_sm[seq(1,nrow(tmp_sm),2),4] < CI
+  tstat = (tmp_sm[seq(2,nrow(tmp_sm),2),1] - 1 )/tmp_sm[seq(2,nrow(tmp_sm),2),2]
+  #' Two sided t-test
+  tmp_B = (2*(1 - pt(abs(tstat),df=nrow(object$x_data)-2))) < CI
+  result = c(tmp_A, tmp_B)  
+  return(result)
 }
\ No newline at end of file

Modified: pkg/GARPFRM/sandbox/project_plan/project_plan.pdf
===================================================================
(Binary files differ)

Modified: pkg/GARPFRM/sandbox/project_plan/project_plan.tex
===================================================================
--- pkg/GARPFRM/sandbox/project_plan/project_plan.tex	2014-01-24 17:05:21 UTC (rev 50)
+++ pkg/GARPFRM/sandbox/project_plan/project_plan.tex	2014-01-24 18:50:12 UTC (rev 51)
@@ -63,6 +63,7 @@
 \item \verb"getBetas"
 \item \verb"getStatistics"
 \item \verb"plot"
+\item \verb"hypthTest"
 \end{itemize}
 
 Additional features

Modified: pkg/GARPFRM/vignettes/CAPM_TF.pdf
===================================================================
--- pkg/GARPFRM/vignettes/CAPM_TF.pdf	2014-01-24 17:05:21 UTC (rev 50)
+++ pkg/GARPFRM/vignettes/CAPM_TF.pdf	2014-01-24 18:50:12 UTC (rev 51)
@@ -469,25 +469,13 @@
 /Filter /FlateDecode
 >>
 stream
-xÚíY]oÛØ}篘Çø!¼ß_E°@bÇ»š&ˆ
-ìn
-?0íeW"]‘\¤ÿ¾g$+–,;âFV4¢\êÞ¹sÏœ™;3”Ird$y²ŽEI
-ÿ”"eHY© ñ!-©HZã£H»˜iM:<B&=ƒ™DÆVi¡Â²6’±d#Ä9…!’³XPäB̬&—aÂë i`ˆ0X` 2bÄѧB•2ª€%KX=”;à
-ÁfH ; ’Øä<°FŒ€¯ÙJàcÈX6ÊfK CÚJMF8˜$ŒÑ!ƒÚãKp°§|;:A¦è¤ûSŒLž‘£&8@…Ö’¢Jf b¬É ā‹ÈT©D	û‚ô”F°Ádb“°ž`¥W’åyÄ!˜²*…,Áiÿ1mÆ@Ö
-OàϲÓ$˜rÑ€I MôJhL&|
-Ç°Ó±'Á
-øœô8qà
-sòx D`x0ì@^räPŠ¹f/1ù>ñöÄÞUì7r1šLÁ/9²´ÅŒP°Õ+ Vˆ¯™QøØ[Íü`dä‰<‡ºˆø@!¾¼
-QB/–"t*‚gï+p$ïB¤ey&Q€ç5p£l…èÇ žà`6±
-/ó’…«•Ê^¼ qFâÇö¼%qBϺªìë¶ÉÕýðCöì´îûº¹¦ã—ïßm?˯vœUSLUúPõüé輞UtVÍëªÛ¡A/5¼îúzVô½þTV]·R´c³ÙLoÛI5=zÔÆÛóΫnœzeãñ¼*ØÄÅ!§C³XÞ±õ¾qgõuS_Õeє̈́½ªúwôïv(4[lÝlÏJßOÛþqnU·M7Ìnxêù;ø©YÙöEf+Fž?¸çYOҐ»ä
-/^dâü_7‰÷Åu•	ßãÌ׌3ûÛaßsÖZ̼­&uñªýD’“yr9’rŽÊcºÌ g¸3Ké—MÓBÝ'Z>Ùºåà—CXq9¤ÅàärPËA/‡%ðËlôB{&Άýâû_ëæ÷L¼jç“j¾€§.ÅOâ8¾`eò’í){ºˆ.ç„i’Í-²£
->W°ØJ—#¡Aì%}ù2>	
-äËœ3	1·‰›Î=Jš‰!76>cûš?-/s®bÆÀ`ȧÜ*¿Š> +s”­R:g™ÝPÌÓAYʼnÒyàBGq!1Úä~íÇÉAí0blž˜ „«wn#úq‚;hTÄýGc‚˜EÅۍ弸˜'îK"øAy×Úð˜{¶ÓöSF
-Ú¼\I†„Œ‚¯ÈŠ)¹/Š9 !
-Ý¥J Â.zÑ<yµ‹³(kåâ—_ÿNѲ@§FÓÓéåc¢~)êqѬŽµH}ZÒÊF¥q ”‡Ñnˆž¢Ä-X8Eçâm=äö1Ý>£góòö™BµšG˾ªŸüú`W{zÅÅ3ŽïçmyVÁ¨©'§$ΫOýýºu¯Øút¿ØúðÅöŽÇùíŽVv° WÏxÝ0Oegð÷ív/;ƒŸ¢Ëð@;H2cDQžs~³ÃÞcë³7{Qm±—öb/Êo2JâVëÍ×Û¹x?@v;á¾üÙÉ_´Ä;\©µ3ÊAi;ytí¼î§Xù@?΋›ßê²£wC3 gÃ&CYÍyôÝÖòÜѦ‰LáZBçI•‰¿3^ÓÈíEW-h?UÓ?ªï"™xݔ턻ù¤Ö-¡Ñ<¨ñù«v:yPí…xs|Ì;&”>½\;i%¿Ôùy·ø¹n^6]}·|R_]Up»
-¿³º:J^üsh{¼‹^õü²+&-XíºZ\Ï‹?*Q”C_‰²ž—ÃìjZ}}=TbV”ó¶çd°¥(KxWLjÑ՝ÈQ#'Õ•˜ãlQ"2¦ÓâóäoCs]̇ٴzÑ^·Mõ»(Ö×Ýeµ~Û£C6D—‰Áh^jFˆêˆÎ¹[çŠÇrß­_Þ}ü×}Þþf¦(Ä}®]ÚºvÉì•^ÒxbÓ6[MœOÿÝŒ›¶êrúSu™;Á{œÄñœÄq
-Õ>ôœ(¹'üûÜ׳ò¿ ù7ËCdè5½k)Z©ï-GóȶUYK
-ë`3)l¦Pþ	[ïu9ÔV‡Ë¿Pï•2øGï}Ú´uÖZ¶½“£ÒrÛÖø½'í“îô®'¾·D Òèº){×®)—FÉê¨r/í¡ú5ƒë²_%6ÛPÇ=“Nßä;¡2Û]‡9X×a¿lì7”l쁺û`×a¿»®ÃüGºþsñ˜®ãÂiGÿÿŒþ\fÿ{”Ù{
+xÚíYÛnÛF}çWìcüîýV;n4MhZÃµvØJ¤+’Aú÷=#Y±dYYm ˆ²Ôîìì™3³3CY2Á,Ó‚9f,‹,&ñOJ&5“ÆáäWø0%<“)…dʆL)¦¼Æ#`Ò1­1™vžT¨Ðš˜6̈yf%†À¬Á‚dÖ‡Ì(f£e˜pÊCÂ€q´Â©P%µƒê`Ñ0¬Ê-ðzo2¤-P	l²XFÀWd%ðd,kéfµ ÔŠ9aaž0Fùf(‡/ÞÂNœêñ=@ì¨y˜¢"zì!yZxŒŠiÀaT(%X0àAŠ@´ „Xpˆ*YÄ>/‹#Ø`2’IX°R+Aò4âL}á4…ÿˆ6­¡ë‡GðgÈiLYOhÀ$ÐF:4x">…cÈéØá
+	|V8Ž8°’ˆ†¹V:< ¢0<hr -Yf-’¸&/ù.ÒöHÞ•ä7fCЙ„NPd)ƒ!a«“ ,;N£ð±3ŠøÁHÈ#s8êà‰ørÎS@Ô½X
+Ð)Ž¼/Á•´‘楡™È<<¨5`KDŸ×8ñ“ÁˆUx™–\-eöä	ã'ŒÿØœ6Œ±Gm*»ª©syÀž>ÍW]WÕ—ìðÙ›WëÂýûÏò‹'iŒ©4boS×O떝V“ÄNÒ´Jí
+j®áEÛU“¢Kìŧ2µíBÑ–Íz0{ÕŒÒø`£×睦v˜jaãá4dâìã¾ž-oÙzÛ¸“ê²®.ª²¨ËÄŠzÄ{žº·ý¸k·(Ôkl]­OJߌ›n3×*›ºí'W4õø5üT/lû"½#ïÜs†¬'Ø[Æ!wNž<ÉøéßW‰ñ7ÅeÊ8Žïpf‹kF‚‡ýM?…ï)kÍf^¥QU<o>±3AÉ<ÚÉ
+9Gæ!žgÐ3…Ü™¹ô³ºn îŒ-lì|póÁχ0âl°b>Èù æÃøy¶z¦=ã'ýûnöýçªþ3ãÏ›é(Mgðä9ÿ‰¿ä‡g¤Lœ“=eÇ΂Í)aêhrƒì(½Ë%,6ÂæHh{ƾ|ïòeNHû›H…Må%MŸk~Íï‹9U1­áN0äbn¤ÛEíŠ9Ê€’1wTC­„³ôv(úþ ,âDªÜS!‚£¨h¥s7‹öÍq²BP{Œh“G"áê¬ÝƈÚGœàÎpÿј fQñ¶cÙ/6ä‘ú’ ~PÞ‚ÖorÏzÚ¾ÏHA›—KAQðY1FûÅ@Ñ{ D¢  »”D˜Y/šG'·¢We©\¼ûíw6³-t*ô0u?ŸousQ‡Ëˆfu€¨AêSrV2* |ŒÆpEô%nÆÂ1z<®ë!µñú=›×ÏÔÊÅ<ZöEý¤×³ØëÑ+Ξq3mÊ“o ¦3~š>u·ëÖ­bëâíbëü7Û.\æ·.`˜_Ø	üZ<ãuCß—Þݶӛìôvp|®ˆÎÃí<"IEyÎéÍb{KŒ-GÌÎì¹Æ^܉½ ¾Ë(	k­gÐßnçìý ÙíˆúòGG?(w2¸Ž²ñ J›ÑƵӪcå-ûqZ\}¨Ê–½î»«m<6êË4¥UTXÐwp}XCs«&…K	&eÆ)&´¦Û‹6Íhæ?¥ñÇÔá]$ã/ê²Q7å²E4ê;5>~ÞŒGwª=ã/iLjřOÏ—NZÈÏu~ÞÍ­êgu[Ý,U	. —¡á·|RÕ}Ë¢ãõM‡wÑ‹Ž^vù¨«m[ñËiñ1ñ¢ì»ÄËjZö“‹qúÄ»j<J|R”Ó¦æï§	2ØR”%¼ËGŽh«–稑£tÁ§8›—ˆŒñ¸ø<ù¡¯/‹i?}Ǜ˦Nò² }íUQ¦åÛÌà²":OZ!øðR3 at TÔ8p¾ánݝ+6åº[ï^¿ÿƒê>m9‘̇]®]\»vQï”^âpbã:[Mœ‹ÿmƍku9~U]¦Nð'a8'aXCµK}'R¬Å	ý>÷í¬|!Ak!6&èùÚw’ é7Ë}dè%½K)Zʇ–£éä¯mU–’ÂòXM
+«)”~ÂV;]¹ÖáÒ/Ô;¥úÑ{—6m™‡¥–mçä(•X·5<ôD Ü~ÁÞåD üCK2. «²7íš´q¬
+2wÂì«_Ó¸.»Ub½~UØ1Ù¨ø]¾J½Þuèßu˜=uæήÃ<¸®Cÿ+]ý¹xH×qf•eÿγ  tÙk
 endstream
 endobj
 156 0 obj <<
@@ -2398,8 +2386,8 @@
 endobj
 183 0 obj <<
 /Author()/Title()/Subject()/Creator(LaTeX with hyperref package)/Producer(pdfTeX-1.40.14)/Keywords()
-/CreationDate (D:20140122225314-08'00')
-/ModDate (D:20140122225314-08'00')
+/CreationDate (D:20140122233301-08'00')
+/ModDate (D:20140122233301-08'00')
 /Trapped /False
 /PTEX.Fullbanner (This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013) kpathsea version 6.1.1)
 >> endobj
@@ -2454,7 +2442,7 @@
 /W [1 3 1]
 /Root 182 0 R
 /Info 183 0 R
-/ID [<8D56C4D2F34A36A5F8E1AD1E16AC70DD> <8D56C4D2F34A36A5F8E1AD1E16AC70DD>]
+/ID [<983044C3BDAC1E7E19B21547BBFEED69> <983044C3BDAC1E7E19B21547BBFEED69>]
 /Length 475       
 /Filter /FlateDecode
 >>



More information about the Uwgarp-commits mailing list