[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Ï;3Ird$y²EI
-ÿ"eHY© ñ!-©HZã£H»iM:<B&=DÆVi¡Â²6±d#Ä9
!³XPäB̬&aÂë i`0X` 2bÄѧB2ª%KX=;à
-ÁfH ; Øä<°F¯ÙJàcÈX6ÊfK CÚJMF8$Ñ!ÚãKp°§|;:A¦è¤ûSL£&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ì7r1LÁ/9²´ÅP°Õ+ V¯QøØ[Íü`dä<ºø@!¾¼
-QB/"t*gï+p$ïB¤ey&Qç5p£l
èÇ à`6±
-/ó
«Ê^¼ qFâÇö¼%qBϺªìë¶ÉÕýðCöì´îûº¹¦ãïßm?˯vUSLUúPõüéè¼UtVÍëªÛ¡A/5¼îúzVô½þTV]·R´c³ÙLoÛI5=zÔÆÛóΫnzeãñ¼*ØÄÅ!§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ñªýDyr9rÊ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ÆÀ`ȧÜ*¿> +sRî¹:gÝPÌÓAYÅÒyàBGq!1Úä~íÇÉAí0bl «wn#úq;hTÄýGcEÅÛ弸'î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/;¢Ëð@;H2cDQs~³ÃÞ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\Ï?*QC_²ÃìjZ}}=TbVó¶çd°¥(KxWLjÑÕÈQ#'ÕãlQ"2¦ÓâóäoCs]ÌÙ´zÑ^·Mõ»(Ö×Ýeµ~Û£C6DÁh^jFêι[çÇrß_Þ}ü×}Þþf¦(Ä}®]ÚºvÉì^ÒxbÓ6[MOÿݶê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ì7lìºû`×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)¦¼Æ#`Ò11vT¨Ð6Ìyf%À¬ÁdÖÌ(f£epÊCÂq´Â©P%µê`Ñ0¬Ê-ðzo2¤-P l²XFÀWd%ðd,kéfµ Ã9aa0Fùf(/ÞÂNêñ=@ì¨y¢"zì!yZxiÀaT(%X0àA@´ Xp*YÄ>/#Ø`2IX°R+Aò4âL}á4
ÿ6¡ëGðgÈiLYOhÀ$ÐF:4x">
cÈéØá
+ |V88°¹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{ÕÒø`£×ç¦vjaãá4dâìã¾-oÙz۸겮.ª²¨ËÄzÄ{º·ý¸k·(Ôkl]OJßn3×*ºí'W4õø5üT/lû"½#ïÜs¬'Ø[Æ!wN<ÉøéßWñ7ÅeÊ8ïpfkFý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å%Mkî±~Íï9U1áN0äbn¤ÛEí9Ê1wTC³ôv(úþ ,âDªÜS!£¨h¥s7öÍq²BP{hG"áê¬ÝÆÚGàÎpÿÑ fQñ¶cÙ/6äú ~PÞÖorÏzÚ¾ÏHAKAQðY1FûÅ@Ñ{ D¢ »DY/G'·¢We©\¼ûíw6³-t*ô0u?ousQËfu¨AêSrV2* |ÆpEô%nÆÂ1z<®ë!µñú=×ÏÔÊÅ<ZöEý¤×³ØëÑ+Îq3mÊo ¦3~>u·ëÖbëâíbëü7Û.\æ·.`_Ø Ã¼Z<ãuCßÞݶÓìôvp|®ÎÃí<"IEyÎéÍb{K-GÌÎì¹Æ^ܽ ¾Ë( kgÐßnçìý ÙíúòGG?(w2¸²ñ JÑƵӪcå-ûqZ\}¨Ê½î»«m<6êË4¥UTXÐwp}XCs«&
K &eÆ)&´¦Û6Íhæ?¥ñÇÔá]$ã/ê²Q7å²E4ê;5>~ÞGwª=ã/iÇÅOÏNZÈÏu~ÞÍêgu[Ý,U . ¡á·|RÕ}Ë¢ãõMwÑ^vù¨«m[ñËiñ1ñ¢ì»ÄËjZöqúÄ»j<J|RÓ¦æï§ 2ØR%¼ËGh«ç¨£tÁ§8ñ¸ø<ù¡¯/i?}Ç˦Nò² }íUQ¦åÛÌà²":OZ!øð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×qfeÿγ 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