Package: Dowd 0.12

Dowd: Functions Ported from 'MMR2' Toolbox Offered in Kevin Dowd's Book Measuring Market Risk

'Kevin Dowd's' book Measuring Market Risk is a widely read book in the area of risk measurement by students and practitioners alike. As he claims, 'MATLAB' indeed might have been the most suitable language when he originally wrote the functions, but, with growing popularity of R it is not entirely valid. As 'Dowd's' code was not intended to be error free and were mainly for reference, some functions in this package have inherited those errors. An attempt will be made in future releases to identify and correct them. 'Dowd's' original code can be downloaded from www.kevindowd.org/measuring-market-risk/. It should be noted that 'Dowd' offers both 'MMR2' and 'MMR1' toolboxes. Only 'MMR2' was ported to R. 'MMR2' is more recent version of 'MMR1' toolbox and they both have mostly similar function. The toolbox mainly contains different parametric and non parametric methods for measurement of market risk as well as backtesting risk measurement methods.

Authors:Dinesh Acharya <[email protected]>

Dowd_0.12.tar.gz
Dowd_0.12.zip(r-4.5)Dowd_0.12.zip(r-4.4)Dowd_0.12.zip(r-4.3)
Dowd_0.12.tgz(r-4.4-any)Dowd_0.12.tgz(r-4.3-any)
Dowd_0.12.tar.gz(r-4.5-noble)Dowd_0.12.tar.gz(r-4.4-noble)
Dowd_0.12.tgz(r-4.4-emscripten)Dowd_0.12.tgz(r-4.3-emscripten)
Dowd.pdf |Dowd.html
Dowd/json (API)

