Finance {gmm} | R Documentation |
Returns on selected stocks, the Market portfolio and factors of Fama and French for CAPM and APT analysis
data(Finance)
A list of six daily time series from 1993-01-05 to 2009-01-30 in matrix format. Dates are reported as rownames()
http://ca.finance.yahoo.com/ and http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/
data(Finance) ## CAPM test with GMM r <- Finance$r rm <- Finance$rm rf <- Finance$rf z <- r-rf t <- nrow(z) zm <- rm-rf h <- matrix(zm,t,1) res <- gmm(z~zm,x=h) R <- cbind(diag(10),matrix(0,10,10)) c <- matrix(0,10,1) lintest(res,R,c) ## APT test with Fama-French factors and GMM r <- Finance$r rm <- Finance$rm rf <- Finance$rf z <- r-rf f1 <- rm-rf f2 <- Finance$hml-rf f3 <- Finance$smb-rf h <- cbind(f1,f2,f3) res2 <- gmm(z~f1+f2+f3,x=h) R <- cbind(diag(10),matrix(0,10,30)) c <- matrix(0,10,1) lintest(res2,R,c)