performance analysis in r
TRANSCRIPT
-
7/22/2019 Performance Analysis in R
1/50
Performance Analysis in R
Peter CarlBrian Peterson
Authors of PerformanceAnalytics
April 24, 2009
Chicago, IL
R/inance !or"shop
-
7/22/2019 Performance Analysis in R
2/50
24 Apr 2009 R/Finance 2009 2
#utline
Intro$uction
A%out PerformanceAnalytics
Performance Analysis
&ypes of Analysis
'easures an$ Calculations
'easuring Return Assessing Ris"
()aluating Relati)e Performance
(*amining +tyle (*posures
Appen$i* Buil$ing Bloc"s -ata
.raphics
&a%les
-
7/22/2019 Performance Analysis in R
3/50
24 Apr 2009 R/Finance 2009 3
A%out PerformanceAnalytics
Li%rary of econometric functions for performance an$ ris"analysis of financial portfolios
Aims to %e useful to %oth practitioners an$ researchersali"e
Analysis of return streams, hether $istri%ute$ normally ornot
In $e)elopment since early 2001, pac"age$ an$ firstrelease$ to CRA in 2003
o contains more than 50 functions an$ more than,000 lines of co$e an$ 3,600 lines of $ocumentation
Colla%oration, patches an$ suggestions from users inin$ustry an$ aca$emia orl$i$e
-
7/22/2019 Performance Analysis in R
4/50
24 Apr 2009 R/Finance 2009 4
PerformanceAnalytics
CRAN Version 0.9.7.1
+harpe7s +tyle Analysis
+nailtrail chart
8aR +ensiti)ity chart
'o$ifie$ (*pecte$ +hortfall
'ulti)ariate moments an$ris" metrics
igher co:moments
Ro%ust $ata cleaning
'any feer $epen$encies
#ther ne functions, %ugfi*es
Release 1.0
Component 8aR an$
Component (*pecte$+hortfall
!rappers of 8aR an$ (+functions for consistency
A$option of *ts for timeseries
Impro)e$ *:a*is han$ling incharts
ormatte$ ta%les in $e)ices Capture ratios an$ other
metrics
Bug fi*es, ne functions
-
7/22/2019 Performance Analysis in R
5/50
24 Apr 2009 R/Finance 2009 5
Analy;ing Performance in inance
!hat
-
7/22/2019 Performance Analysis in R
6/50
24 Apr 2009 R/Finance 2009 6
Performance Analysis in inance
!hat are e trying to accomplishhi$$en? ris"s, your mileage may )ary, more than one ayto s"in a cat, etc
-
7/22/2019 Performance Analysis in R
8/50
R/inance 2009 524 Apr 2009
Performance +ummary
o has the fun$/ strategy/portfolio performe$ in the pastnormal? losses %een in a $on perio$< At hat le)elshoul$ e set alarms for re:e)aluation of an asset in a portfolioormali;e$? is the same, %ut the coefficientssum to &he Kconstraine$K a$$s that the coefficientsmust %e %eteen 0 an$ &hat re=uires a =ua$raticprogramming algorithm, using solve.*Pfrom the@=ua$prog@ pac"age
ses R2for )aria%le selection Alternati)ely, e ha)e animplementation that uses AIC as a criterion:%ase$ metho$
for selecting style eights (mail us if you@re intereste$
-
7/22/2019 Performance Analysis in R
35/50
24 Apr 2009 R/Finance 2009 35
+harpe@s +tyle Analysis
G$atae$hecD
GchartRolling+tylemanagers,2,$ropHAL+(J,e$hec,J,
metho$HKconstraine$K, le)erageHAL+(, i$thH1, ce*legen$H 3, colorsetHrain%o2e=ual, lasHD
Apologies in a$)ance for the stac"e$ %ar chart
A much %etter alternati)e is to graph each factor eightseparately so that the )alues can %e rea$ easily an$ are
easier to compare
-
7/22/2019 Performance Analysis in R
36/50
24 Apr 2009 R/Finance 2009 36
&hings Left &o -o
&urther Research
Performance attri%ution an$ Portfolio Analytics
Ris" Bu$geting
Applications of Component Ris" to large portfolios
istorical portfolio frameor" in R
&ransactions an$ positions ith profit an$ loss Instrument properties an$ mo$el
Interfaces to $ata pro)i$er pac"ages
Practical Bayesian applications
Anything Y# ant to or" ith us on
!ank "ou for your attention
-
7/22/2019 Performance Analysis in R
37/50
24 Apr 2009 R/Finance 2009 37
Appen$i* &he Buil$ing Bloc"s
o
I t ll $ P f A l ti
-
7/22/2019 Performance Analysis in R
38/50
24 Apr 2009 R/Finance 2009 38
Install an$ se PerformanceAnalytics
&here are se)eral ays to install pac"ages, %ut theprefera%le ay to install them is through the CRA
repository !ithin an R session, you can type
G installpac"ages@PerformanceAnalytics@, $epH&R(D
#nce the pac"age is installe$, you nee$ to loa$ it into the
current or"space to use it seG li%raryPerformanceAnalyticsD
to loa$ the pac"age
Alternati)ely, un$er !in$os, use the @Pac"age@ menu an$
select @Li%rary@
R $i - t
-
7/22/2019 Performance Analysis in R
39/50
24 Apr 2009 R/Finance 2009 39
Rea$ing -ata
o $o I rea$ $ata from an (*cel sprea$sheet