viii Contents
Using the quantmod package ............................... 64
Charting with quantmod .................................. 65
Graphing with ggplot2 .................................... 67
Summary ............................................. 70
4 Basic Statistics and Probability .............................. 71
Whatisastatistic? ....................................... 71
Populationversussample .................................. 71
CentralLimitTheoreminR ................................ 74
Unbiasednessandefficiency ................................ 76
Probabilitybasics........................................ 83
Randomvariables ....................................... 83
Probabilities ........................................... 84
Probabilitydistributions................................... 85
Bayesversusfrequentistapproach ............................ 87
Simulationsofcoins...................................... 88
On the use of RStan ...................................... 90
Summary ............................................. 90
5 Intermediate Statist ics and Probability ......................... 91
Randomprocess ........................................ 91
Stockpricedistributions................................... 92
Stationarity............................................ 95
Determining stationarity with urca ........................... 98
Assumptionsofnormality.................................. 99
Correlation............................................103
Filteringdata...........................................105
Rformulas ............................................107
Thelinearinlinearregression ...............................112
Volatility..............................................114
Summary .............................................117
6 Spreads, Betas and Risk ...................................119
Definingthestockspread ..................................119
OrdinaryLeastSquaresversusTotalLeastSquares .................121
Constructingthespread ...................................123
Signalgenerationandvalidation .............................126
Tradingthespread.......................................132
Consideringtherisk......................................137
Moreontheequitycurve ..................................138
Strategyattributes .......................................143
Summary .............................................144
7 Backtesting with Quantstrat ................................147
Backtesting methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
About blotter and PerformanceAnalytics .......................149
评论0
最新资源