Tag Info

Hot answers tagged

13

Of course it is fast enough. But what is fast enough? I know guys who trade off Excel sheets and they make millions, but those guys are clearly not active in high frequency space. So, it entirely depends on your trading frequency and average holding period. I also know of shops that run live trading systems by calling R functions, so, obviously Matlab ...


4

If I understand you right, you are talking specifically about Matlab's embedded code generation facility (see here: http://www.mathworks.ch/embedded-code-generation/). In my view, the answer to your question is clearly yes. This feature allows you to generate hardware specific code, e.g. for deployment on GPU's (video cards). It's used for aerospace ...


4

Write the equation as $\sigma_{MF} \to G(\sigma_{MF}) = 0$ (by subtracting $\sigma_{MF}^2$) and use a root finder. As how to solve $G(\sigma_{MF}) = 0$ in MatLab check the MatLab documentation (see e.g. "solver" there).


4

If I understand you correctly, then you have a filter defined for your portfolio that is defined by "1.". A) So you either filter out these bonds before you start anything that has to do with the optimization. This should be the way to go if you are interested in speeding up your program. B) If you want to do everything in the optimization, then you need ...


4

The corresponding process would be fractional brownian motion (see here) It is parametrized by the Hurst Exponent. On the referenced site you find a link to some matlab code for simulating realizations of fractional BM. If you want to see some fractional Gaussian Noise in action (Matlab) you can do so here. Further more you might want to look into ...


4

I found these nice lecture note by Karl Sigman on the web. On page three you see if $X\sim N(\mu,\sigma)$ then the moment generating function (mgf) of $X$ is given by $$M_X(s) = E(exp(sX)) = \exp( \mu s + \sigma^2 s^2 /2)$$ Thus for Brownian motion with drift $X_t$ you get $$ M_{X_t}(s) = E(exp(s X_t)) = \exp( \mu t s + \sigma^2 s^2 t /2). $$ Finally for ...


3

About the integration problem: Your integrand is highly oscillatory, and the adaptive quadrature of Matlab doesn't handle such integrands very well. In general, I would recommend Mathematica when Matlab's standard procedures don't perform well. In this case, a Levin-type method would perform much better. The reason that quadv produces NaN values is because ...


3

I would use a Metropolis Monte Carlo / simulated annealing approach to solve your problem. Start with an arbitrary fully invested portfolio which satisfies constraints (2), (3) and the cardinality constraint $N \le K$. Then choose one of the following trial moves: Select two bonds $i,j$ at random and perform a random weight shift $w_i \rightarrow w_i + ...


3

No, rng does not do the same as rand. rng sets the seed for the random number generator and rand generates random numbers. Also it can be seen in documentation that the rng function only accepts positive integers. Usually random number generator algorithms start with integers for the seed. For various examples: C random function takes the system clock as ...


2

work you way from GARCH(4,4) to GARCH(0,0) removing the intercept too. 5*5*2-1 = 49 estimations Make sure your coefficients are all statistically significant at least to 95% confidence. Make sure you have no autocorrelation in your error terms. pacf and acf should be clean. Likelihood ratio tests assess whether you lose explaining power from ...


2

I'm not that familiar with MATLAB. However, in quadratic programming the main issue I've found is setting up the problem correctly and then the coding becomes much easier. As you noted this problem can be expressed as a quadratic cone problem and solved by quadprog but a good amount of more work needs to be done to get this in the correct form. You ...


2

You can express the Normal distribution by Sklar's Theorem in terms of Gaussian Marginals and Gaussian Copula as follows: $$F(x_1,...,x_n)=C(F(x_1),...,F(x_n))=C^{Gau}(N(x_1),...,N(x_n))$$ So the distribution equals the copula function with the respective inverse marginals as arguments. You can aswell combine any types of Copula and (continuous) different ...


1

For Engle-Granger, I can see that you are returned a vector of 2 elements for each of the output arguments, hence you run two tests there. For the sake of clarity and the education of people interested in the post, we can say that: Since your $hValues$ are both zero, we can say that there is a failure to reject the Null Hypothesis, which in this case is ...


1

Assume that instead of a possible portfolio of 1000 bonds, the portfolio may only contain M bonds. The input vector then needs to contain both the weightings and the choice of bonds, but how can you present the choice of bonds as an input vector? Consider sorting the candidate bonds by Macaulay duration. Given a single Macaulay duration value, then, you ...


1

If you want to create one (column) vector X of correlated random variates, then you premultiply it with the lower triangular matrix L. But when you create paths, every return observation is one vector of random numbers. It is then a matter of how you arrange your data: if these observations are columns in an matrix X, you compute LX. But if you have the ...


1

I would suggest that you use a more 'modern' method to recover option prices from characteristic functions. The approach of this papers (for practical calculations of option prices) is somewhat outdated. The backbone of affine models (such as SVJJ) is the characteristic function $\psi(u)$ of the log-price distribution, which is known in closed form. The ...


1

I don't know what is supported by MatLab (I use Java to do such stuff :-). But in case you do not find a solution from the swapbyzero function you mentioned I can suggest a workaround: Value a swap with the annual fix frequence. Given that it is a payer swap (pays the fixed leg), correct the value by: Substract the value of an annual fix coupon bond ...


1

A very simple approach could be the following: draw a random number for each day for each stock. If you refer to "average/mean" by return and to "standard deviation/variance" by volatility, you could use these for the distribution parameters of the random numbers per stock. If you dislike that values can go below zero, apply Euler's exponential function on ...


1

I am trying to make things clear with this answer. In the case of the normal distribution it holds that the moment generating function (mgf) is given by $$ M(h) = \exp(\mu h + \frac12 \sigma^2 h^2), $$ where $\mu$ is the mean and $\sigma^2$ is the variance. Thus the cumulant generating function $C(h)$ which is given by $C(h) = \ln (M(h))$ reduces to $$ C(h) ...


1

We were using Matlab with the Java Builder for numerical optimization and the results were very poor. Fmincon was taking about 30 seconds to converge, now we are using a native java library and the optimization takes from 0.1sec to 0.5 seconds



Only top voted, non community-wiki answers of a minimum length are eligible