Movatterモバイル変換


[0]ホーム

URL:


BLCOP

R-CMD-check

The{BLCOP} package is an implementation of theBlack-Litterman and copula opinion pooling frameworks. TheBlack-Litterman model was devised in 1992 by Fisher Black and RobertLitterman. Their goal was to create a systematic method of specifyingand then incorporating analyst/portfolio manager views into theestimation of market parameters.

Installation

You can install the released version of BLCOP fromCRAN with:

install.packages("BLCOP")

And the development version fromGitHub with:

# install.packages("devtools")devtools::install_github("MangoTheCat/BLCOP")

Example

library(BLCOP)# For a matrix of monthly returns for 6 assetshead(monthlyReturns)#>                     IBM          MS        DELL             C          JPM          BAC#> 1998-02-02  0.057620253  0.19578623  0.40667739  0.1224778047  0.157384084  0.143954576#> 1998-03-02 -0.005457679  0.04383326 -0.51565628  0.0785547367  0.087215863  0.064817518#> 1998-04-01  0.115529027  0.08233841  0.19188192  0.0198333333  0.027283511  0.041952290#> 1998-05-01  0.014067489 -0.01027006  0.02055728  0.0009805524 -0.018908776 -0.006578947#> 1998-06-01 -0.022893617  0.17050986  0.12619828 -0.0101224490 -0.444607915  0.015761589#> 1998-07-01  0.154080655 -0.04717084  0.17002478  0.1091868712  0.001589404  0.039900900# Define a pick matrix (a vector of confidences)pickMatrix<-matrix(c(1/2,-1,1/2,0,0,0),nrow =1,ncol =6)# Create a views objectviews<-BLViews(P = pickMatrix,q =0.06,confidences =100,assetNames =colnames(monthlyReturns))# Determine the posterior distribution of these assetsBLPosterior(monthlyReturns, views,tau =1/2,marketIndex = sp500Returns)#> Prior means:#>          IBM           MS         DELL            C          JPM          BAC#>  0.002269870  0.005799591 -0.001161339  0.001718354 -0.009042287  0.005472691#> Posterior means:#>          IBM           MS         DELL            C          JPM          BAC#>  0.009795730 -0.016744179  0.014453759 -0.004741680 -0.015465517  0.001505639#> Posterior covariance:#>              IBM          MS        DELL           C        JPM         BAC#> IBM  0.022113337 0.011762652 0.013388809 0.009418743 0.01189892 0.006017050#> MS   0.011762652 0.033040555 0.018441735 0.014076656 0.01650328 0.009143918#> DELL 0.013388809 0.018441735 0.048344919 0.008453909 0.01088555 0.005957519#> C    0.009418743 0.014076656 0.008453909 0.017307957 0.01246270 0.007215142#> JPM  0.011898924 0.016503281 0.010885549 0.012462701 0.03032755 0.012937189#> BAC  0.006017050 0.009143918 0.005957519 0.007215142 0.01293719 0.011893184

[8]ページ先頭

©2009-2025 Movatter.jp