13.07.2015 Views

Computational Finance and Financial Engineering: The R/Rmetrics ...

Computational Finance and Financial Engineering: The R/Rmetrics ...

Computational Finance and Financial Engineering: The R/Rmetrics ...

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Computational</strong> <strong>Finance</strong> <strong>and</strong> <strong>Financial</strong> <strong>Engineering</strong>:<strong>The</strong> R/<strong>Rmetrics</strong> Software EnvironmentDiethelm Würtz <strong>and</strong> Yohan ChalabiITP ETH Zürich, <strong>Finance</strong> Online GmbH ZürichuseR! 2008


Introduction …What is <strong>Rmetrics</strong> ?… Open Source Software Development for Statistical <strong>and</strong> <strong>Financial</strong> Computing<strong>Rmetrics</strong>is a system of R packages for computational finance <strong>and</strong> financial engineering.It is based on the R language <strong>and</strong> the R run-time environment.<strong>Rmetrics</strong>is designed as anOpen Source Environment <strong>and</strong> as aRapid Model Prototyping System forTeaching “<strong>Computational</strong> <strong>Finance</strong> <strong>and</strong> <strong>Financial</strong> <strong>Engineering</strong>”.R/<strong>Rmetrics</strong> – Diethelm WürtzSeite 2


<strong>Rmetrics</strong> PackagesWhich Packages are Coming with <strong>Rmetrics</strong> ?… 20 R Packages, 1’600 R Functions, 80’000 lines of R Code<strong>Rmetrics</strong>fUtilitiesfEcofinfCalendar / timeDatefSeries / timeSeriesfImportfBasicsfArmafGarchfNonlinearfUnitRootsfTradingfMultivarfRegressionfExtremesfCopulaefOptionsfExoticOptionsfAsianOptionsfAssetsfPortfolio<strong>Rmetrics</strong> Package Graph by Dirk EddelbuettelR/<strong>Rmetrics</strong> – Diethelm WürtzSeite 3


R/<strong>Rmetrics</strong> HomepagesFrom where I can get Information on R / <strong>Rmetrics</strong> ?… visit the CRAN <strong>and</strong> <strong>Rmetrics</strong> ServersDownload the <strong>Rmetrics</strong>Packages from CERANwww.r-project.orgVisit the home of<strong>Rmetrics</strong>:www.rmetrics.orgR/<strong>Rmetrics</strong> – Diethelm WürtzSeite 4


R-sig-<strong>Finance</strong>Where I can get help for R/<strong>Rmetrics</strong>’ <strong>Financial</strong> Applications ?… join the R-sig-finance – Special Interest Group for ‘R in <strong>Finance</strong>’Where todiscuss <strong>and</strong> find help onR/<strong>Rmetrics</strong> ?https://stat.ethz.ch/mailman/listinfo/r-sig-financeThanks to Martin MächlerR/<strong>Rmetrics</strong> – Diethelm WürtzSeite 5


R-Forge<strong>The</strong> most recent <strong>Rmetrics</strong> ?… get it from the R-forge ServerWhere to get the most recentversions of the <strong>Rmetrics</strong>Packages?Goto to the SVN repository of<strong>Rmetrics</strong>, part ofhttps://r-forge.r-project.orgThanks to Kurt Hornik,Stefan <strong>The</strong>ussl for R-forge, <strong>and</strong> Martin Mächler <strong>and</strong> Yohan Chalabi for the move to R-forgeR/<strong>Rmetrics</strong> – Diethelm WürtzSeite 6


<strong>Rmetrics</strong> - WorkshopR/<strong>Rmetrics</strong> – Diethelm Würtz Seite 7Next WorkshopJune 28th – July 2nd 2009


Volatility ForecastingExample 1: ARMA-GARCH ModelingModeling <strong>and</strong> Forecasting VolatilityfGARCHSP500 ARMA -APARCH ModelingDiagnosticAnalysis:VolatilityForecasts:Residual Tests, ARCH Tests, IC Statistics, 11 Diagnostic PlotsR/<strong>Rmetrics</strong> – Diethelm WürtzSeite 8


Expected Shortfall RiskExample 2: Extreme Value <strong>The</strong>oryRobust Estimation of VaR <strong>and</strong> Expected ShortfallfExtremesExtreme Value <strong>The</strong>ory: Value-at-Risk <strong>and</strong> Expected Shortfall are estimated from the GPDDanish Fire LossesGPDOBREOptimal Bias Reduced EstimatorR/<strong>Rmetrics</strong> – Diethelm WürtzSeite 9


Dependence StructuresExample 3: Bivariate CopulaeEstimating Pairwise Lower Tail DependencefCopulaePictet Swiss Pension Fund PortfolioTail Dependence:Lower UpperSBI SPI 0 0SBI SII 0.055 0SBI LMI 0.064 0.069SBI MPI 0 0SBI ALT 0 0SPI SII 0 0.064SPI LMI 0 0.072SPI MPI 0.352 0.214SPI ALT 0.273 0.048SII LMI 0.075 0SII MPI 0 0.164LMI MPI 0 0LMI ALT 0 0MPI ALT 0.124 0.012SBI CH BondsSPI CH StocksSII CH ImmoLMI World BondsMPI World StocksALT World AltInvestR/<strong>Rmetrics</strong> – Diethelm WürtzSeite 10


Term StructureExample 4: Term Structure Modeling… Nelsen-Siegel-Svenson Estimation for the Zero RatesfBondsObjective Function: non-convex!Search for the Global MinimumCalibration• Find for all maturities τ 1,2the best solution for thecoefficients β• Take this value as startingpoint for the nonlinear(least square) solver.R/<strong>Rmetrics</strong> – Diethelm WürtzSeite 11


Stock Sector RotationExample 5: Vontobel German Sector Rotation IndexISIN CH0026834058fPortfolioSectors: Auto, Banks, Chemicals, Basic Resources, Food & Beverage, Insurance, Transport &Logistics, Industrial, Construction Performance, Pharmacy & Healthcare UtilitiesRebalancing: QuarterlyBuild a Portfolio onthe SPI Universe:R/<strong>Rmetrics</strong> – Diethelm WürtzSeite 12


Dynamic Asset Allocation<strong>The</strong>ta Fund Managment, ZürichDominik LocherdynAAx FIX dynAAx TRACKER dynAAx FLEX• Constant risk Index • Tracking the risk or return ofa known benchmark• An Index following aninvestment strategy ...BenchmarkR/<strong>Rmetrics</strong> – Diethelm Würtz


Advisory ServicesR/<strong>Rmetrics</strong> – Diethelm Würtz Seite 14


SummaryConsider R/<strong>Rmetrics</strong> as a competitive <strong>and</strong>unique rapid model prototyping environment ineducation <strong>and</strong> even for business applicationsThank YouDiethelm Würtzwuertz@ethz.chR/<strong>Rmetrics</strong> – Diethelm WürtzSeite 15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!