Financial module
- Financial module
- backtest — Apply the backtest to three different risk measures (as percentage of lost): Expected Shortfall, Value at Risk, and a Spectral Measure with linear spectrum. Show the graph of historical returns and the risk measures. The thresholds of the backtest are also computed.
- bollinger — Given a moving average on the historical prices of an asset, the function creates two figures: in the first both the historical prices and the Bollinger bands (i.e. the moving average +/- "a" times the price standard deviation) are shown, in the second the so-called b-percentage is shown
- bsgreeks — Compute the Greeks for both a call and a put option in a Black and Scholes model. "Delta" is the derivative of the option price with respect to the price of the underlying asset. "Gamma" is the second derivative of the option price with respect to the price of the underlying asset. "Theta" is the derivative of the option price with respect to the time to maturity. "Rho" is the derivative of the option price with respect to the riskless interest rate. "Vega" is the derivative of the option price with respect to the volatility of the underlying (log-) return.
- bsimpvol — Compute the implied volatility in a Black and Scholes framework. The function computes the volatility by equating the theoretical value of an option (with both constant riskless interest rate and volatility) to its market value.
- bsoption — Compute the value of both a call and a put option in a Black and Scholes framework (with both constant riskless interest rate and volatility)
- cfr — compare two or more time series of data and eliminate the elements which do not have the same date
- duration — given a set of cash flows (either positive of negative) from an investment and the dates at which they are available, the function computes: the duration of the cash flows, the convexity of the cash flows, and the yield-to-maturity "ytm" (both duration and convexity are computed by taking ytm as the discount rate)
- esvarevt — Compute both Expected Shortfall and Value at Risk by using the Extreme Value Theory. Furthermore, also the parameter of the Generalized Pareto Distribution are estimated with the Maximum Likelihood method
- esvarlin — Compute three risk measures on historical prices of a set of assets, and at a given confidence level. The three risk measures are: Expected Shortfall (ES), Value at Risk (VaR) and a Linear Spectral risk measure (lin).
- esvaroptim — Compute the optimal portfolio minimizing the Expected Value (this is a linear programming problem). The Value at Risk of the portfolio is also computed (this implements the Rockafeller-Uryasev algorithm)
- euler — Numerically solves a system of stochastic differential equation (by using the Euler discretization)
- evt — Estimate the parameters of the Generalized Pareto Distribution with the Maximum Likelihood method
- gbm — Estimate the parameters of a Geometric Brownian Motion (through the method of moments) on the data and graphically show the mean and two confidence intervals
- hedge — Compute the hedge ratio between an asset "S" and a derivative on it "F"
- hurst — Compute the Hurst index on historical prices
- interest — Estimate the parameters of three spot interest rate models and draw some simulations
- irs — For a fix-for-floating Interest Rate Swap compute both the spread and the value of the legs.
- markowitz — Compute the optimal portfolio minimizing the variance (this is a quadratic programming problem). The optimal variance is also computed.
- mef — Compute and draw the Mean Excess Function
- movav — Compute and draw the moving average of a given time series
- nelson_siegel — Estimate the parameters for the Nelson Siegel model of spot interest rates (least square method). Finally draw the actual spot rate curve and the interporalted curve
- svennson — Estimate the parameters for the Svennson model of spot interest rates (least square method). Finally draw the actual spot rate curve and the interporalted curve