全部版块 我的主页
论坛 金融投资论坛 六区 金融实务版
11981 31
2009-09-04
用R寫的一本投資組合的書,A new Ebook on Portfolio in R:

Portfolio Optimization with R/R metrics

Part I Managing Data Sets of Assets 3
Introduction 5
1 Generic Functions to Manipulate Assets 7
1.1 timeDate and timeSeries Objects . . . . . . . . . . . . . . . . . . . . 8
1.2 Loading timeSeries Data Sets . . . . . . . . . . . . . . . . . . . . . . 9
1.3 Sorting and Reverting Assets . . . . . . . . . . . . . . . . . . . . . . 11
1.4 Alignment of Assets . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.5 Binding and Merging Assets . . . . . . . . . . . . . . . . . . . . . . 15
1.6 Subsetting Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.7 Aggregating Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.8 Rolling Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2 Financial Functions to Manipulate Assets 31
2.1 Price and Index Series . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.2 Return and Cumulated Return Series . . . . . . . . . . . . . . . . . 32
2.3 Drawdowns Series . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.4 Durations Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.5 How to Add Your Own Functions . . . . . . . . . . . . . . . . . . . 36
3 Basic Statistics of Financial Assets 41
3.1 Summary Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.2 Sample Mean and Covariance Estimates . . . . . . . . . . . . . . . . 44
3.3 Estimates for Higher Moments . . . . . . . . . . . . . . . . . . . . . 46
3.4 Quantiles and Related Risk Measures . . . . . . . . . . . . . . . . . 47
3.5 Computing Column Statistics . . . . . . . . . . . . . . . . . . . . . 49
3.6 Computing Cumulated Column Statistics . . . . . . . . . . . . . . . 50
4 Robust Mean and Covariance Estimates of Assets 51
4.1 Robust Covariance Estimators . . . . . . . . . . . . . . . . . . . . . 52
4.2 Comparisons of Robust Covariances . . . . . . . . . . . . . . . . . . 54
4.3 Minimum Volume Ellipsoid Estimator . . . . . . . . . . . . . . . . . 54
4.4 Minimum Covariance Determinant Estimator . . . . . . . . . . . . . 55
4.5 Orthogonalized Gnanadesikan-Kettenring Estimator . . . . . . . . . . 59
4.6 Nearest-Neighbour Variance Estimator . . . . . . . . . . . . . . . . . 59
4.7 Shrinkage Estimator . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4.8 Bagging Estimator . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
4.9 How to Add a New Estimator to the Suite . . . . . . . . . . . . . . . 63
4.10 How to Detect Outliers in a Set of Assets . . . . . . . . . . . . . . . 64
Part II Exploratory Data Analysis of Assets 67
Introduction 6
Contents xix
5 Plotting Financial Time Series And Their Properties 71
5.1 Financial Time Series Plots . . . . . . . . . . . . . . . . . . . . . . . 71
5.2 Box Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.3 Histogram and Density Plots . . . . . . . . . . . . . . . . . . . . . . 87
5.4 Quantile-Quantile Plots . . . . . . . . . . . . . . . . . . . . . . . . 90
6 Customization of Plots 95
6.1 Plot Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
6.2 More About Plot Function Arguments . . . . . . . . . . . . . . . . . 98
6.3 Selecting Colours . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
6.4 Selecting Character Fonts . . . . . . . . . . . . . . . . . . . . . . . . 109
6.5 Selecting Plot Symbols . . . . . . . . . . . . . . . . . . . . . . . . . 112
7 Modelling Asset Returns 117
7.1 Testing Asset returns for Normality . . . . . . . . . . . . . . . . . . 117
7.2 Fitting Asset returns . . . . . . . . . . . . . . . . . . . . . . . . . . 120
7.3 Simulating Asset Returns from a given Distribution . . . . . . . . . . 123
8 Selecting Similar or Dissimilar Assets 125
8.1 Functions for Grouping Similar Assets . . . . . . . . . . . . . . . . . 125
8.2 Grouping Asset Returns by Hierarchical Clustering . . . . . . . . . . 126
8.3 Grouping Asset Returns by k-means Clustering . . . . . . . . . . . . 131
8.4 Grouping Asset Returns through Eigenvalue Analysis . . . . . . . . . 133
8.5 Grouping Asset Returns by Contributed Cluster Algorithms . . . . . . 133
8.6 Ordering Data Sets of Assets . . . . . . . . . . . . . . . . . . . . . . 137
9 Comparing Multivariate Return and Risk Statistics 139
9.1 Star and Segment Plots . . . . . . . . . . . . . . . . . . . . . . . . . 139
9.2 Segment Plots of Basic Return Statistics . . . . . . . . . . . . . . . . 141
9.3 Segment Plots of Distribution Moments . . . . . . . . . . . . . . . . 141
9.4 Segment Plots of Box Plot Statistics . . . . . . . . . . . . . . . . . . . 144
9.5 How to Position Stars and Segments in Star Plots . . . . . . . . . . . 144
10 Pairwise Dependencies of Assets 147
10.1 Simple Pairwise Scatter Plots of Assets . . . . . . . . . . . . . . . . . 147
10.2 Pairwise Correlations Between Assets . . . . . . . . . . . . . . . . . 152
10.3 Tests of Pairwise Correlations . . . . . . . . . . . . . . . . . . . . . 156
10.4 Image Plot of Correlations . . . . . . . . . . . . . . . . . . . . . . . 157
10.5 Bivariate Histogram Plots . . . . . . . . . . . . . . . . . . . . . . . 159
Part III Portfolio Framework 165
Introduction 167
11 S4 Portfolio Specification Class 169
11.1 Class Representation . . . . . . . . . . . . . . . . . . . . . . . . . . 169
11.2 The Model Slot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
11.3 The Portfolio Slot . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
11.4 The Optim Slot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
11.5 The Message Slot . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
11.6 Consistency Checks on Specifications . . . . . . . . . . . . . . . . . 188
12 S4 Portfolio Data Class 189
12.1 Class Representation . . . . . . . . . . . . . . . . . . . . . . . . . . 189
12.2 The Data Slot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
12.3 The Statistics Slot . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
13 S4 Portfolio Constraints Class 197
13.1 Class Representation . . . . . . . . . . . . . . . . . . . . . . . . . . 197
13.2 Long-Only Constraint String . . . . . . . . . . . . . . . . . . . . . . 200
13.3 Unlimited Short Selling Constraint String . . . . . . . . . . . . . . . 202
13.4 Box Constraint Strings . . . . . . . . . . . . . . . . . . . . . . . . . 202
13.5 Group Constraint Strings . . . . . . . . . . . . . . . . . . . . . . . . 204
13.6 Covariance Risk Budget Constraint Strings . . . . . . . . . . . . . . . 205
13.7 Non-Linear Weight Constraint Strings . . . . . . . . . . . . . . . . . 207
13.8 Case study: How To Construct Complex Portfolio Constraints . . . . . 208
14 Portfolio Functions 213
14.1 S4 Class Representation . . . . . . . . . . . . . . . . . . . . . . . . 213
附件列表

fPortfolio.rar

大小:4.82 MB

只需: 10 个论坛币  马上下载

本附件包括:

  • fPortfolio_clean.pdf

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2009-10-10 06:27:04
Thanks a lot.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-11-24 15:41:33
Thanks !!!!!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-11-24 23:35:16
这么好的书怎么没有人顶?大大力的顶!!!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-11-25 00:17:43
thanks very much, it is just i want!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-11-25 00:19:33
建议版主奖励!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群