MATLAB Codes

Mathematical Finance and Finance Codes using MATLAB

(Please feel free to send me an e-mail to call for the Matlab codes or the m-files: mjcfs@iscte-iul.pt)


Performing the Clark and West (2007) test for out-of-sample forecasting
Estimation sinusoidal functions for modeling seasonality effects under the Least Squares Method
Calibration of a mean-reverting stochastic process with Jump-Diffusion using the Maximum Likelihood Estimation
Simulating the path of a mean-reverting stochastic process with Jump-Diffusion using Monte Carlo Simulations
Fit a t-copula to financial data
Fit a Gaussian copula to financial data
Fit a Clayton copula to financial data
Fit a Frank copula to financial data
Fit a Gumbel copula to financial data
Generate a random sample from the t copula
Generate a random sample from the Gaussian copula
Generate a random sample from the Clayton copula
Generate a random sample from the Frank copula
Generate a random sample from the Gumbel copula
Compute the t-Copula probability density function
Compute the Gaussian Copula probability density function
Compute the Clayton Copula probability density function
Compute the Frank Copula probability density function
Compute the Gumbel Copula probability density function
Estimating the parameters of a standard SVM (Stochastic Volatility Models) with volatility following an AR (1) process under Markov Chain Monte Carlo
Estimating the parameters of a standard SVM with volatility following an AR (2) process under Markov Chain Monte Carlo
Estimating the parameters of a standard SVM but the prices equation has a “jump” component under Markov Chain Monte Carlo
Estimating the parameters of a standard SVM but volatility enters in the prices equation as a covariate under Markov Chain Monte Carlo
Estimating the parameters of a standard SVM but the observation error follows an MA(1) under Markov Chain Monte Carlo
Estimating the parameters of a standard SVM but the observation error follows a t distribution under Markov Chain Monte Carlo
Estimating the parameters of a standard SVM with a leverage effect under Markov Chain Monte Carlo
Estimating the parameters of GARCH(1,1) with volatility following an AR (1) process under Markov Chain Monte Carlo
Estimating the parameters of GARCH(1,1) with volatility following an AR (2) process under Markov Chain Monte Carlo
Estimating the parameters of GARCH(1,1) but the prices equation has a “jump” component under Markov Chain Monte Carlo
Estimating the parameters of GARCH(1,1) but volatility enters in the prices equation as a covariate under Markov Chain Monte Carlo
Estimating the parameters of GARCH(1,1) but the observation error follows an MA(1) under Markov Chain Monte Carlo
Estimating the parameters of GARCH(1,1) but the observation error follows a t distribution under Markov Chain Monte Carlo
Estimating the parameters of GARCH with a leverage effect under Markov Chain Monte Carlo
Calibration the parameters of the Double Exponential Jump-Diffusion model (Kou, 2002) using the Maximum Likelihood Estimation
Simulation of the paths from a Double Exponential Jump-Diffusion model suggested by Kou (2002)
Simulation of the paths from a Variance-Gamma Process
Simulation of the paths from a GBM with Non-Linear GARCH effect
Calibration of the Variance-Gamma Process using the Maximum Likelihood Estimation and using the modified Bessel function of the second kind
Calibration of the GBM with Non-Linear GARCH approach using the Maximum Likelihood Estimation
Calibration of the GBM model using the Generalized Method of Moments
Calibration of the Brennan and Schwartz using the Generalized Method of Moments
Calibration of the Vasicek model using the Generalized Method of Moments
Calibration of the CIR model using the Generalized Method of Moments
Calibration of the CEV model using the Generalized Method of Moments
Calibration of the Mean-Reverting CEV and the Chan et al. (1992) model using the Generalized Method of Moments
Simulation of the paths from a GBM with Jump-Diffusion process
Calibration of the Variance-Gamma Processes using the Maximum Likelihood Estimation
Calibration of the GBM with Jump-Diffusion using the Maximum Likelihood Estimation
Calibration of the GBM using the Maximum Likelihood Estimation
CreditGrades (Sctrutural Credit Risk Model) for a large dataset of firms to compute the survival probability, using the approximation approach
CreditGrades (Sctrutural Credit Risk Model) calculator to compute the survival probability, using the approximation approach
Computing the Distance-to-Default (and the implied default probabilities) using the Moody’s KMV approach for a large dataset of firms
Calculator of the Distance-to-Default (and the implied default probability) using the Moody’s KMV approach for a large dataset of firms
Merton Distance-to-Default to compute the credit spreads, default probabilities for a large dataset of firms (solving a non-linear system of equations)
Merton Distance-to-Default to compute the credit spreads, default probabilities for a large dataset of firms (using an iterative approach)
Naïve methods to compute the Distance-to-Default (and the implied default probabilities) for a large dataset of firms (in order to avoid solving the non-linear system of equations)
Matlab implementation of a Geometric Brownian Motion (GBM) with 1 iteration
Matlab implementation of a Geometric Brownian Motion (GBM) with “n” iterations
Calibration of the Black-Scholes-Merton (BSM) model for european-style call and put options
Calculator of european-style options using the Black-Scholes-Merton (BSM) approach
Calculator of european-style options using the Constant Elasticity Variance (CEV) approach
Plotting smile volatility effects for call options
Plotting smile volatility effects for put options