Numerical computing environment developed to allow matrix manipulations, plotting of functions and data and implementation of algorithms.

learn more… | top users | synonyms

10
votes
3answers
348 views

Is there a website that lists replication code of financial papers?

There are lot of questions on this website related to the replication of the empirical part of financial papers. I noticed that some (honest) authors provide on their personal website some ...
7
votes
3answers
122 views

Return Attribution: Possible remedies for multicollinearity

Let's say I have the following regression setup, which I am using for portfolio return attribution: $R = 1*\beta(1) + A*\beta(2) + B*\beta(3) + C*\beta(4) + \epsilon $ where A is dummy matrix of ...
6
votes
1answer
194 views

Density forecast of a GARCH model

I am currently working on developing a series of density forecasts and I am encountering some problems. I am working on weekly S&P 500 returns and the returns process is described as $r_{t} = ...
6
votes
1answer
73 views

Calibration of nested pricing models consistently on two different classes of derivatives

Hi everyone, I'm programming in MATLAB and I have the following optimization problem in calibrating several nested specifications of pricing models. Summary: I have two pricing models ($1$ and $2$, ...
5
votes
1answer
128 views

Portfolio Optimization using Parametric Portfolio Policy Method in MATLAB

I want to contruct an optimized stock portfolio with the restriction of a zero-investment strategy. The portfolio weight in each stock needs to be modeled as a function of state variables (factors ...
5
votes
1answer
510 views

PDF Calculation by Fourier Inversion of Characteristic Function for Affine Intensity Process in Matlab

I'm trying to use the Fourier inversion formula to plot the PDF of an Affine Stochastic Intensity Reduced Form Credit Model, given its characteristic function. The characteristic function of an ...
4
votes
3answers
593 views

Sampling problem in portfolio optimization

In a summary I am trying to do the following Bond Subset 1 : Get list of USD Bonds --> Filter out Bonds which have YTM > y% DUR > 10 Y etc. .. This gives us Bonds which we are interested in. So ...
4
votes
1answer
2k views

Learn backtesting using MATLAB

What are some good ressources (books, articles, ...) to learn backtesting of investment strategies using MATLAB ? It can be strategies related to fixed-income, equities, derivatives, ... whatever. ...
4
votes
1answer
271 views

Does Matlab support exogenous variables in GARCH models?

Is it possible to introduce dummy variables or explanatory variables in the GARCH variance equation (garchset and garchfit) in ...
4
votes
1answer
123 views

Matlab Portfolio Optimization with bid ask spread

I'm trying to find the optimal portfolio of options and stock which minimizes the standard deviation of the portfolio returns but also taking into consideration the bid and ask prices of the assets. ...
3
votes
1answer
48 views

Numerical Optimizer Matlab Calibration LMM

I am trying to mimimize the following function in order to calibrate the Libor Market Model $$\sum_{i=1}^{n} \left(\sigma_i^{market}-\sigma_i^{Reb}\left(a,b,c,d,\beta\right)/\sqrt{T_i}\right)^2,$$ ...
3
votes
2answers
314 views

How to simulate a CIR process using GPU and Matlab

I am trying to simulate a CIR process using Matlab and my GPU for effeciency. At the moment i run into some implementation problems due to the recursive nature of the discretization. The sheme I ...
3
votes
1answer
126 views

Cubic spline interpolation function within Matlab

I want to use the Cubic spline interpolation technique so I can interpolate yield curve points. Now I wonder if I can use the standard matlab function interpl1 (and then using the 'spline' method) or ...
3
votes
1answer
925 views

constrained portfolio optimization by fmincon

I am working through this paper, http://www.nber.org/papers/w8922.pdf I want to implement the portfolio weight constraints see page 6-7. Here is the brief overview of my problem: Let ...
3
votes
1answer
428 views

Regime Switching for Dynamic Correlations

I would like to implement a Regime Switching for Dynamic Correlations in an out-of-sample analysis using MATLAB. After looking at the literature on the subject, they all refer to an article by Denis ...
3
votes
2answers
180 views

How to get around flat likelihood function when calibrating GBM parameters?

I want to calibrate jointly the drift mu and volatility sigma of a geometric brownian motion, $$\log(S_t) = \log(S_{t-1}) + (\mu - 0.5*\sigma^2) \Delta t + \sigma*\sqrt{\Delta t}*Z_t$$ where $Z_t$ ...
3
votes
1answer
180 views

formulating MVO with costs

I am trying to formulate this simple MVO utility function with a linear transaction cost penalty added using Quadprog in MATLAB tcost = 0.001; lambda = 4; mu = vector of expected returns (say 4x1) S ...
3
votes
1answer
89 views

How to implement dummy variables into GARCH(1,1) model from structural breaks (ICSS)

Hello everybody, I was already searching a lot of forums and read a huge amount of different papers. But I guess I am to stupid or I am at a loss. Hopefully some of you are able to help me out. Here ...
3
votes
1answer
96 views

Log-likelihood of skew-t distribution

I am trying to estimate GARCH models with the use of Hansen's (1994) skew-t distribution. I am using matlab's ARMAX-GARCH-K toolbox, where the log-likelihood is calculated as: ...
3
votes
1answer
298 views

Stochastic Volatility CIR estimation

Would anyone have a code (pref. Matlab or R) for any type of estimation (QML, GMM) not using option prices of a stochastic volatility model driven by a CIR process described below? \begin{equation} ...
2
votes
3answers
2k views

Is MATLAB-generated code good enough for use in live trading?

I know that MATLAB has mechanisms for generating code, but I've never used them. Have you? If you have - is it good enough (=fast enough, I guess) to be used in live trading systems? Anything one ...
2
votes
2answers
524 views

SVCJ (SVJJ) Duffie et. al Model implementation in Matlab

I'm attempting to implement aforementioned SVCJ model by Duffie et al in MATLAB. so far without success. It's supposed to price vanilla (european) calls . parameters provided, the expected price is: ...
2
votes
1answer
331 views

What are the equation that gives hurst exponent of value >0.7 and <0.3?

I had been working on algorithm which uses the Hurst Exponent. Once i random walk simulation on matlab, x = cumsum(randm(1000,1)), I was able to get a hurst value close to 0.5. To analyze the use of ...
2
votes
1answer
293 views

Implementing nonlinear optimization to find model free implied volatility using Matlab

I am trying to calculate model free implied volatility $\sigma_{MF}$ for a relative performance index using the following method: $\sigma_{MF}^2=2\sum_{i} [\frac{C(T,K_{i})}{K_{i}^2} - ...
2
votes
1answer
150 views

How to identify the orders p and q for ARIMA model using least squares method?

I would like to identify the orders p and q for ARIMA model using least squares method in Matlab. I have got also two data files (one with noise and one without) Previously I identified p and q for ...
2
votes
2answers
185 views

VIX-implied Volatility calculator

Does anybody know any implied volatility calculator for VIX Options, possibily in Matlab? For Vanilla Options, I'm currently employing this function which is very fast and reliable (much more than ...
2
votes
2answers
737 views

How to calculate the volatility matrix with multiple stocks

calculating the volatility for a single stock is straightforward. However, I'm not sure whether my approach for calculating the volatility matrix for multiple stocks is correct: I assume a log-normal ...
2
votes
1answer
1k views

Johansen Cointegration Test

I just performed a Johansen Co-integration test on two stocks. The results I get are: ans = r0 r1 t1 true false I am using Matlab. Can ...
2
votes
0answers
53 views

Simulate correlated Geometric Brownian Motion in the R programming language

In response to this question: How to simulate correlated Geometric brownian motion for n assets? One of the responses provides an implementation in MATLAB: ...
2
votes
0answers
125 views

Simulation of Heston process

I am currently working on implementing Heston model in matlab for option pricing (in this case I am trying to price a European call) and I wanted to compare the results I obtain from using the exact ...
2
votes
1answer
730 views

Continuous returns for negative roll-adjusted futures data

I've generated roll adjusted notional futures data by adding a roll adjustment to the settlement price then multiplying by contract multiplier through time. For example, for crude oil CL, on 15 March ...
1
vote
2answers
1k views

Optimal lag length selection criterion in GARCH(p,q) model using MATLAB

As assessed by the title, I'm trying to estimate a GARCH(p,q) model to forecast stock market volatility and, in order to be able to do that, I've to identify the optimal number of lags, p and q, to ...
1
vote
2answers
250 views

Aggregate interactive brokers data in matlab

I am using matlab and interactive brokers API. I am getting real time data using tickerID = ib.realtime({ct},'233',@(varargin)ibEventRealTimeData(varargin{:})); where ib is the interface to ...
1
vote
1answer
223 views

constrained portfolio optimization in matlab

I am working through this paper, http://www.nber.org/papers/w8922.pdf I want to implement the portfolio weight constraints see page 6-7. Here is the brief overview of my problem: Let ...
1
vote
2answers
337 views

How to combine Gaussian marginals with Gaussian copula to obtain multivariate normals?

in the book "Numerical Methods and Optimization in Finance" I red the following: "Combining the Gaussian copula with Gaussian marginal gives a fancy way of expressing multivariate normals. However, ...
1
vote
1answer
28 views

What is the difference between group and inequality constraints in Matlab?

Sorry if this seems stupid. I was wondering what the difference between a group and inequality constraint is in Matlab. As far as I can tell they are the same: From Matlab ...
1
vote
1answer
93 views

One-step ahead forecast of a AR(1) process (GARCH context)

I am using a Matlab toolbox for obtaining one-step ahead forecasts of the conditional mean from the ARMA(1,0)-GARCH(1,1) process and I have encountered a piece of code that contains, in my opinion, a ...
1
vote
1answer
270 views

matlab interpretation of johansen cointegration test

I need some help understanding the results of Johansen Cointegration test run on MATLAB. I am quite new to econometrics and do not fully comprehend what MATLAB has come up with. I would be really in ...
1
vote
1answer
128 views

Simulate from time-dependent copula in MatLab using COPULARND

I would like to simulate from a t-copula with time-dependent correlation matrices. Say I have a series of 2000 correlation matrices (obtained from a copula-DCC model for data consisting of 2000 ...
1
vote
1answer
426 views

Cholesky Decomposition on Correlation Matrix for Correlated Asset Paths

I found a matlab example for modelling correlated asset paths: http://www.goddardconsulting.ca/matlab-monte-carlo-assetpaths-corr.html In this model the author uses the matlab code chol() in order to ...
1
vote
0answers
98 views

Skewed Generalized Error Distribution's (SGED) pdf

I want to use the SGED distribution of Theodossiou for GARCH estimation, however, I am struggling to understand which is the correct pdf function of the distribution. Let me just say that the ...
1
vote
0answers
62 views

Monte Carlo simulation of Multifractional Brownian Motion in MATLAB

Code under is taken from http://en.literateprograms.org/Monte_Carlo_simulation_(Matlab) ...
1
vote
1answer
355 views

Geometric Brownian Motion - Why Sqrt(dt)? [closed]

I was going to simulate a geometric brownian motion in matlab, when I recognized that I didnt fully understand the underlying Wiener process. Following the instuctions here I am starting from the ...
1
vote
0answers
65 views

Initial values for Heston Model calibration

I'm doing a Heston model in Matlab using simple Monte Carlo simulations (5.000 paths and 2 steps per day, simulating 360 days). When I try to calibrate the Heston parameters using fminsearch it takes ...
1
vote
0answers
75 views

How to decide if the ARCH coefficient is necessary in the GJR-GARCH model?

I did some analysis for CAC 40, the French market benchmark, for the period 2005-2014, and I tried to fit the data with a GJR(1,1) model in MATLAB. Then some warning showed Lower bound ...
1
vote
0answers
57 views

How to estimate constrained a constrained VAR(1) with MATLAB?

Suppose I want to estimate the following VAR(1) model: $$ Y_t = \mu + \Phi Y_{t-1} + \varepsilon_t $$ where $Y_t=(y_{1t}, y_{2t},…,y_{kt})'$, $\mu=(\mu_1,…,\mu_{k})’$ and $\Phi$ a matrix of ...
1
vote
0answers
366 views

Autoregressive distributed lag models ADL(p,q) howto in preferably matlab (stata/R/python/C# etc)

Could anyone provide me the details of how to determine the lag order of the distributed lags for an ADL(p,q) model in Matlab or another statistical package (and very much preferably in combination ...
1
vote
0answers
122 views

Handling IQFeed events in Matlab

I need to get some specific market data for my studies, and it seems like the most convenient way for me to do this is to use IQFeed data feed and MATLAB. But unfortunately, since I'm not a seasoned ...
0
votes
1answer
71 views

how to extract moments of GB from moment generating function?

I'm searching for the moments of geometric brownian motion using the gmm optimization program. the aim is to make the process y(t) of returns follows a normal distribution Are there any packages in ...
0
votes
1answer
1k views

Matlab - Differences between rng and rand

I was trying to run some Monte-Carlo simulations and if I used: rng(seed, 'Twister'); For some reason I would get "Option Values Can not be Negative" errors in the blsimpv function, but if I just ...