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

learn more… | top users | synonyms

0
votes
0answers
18 views

Maximum Likelihood Estimation Heston Model using Matlab

My question is based on the MLE of the Heston model discussed in this paper URL: http://www.princeton.edu/~yacine/stochvol.pdf with Matlab code: http://www.princeton.edu/~yacine/closedformmle.htm ...
0
votes
0answers
27 views

Converting Fortran Code to Matlab/Scilab [closed]

I'd like to know whether there are commands in Matlab or Scilab to convert Fortran Code.
1
vote
0answers
33 views

RealTime Data Update in Excel to Matlab [migrated]

I would like to know if someone has some experience in making Excel talk to Matlab in RealTime. I have data in Excel which are updated in realtime, but I want to see the same thing in Matlab. I know ...
1
vote
1answer
74 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 ...
2
votes
0answers
74 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
58 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. ...
0
votes
2answers
81 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
0answers
32 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 ...
0
votes
0answers
31 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 ...
0
votes
1answer
61 views

Do I need simulink to model the risks of an option portfolio

I wish to buy Matlab Home and learn to model the risks of a derivatives portfolio and then stress test it. So I am guessing I will need : Stochastic calculus Linear algebra Stats/Probability Some ML ...
-4
votes
1answer
34 views

Matlab loop statement is driving me mad [closed]

Can someone please help me out with this loop over here? Matlab simple refuses to consider the for o=k:k-20 statement inside the if statement. :pullingmyhair: ...
1
vote
1answer
70 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 ...
1
vote
1answer
119 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 ...
0
votes
0answers
43 views

Interpreting Johansen co integration test

I am a little new to econometrics. Please pardon me for this silly question. I was running a Johansen cointegration test on two time series using the econometrics toolbox provided by James LeSage for ...
3
votes
2answers
213 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 ...
2
votes
1answer
366 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
204 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 ...
1
vote
0answers
44 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
1answer
129 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 ...
3
votes
1answer
115 views

How to get around flat likelihood function when calibrating GBM parameters

(Hope this is the correct place for this question - I posted it first on stackoverflow:) I want to calibrate jointly the drift mu and volatility sigma of a geometric brownian motion, ...
0
votes
1answer
97 views

What are the parameters of the function PORTVAR in Matlab?

According to the Matlab help, Portvar will give the "Variance for portfolio of assets" by entering the returns of the Assets and the corresponding weight. However, it does not explain the parameters ...
0
votes
0answers
64 views

Portfolio Performance Metrics

In comparing different long portfolios in stocks for 15 quarters, where at each quarter I re-balance the portfolio. So what I have done is made a function that outputs the rand value of the portfolio ...
-1
votes
1answer
122 views

Equall Risk Contribution and The Most Diversified Portfolio [closed]

I am a master degree student on applied economics at Brazil and my thesis will be about smart beta strategies. I pretend to apply Equal Weigth, Mininum Variance, Most Diversified Portfolio and Equal ...
3
votes
1answer
812 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. ...
2
votes
1answer
180 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
2answers
133 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 ...
6
votes
1answer
65 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$, ...
1
vote
1answer
94 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 ...
0
votes
0answers
80 views

What is the most elegant way to write a trading (or asset selection) algorithm in MATLAB, based on a simple criterion?

Assume a $T \times N$ matrix $X$ of values for an asset characteristic at time $t \in \{1,2,\dots,T \}$, where $T$ is the observation period in months and $N$ is the number of assets and a ...
0
votes
0answers
96 views

Interpretation of Cointegration results, pValues and t-Stat

This is a follow up to: Cointegration results interpretation validation? I ran another Engel Granger Test on a pair, The results I get: ...
0
votes
1answer
234 views

Cointegration results interpretation validation?

Here is how I am interpreting results of a Johansen Cointegration Test and Engel-Granger Test for A and B. The results:(Using matlab) ...
2
votes
1answer
125 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 ...
1
vote
2answers
191 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
224 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
224 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 ...
2
votes
2answers
472 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
808 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 ...
1
vote
0answers
94 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 ...
2
votes
2answers
378 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: ...
5
votes
1answer
381 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 ...
0
votes
0answers
38 views

Engle Granger test returns a 0 in matlab, while correlation factor is .80+. Am I doing something wrong?

Engle Granger test is giving me a ans = 0. The correlation factor is: 0.8+ Does this imply the No cointegration hypothesis is true? i.e. as per my understanding that there is cointegration? I am ...
4
votes
3answers
489 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 ...
1
vote
1answer
196 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 ...
0
votes
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 ...
0
votes
0answers
234 views

Copula Value At Risk

Let's suppose I have two asset in my portfolio. I want to compute Copula Value At Risk. Can you help me? This is the code I wrote: ...
0
votes
1answer
331 views

How do I simulate stock prices for a 10 asset portfolio, over a period of 10 years in MATLAB? [closed]

If I have given vectors for return and volatility (i.e. I have two 1x10 vectors), and I assume at first that their correlation is 0 (meaning my covariance-variance matrix is just diagonal), how do I ...
0
votes
1answer
397 views

How can I calculate the Cumulant-Generating Function in Matlab?

Let $M(h)$ be the moment-generating function, then the cumulant generating function is given by $$K(h)=\text{ln}M(h)=\\ =\kappa_1h+\frac{1}{2!}h^2\kappa_2+\frac{1}{3!}h^3\kappa_3+\ldots$$ where ...
4
votes
0answers
182 views

How can I introduce exogenous variables in the equation of the conditional variance?

Is it possible to introduce dummy variables or explanatory variables in the GARCH variance equation (garchset and garchfit).This is done in the mean (ARMAX) equation through the input 'Regress' in ...
0
votes
1answer
67 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
0answers
698 views

fetch from yahoo! finance database - varying number of ticks

To test a model with real-life data, I used the fetch-function in matlab to connect to the database of yahoo! finance. My code to try and get 7 different assets' returns is the following: ...