| Title: | Teaching Scripts for Financial Risk Analytics Practicals |
|---|---|
| Description: | A collection of ten worked practical scripts covering R fundamentals, term structure modelling, market risk (VaR), credit risk (Markov chains), operational risk (frequency-severity models), volatility (GARCH), portfolio optimisation, Monte Carlo risk simulation, and a Shiny risk dashboard. Each Practical*() function prints the annotated R code for that topic so it can be copied, run, and studied interactively. This package intentionally ships the material as printable teaching code rather than as executed computations, so it has no hard dependency on the packages used inside the printed examples (minpack.lm, evd, rugarch, quadprog, shiny); install those separately if you want to run the printed code yourself. |
| Authors: | Phanthomx [aut, cre] |
| Maintainer: | Phanthomx <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-07-03 21:00:18 UTC |
| Source: | https://github.com/phanthomx/finRiskPractical |
Prints annotated R code covering basic R computations, data structures, a future value calculation, simple return simulation, and plots.
Practical1_R_for_Finance()Practical1_R_for_Finance()
Invisibly returns NULL; called for its printed side effect.
Practical1_R_for_Finance()Practical1_R_for_Finance()
Prints annotated R code for a full Shiny application (analytics, UI, and server layers) implementing an interactive Monte Carlo risk dashboard.
Practical10_Shiny_App()Practical10_Shiny_App()
Invisibly returns NULL; called for its printed side effect.
Practical10_Shiny_App()Practical10_Shiny_App()
Prints annotated R code covering functions, control flow, loops, bootstrapping a confidence interval, and a random walk simulation.
Practical2_R_Warmups()Practical2_R_Warmups()
Invisibly returns NULL; called for its printed side effect.
Practical2_R_Warmups()Practical2_R_Warmups()
Prints annotated R code fitting a Nelson-Siegel model and a cubic smoothing spline to a synthetic yield curve, and comparing RMSE.
Practical3_Term_Structure_Splines()Practical3_Term_Structure_Splines()
Invisibly returns NULL; called for its printed side effect.
Practical3_Term_Structure_Splines()Practical3_Term_Structure_Splines()
Prints annotated R code computing parametric and historical Value-at-Risk (VaR) on a simulated daily return series.
Practical4_Market_Risk()Practical4_Market_Risk()
Invisibly returns NULL; called for its printed side effect.
Practical4_Market_Risk()Practical4_Market_Risk()
Prints annotated R code simulating rating migration with a Markov chain transition matrix, Monte Carlo default probabilities, and a hazard rate calculation.
Practical5_Credit_Risk()Practical5_Credit_Risk()
Invisibly returns NULL; called for its printed side effect.
Practical5_Credit_Risk()Practical5_Credit_Risk()
Prints annotated R code for a frequency-severity operational loss model, fire loss severity, and a peaks-over-threshold (GPD) fit.
Practical6_Operational_Risk()Practical6_Operational_Risk()
Invisibly returns NULL; called for its printed side effect.
Practical6_Operational_Risk()Practical6_Operational_Risk()
Prints annotated R code fitting an AR(1)-GARCH(1,1) model, simulating a future volatility path, and computing a GARCH-based VaR.
Practical7_Volatility_GARCH()Practical7_Volatility_GARCH()
Invisibly returns NULL; called for its printed side effect.
Practical7_Volatility_GARCH()Practical7_Volatility_GARCH()
Prints annotated R code solving a minimum-variance, long-only portfolio via quadratic programming and computing portfolio VaR.
Practical8_Portfolio_Analytics()Practical8_Portfolio_Analytics()
Invisibly returns NULL; called for its printed side effect.
Practical8_Portfolio_Analytics()Practical8_Portfolio_Analytics()
Prints annotated R code simulating terminal asset values via Geometric Brownian Motion and computing Monte Carlo VaR and Expected Shortfall.
Practical9_Monte_Carlo_Risk()Practical9_Monte_Carlo_Risk()
Invisibly returns NULL; called for its printed side effect.
Practical9_Monte_Carlo_Risk()Practical9_Monte_Carlo_Risk()
Convenience wrapper that calls all ten Practical*_*() functions
in sequence, printing their annotated code one after another.
print_all_practicals()print_all_practicals()
Invisibly returns NULL; called for its printed side effect.
print_all_practicals()print_all_practicals()