# Install 'Dowd' in R:
install.packages('Dowd', repos = c('https://d-acharya.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/d-acharya/dowd/issues

On CRAN:

147 exports 0.63 score 46 dependencies 152 scripts 254 downloads

Last updated 9 years agofrom:e34fa92b86. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 06 2024
R-4.5-winOKSep 06 2024
R-4.5-linuxOKSep 06 2024
R-4.4-winOKSep 06 2024
R-4.4-macOKSep 06 2024
R-4.3-winOKSep 06 2024
R-4.3-macOKSep 06 2024

Exports:AdjustedNormalESHotspotsAdjustedNormalVaRHotspotsAdjustedVarianceCovarianceESAdjustedVarianceCovarianceVaRADTestStatAmericanPutESBinomialAmericanPutESSimAmericanPutPriceBinomialAmericanPutVaRBinomialBinomialBacktestBlackScholesCallESSimBlackScholesCallPriceBlackScholesPutESSimBlackScholesPutPriceBlancoIhleBacktestBootstrapESBootstrapESConfIntervalBootstrapESFigureBootstrapVaRBootstrapVaRConfIntervalBootstrapVaRFigureBoxCoxESBoxCoxVaRCdfOfSumUsingGaussianCopulaCdfOfSumUsingGumbelCopulaCdfOfSumUsingProductCopulaChristoffersenBacktestForIndependenceChristoffersenBacktestForUnconditionalCoverageCornishFisherESCornishFisherVaRDBPensionVaRDCPensionVaRDefaultRiskyBondVaRFilterStrategyLogNormalVaRFrechetESFrechetESPlot2DClFrechetVaRFrechetVaRPlot2DClGaussianCopulaVaRGParetoESGParetoMEFPlotGParetoMultipleMEFPlotGParetoVaRGumbelCopulaVaRGumbelESGumbelESPlot2DClGumbelVaRGumbelVaRPlot2DClHillEstimatorHillPlotHillQuantileEstimatorHSESHSESDFPercHSESFigureHSESPlot2DClHSVaRHSVaRDFPercHSVaRESPlot2DClHSVaRFigureHSVaRPlot2DClInsuranceVaRInsuranceVaRESJarqueBeraBacktestKernelESBoxKernelKernelESEpanechinikovKernelKernelESNormalKernelKernelESTriangleKernelKernelVaRBoxKernelKernelVaREpanechinikovKernelKernelVaRNormalKernelKernelVaRTriangleKernelKSTestStatKuiperTestStatLogNormalESLogNormalESDFPercLogNormalESFigureLogNormalESPlot2DCLLogNormalESPlot2DHPLogNormalESPlot3DLogNormalVaRLogNormalVaRDFPercLogNormalVaRETLPlot2DCLLogNormalVaRFigureLogNormalVaRPlot2DCLLogNormalVaRPlot2DHPLogNormalVaRPlot3DLogtESLogtESDFPercLogtESPlot2DCLLogtESPlot2DHPLogtESPlot3DLogtVaRLogtVaRDFPercLogtVaRPlot2DCLLogtVaRPlot2DHPLogtVaRPlot3DLongBlackScholesCallVaRLongBlackScholesPutVaRLopezBacktestMEFPlotNormalESNormalESConfidenceIntervalNormalESDFPercNormalESFigureNormalESHotspotsNormalESPlot2DCLNormalESPlot2DHPNormalESPlot3DNormalQQPlotNormalQuantileStandardErrorNormalSpectralRiskMeasureNormalVaRNormalVaRConfidenceIntervalNormalVaRDFPercNormalVaRFigureNormalVaRHotspotsNormalVaRPlot2DCLNormalVaRPlot2DHPNormalVaRPlot3DPCAESPCAESPlotPCAPrelimPCAVaRPCAVaRPlotPickandsEstimatorPickandsPlotProductCopulaVaRShortBlackScholesCallVaRShortBlackScholesPutVaRStopLossLogNormalVaRtEStESDFPerctESFiguretESPlot2DCLtESPlot2DHPtESPlot3DTQQPlottQuantileStandardErrortVaRtVaRDFPerctVaRESPlot2DCLtVaRFiguretVaRPlot2DCLtVaRPlot2DHPtVaRPlot3DVarianceCovarianceESVarianceCovarianceVaR

Dependencies:bootstrapclicolorspacecurlfansifarverforecastfracdiffgenericsggplot2gluegtableisobandjsonlitelabelinglatticelifecyclelmtestmagrittrMASSMatrixmgcvmunsellnlmennetpillarpkgconfigquadprogquantmodR6RColorBrewerRcppRcppArmadillorlangscalestibbletimeDatetseriesTTRurcautf8vctrsviridisLitewithrxtszoo

Readme and manuals

Help Manual

Help pageTopics
R-version of Kevin Dowd's MATLAB Toolbox from book "Measuring Market Risk".Dowd-package
Hotspots for ES adjusted by Cornish-Fisher correctionAdjustedNormalESHotspots
Hotspots for VaR adjusted by Cornish-Fisher correctionAdjustedNormalVaRHotspots
Cornish-Fisher adjusted Variance-Covariance ESAdjustedVarianceCovarianceES
Cornish-Fisher adjusted variance-covariance VaRAdjustedVarianceCovarianceVaR
Plots cumulative density for AD test and computes confidence interval for AD test stat.ADTestStat
Estimates ES of American vanilla put using binomial tree.AmericanPutESBinomial
Estimates ES of American vanilla put using binomial option valuation tree and Monte Carlo SimulationAmericanPutESSim
Binomial Put PriceAmericanPutPriceBinomial
Estimates VaR of American vanilla put using binomial tree.AmericanPutVaRBinomial
Carries out the binomial backtest for a VaR risk measurement model.BinomialBacktest
ES of Black-Scholes call using Monte Carlo SimulationBlackScholesCallESSim
Price of European Call OptionBlackScholesCallPrice
ES of Black-Scholes put using Monte Carlo SimulationBlackScholesPutESSim
Price of European Put OptionBlackScholesPutPrice
Blanco-Ihle forecast evaluation backtest measureBlancoIhleBacktest
Bootstrapped ES for specified confidence levelBootstrapES
Bootstrapped ES Confidence IntervalBootstrapESConfInterval
Plots figure of bootstrapped ESBootstrapESFigure
Bootstrapped VaR for specified confidence levelBootstrapVaR
Bootstrapped VaR Confidence IntervalBootstrapVaRConfInterval
Plots figure of bootstrapped VaRBootstrapVaRFigure
Estimates ES with Box-Cox transformationBoxCoxES
Estimates VaR with Box-Cox transformationBoxCoxVaR
Derives prob ( X + Y < quantile) using Gaussian copulaCdfOfSumUsingGaussianCopula
Derives prob ( X + Y < quantile) using Gumbel copulaCdfOfSumUsingGumbelCopula
Derives prob ( X + Y < quantile) using Product copulaCdfOfSumUsingProductCopula
Christoffersen Backtest for IndependenceChristoffersenBacktestForIndependence
Christoffersen Backtest for Unconditional CoverageChristoffersenBacktestForUnconditionalCoverage
Corn-Fisher ESCornishFisherES
Corn-Fisher VaRCornishFisherVaR
Monte Carlo VaR for DB pensionDBPensionVaR
Monte Carlo VaR for DC pensionDCPensionVaR
VaR for default risky bond portfolioDefaultRiskyBondVaR
Log Normal VaR with filter strategyFilterStrategyLogNormalVaR
Frechet Expected ShortfallFrechetES
Plots Frechet Expected Shortfall against confidence levelFrechetESPlot2DCl
Frechet Value at RiskFrechetVaR
Plots Frechet Value at Risk against ClFrechetVaRPlot2DCl
Bivariate Gaussian Copule VaRGaussianCopulaVaR
Expected Shortfall for Generalized ParetoGParetoES
Plot of Emperical and Generalised Pareto mean excess functionsGParetoMEFPlot
Plot of Emperical and 2 Generalised Pareto mean excess functionsGParetoMultipleMEFPlot
VaR for Generalized ParetoGParetoVaR
Bivariate Gumbel Copule VaRGumbelCopulaVaR
Gumbel ESGumbelES
Gumbel VaRGumbelESPlot2DCl
Gumbel VaRGumbelVaR
Gumbel VaRGumbelVaRPlot2DCl
Hill EstimatorHillEstimator
Hill PlotHillPlot
Hill Quantile EstimatorHillQuantileEstimator
Expected Shortfall of a portfolio using Historical EstimatorHSES
Percentile of historical simulation ES distribution functionHSESDFPerc
Figure of Historical SImulation VaR and ES and histogram of L/PHSESFigure
Plots historical simulation ES against confidence levelHSESPlot2DCl
Value at Risk of a portfolio using Historical EstimatorHSVaR
Percentile of historical simulation VaR distribution functionHSVaRDFPerc
Plots historical simulation VaR and ES against confidence levelHSVaRESPlot2DCl
Figure of Historical SImulation VaR and histogram of L/PHSVaRFigure
Plots historical simulation VaR against confidence levelHSVaRPlot2DCl
VaR of Insurance PortfolioInsuranceVaR
VaR and ES of Insurance PortfolioInsuranceVaRES
Jarque-Bera backtest for normality.JarqueBeraBacktest
Calculates ES using box kernel approachKernelESBoxKernel
Calculates ES using Epanechinikov kernel approachKernelESEpanechinikovKernel
Calculates ES using normal kernel approachKernelESNormalKernel
Calculates ES using triangle kernel approachKernelESTriangleKernel
Calculates VaR using box kernel approachKernelVaRBoxKernel
Calculates VaR using epanechinikov kernel approachKernelVaREpanechinikovKernel
Calculates VaR using normal kernel approachKernelVaRNormalKernel
Calculates VaR using triangle kernel approachKernelVaRTriangleKernel
Plots cumulative density for KS test and computes confidence interval for KS test stat.KSTestStat
Plots cummulative density for Kuiper test and computes confidence interval for Kuiper test stat.KuiperTestStat
ES for normally distributed geometric returnsLogNormalES
Percentiles of ES distribution function for normally distributed geometric returnsLogNormalESDFPerc
Figure of lognormal VaR and ES and pdf against L/PLogNormalESFigure
Plots log normal ES against confidence levelLogNormalESPlot2DCL
Plots log normal ES against holding periodLogNormalESPlot2DHP
Plots log normal ES against confidence level and holding periodLogNormalESPlot3D
VaR for normally distributed geometric returnsLogNormalVaR
Percentiles of VaR distribution function for normally distributed geometric returnsLogNormalVaRDFPerc
Plots log normal VaR and ETL against confidence levelLogNormalVaRETLPlot2DCL
Figure of lognormal VaR and pdf against L/PLogNormalVaRFigure
Plots log normal VaR against confidence levelLogNormalVaRPlot2DCL
Plots log normal VaR against holding periodLogNormalVaRPlot2DHP
Plots log normal VaR against confidence level and holding periodLogNormalVaRPlot3D
ES for t distributed geometric returnsLogtES
Percentiles of ES distribution function for Student-tLogtESDFPerc
Plots log-t ES against confidence levelLogtESPlot2DCL
Plots log-t ES against holding periodLogtESPlot2DHP
Plots log-t ES against confidence level and holding periodLogtESPlot3D
VaR for t distributed geometric returnsLogtVaR
Percentiles of VaR distribution function for Student-tLogtVaRDFPerc
Plots log-t VaR against confidence levelLogtVaRPlot2DCL
Plots log-t VaR against holding periodLogtVaRPlot2DHP
Plots log-t VaR against confidence level and holding periodLogtVaRPlot3D
Derives VaR of a long Black Scholes call optionLongBlackScholesCallVaR
Derives VaR of a long Black Scholes put optionLongBlackScholesPutVaR
First (binomial) Lopez forecast evaluation backtest score measureLopezBacktest
Mean Excess Function PlotMEFPlot
ES for normally distributed P/LNormalES
Generates Monte Carlo 95% Confidence Intervals for normal ESNormalESConfidenceInterval
Percentiles of ES distribution function for normally distributed P/L dataNormalESDFPerc
Figure of normal VaR and ES and pdf against L/PNormalESFigure
Hotspots for normal ESNormalESHotspots
Plots normal ES against confidence levelNormalESPlot2DCL
Plots normal ES against holding periodNormalESPlot2DHP
Plots normal ES against confidence level and holding periodNormalESPlot3D
Normal Quantile Quantile PlotNormalQQPlot
Standard error of normal quantile estimateNormalQuantileStandardError
Estimates the spectral risk measure of a portfolioNormalSpectralRiskMeasure
VaR for normally distributed P/LNormalVaR
Generates Monte Carlo 95% Confidence Intervals for normal VaRNormalVaRConfidenceInterval
Percentiles of VaR distribution function for normally distributed P/LNormalVaRDFPerc
Figure of normal VaR and pdf against L/PNormalVaRFigure
Hotspots for normal VaRNormalVaRHotspots
Plots normal VaR against confidence levelNormalVaRPlot2DCL
Plots normal VaR against holding periodNormalVaRPlot2DHP
Plots normal VaR in 3D against confidence level and holding periodNormalVaRPlot3D
Estimates ES by principal components analysisPCAES
ES plotPCAESPlot
Estimates VaR plot using principal components analysisPCAPrelim
Estimates VaR by principal components analysisPCAVaR
VaR plotPCAVaRPlot
Pickands EstimatorPickandsEstimator
Pickand Estimator - Tail Sample Size PlotPickandsPlot
Bivariate Product Copule VaRProductCopulaVaR
Derives VaR of a short Black Scholes call optionShortBlackScholesCallVaR
Derives VaR of a short Black Scholes put optionShortBlackScholesPutVaR
Log Normal VaR with stop loss limitStopLossLogNormalVaR
ES for t distributed P/LtES
Percentiles of ES distribution function for t-distributed P/LtESDFPerc
Figure of t - VaR and ES and pdf against L/PtESFigure
Plots t- ES against confidence leveltESPlot2DCL
Plots t ES against holding periodtESPlot2DHP
Plots t ES against confidence level and holding periodtESPlot3D
Student's T Quantile - Quantile PlotTQQPlot
Standard error of t quantile estimatetQuantileStandardError
VaR for t distributed P/LtVaR
Percentiles of VaR distribution functiontVaRDFPerc
Plots t VaR and ES against confidence leveltVaRESPlot2DCL
Figure of t- VaR and pdf against L/PtVaRFigure
Plots t VaR against confidence leveltVaRPlot2DCL
Plots t VaR against holding periodtVaRPlot2DHP
Plots t VaR against confidence level and holding periodtVaRPlot3D
Variance-covariance ES for normally distributed returnsVarianceCovarianceES
Variance-covariance VaR for normally distributed returnsVarianceCovarianceVaR