Quantitative Finance Collector is a blog on Quantitative finance analysis, financial engineering methods in mathematical finance focusing on derivative pricing, quantitative trading and quantitative risk management. Please help us spread the word:
Dec
4
We seek to try out ga and patternsearch functions of the Genetic Algorithm and Direct Search Toolbox. We consider the unconstrained mean-variance portfolio optimization problem, handled by portopt and portalloc of the Financial Toolbox - note that in absence of constraints other than sum(w) = 1, the problem admits a simple closed-form analytic solution - and see whether ga and patternsearch succeed at locating the optimal portfolio identified by portalloc.
Nov
4
In mathematics and computing, the Levenberg–Marquardt algorithm (or LMA) provides a numerical solution to the problem of minimizing a function, generally nonlinear, over a space of parameters of the function. These minimization problems arise especially in least squares curve fitting and nonlinear programming.
The Levenberg-Marquardt algorithm has proved to be an effective and popular way to solve nonlinear least squares problems. MINPACK-1 contains Levenberg-Marquardt codes in which the Jacobian matrix may be either supplied by the user or calculated by using finite differences. IMSL , MATLAB , ODRPACK , and PROC NLP also contain Levenberg-Marquardt routines.
The algorithms in ODRPACK solve unconstrained nonlinear least squares problems and orthogonal distance regression problems, including those with implicit models and multiresponse data.
The Levenberg-Marquardt algorithm has proved to be an effective and popular way to solve nonlinear least squares problems. MINPACK-1 contains Levenberg-Marquardt codes in which the Jacobian matrix may be either supplied by the user or calculated by using finite differences. IMSL , MATLAB , ODRPACK , and PROC NLP also contain Levenberg-Marquardt routines.
The algorithms in ODRPACK solve unconstrained nonlinear least squares problems and orthogonal distance regression problems, including those with implicit models and multiresponse data.
Sep
11
Are you fed up with "linprog" or "fmincon" command in Matlab? do you sometimes find the results violate your providing constraints while Matlab says "condition satisfied", or sometimes you get a weird solution while Matlab tells you "convergence successful", etc. (I am not saying bad words about Matlab, I AM a fan of it, but if there is a better solution for the given problem, why not at least try it?)
Optimization packages are widelyspread, here is a site i introduced, optimization package. Several days ago a friend of mine sent me a link about lp-solver, which is a Mixed Integer Linear Programming (MILP) solver, convenient to use and highly efficient, cannot help sharing with you all. (please submit your favorite code site if you happen to find one and help others, thanx.)
The name itself tells you this package is for linear programming problem, What is Linear Programming then? A Linear Program (LP) is a problem that can be expressed as follows:
minimize cx
subject to Ax = b
x >= 0
where x is the vector of variables to be solved for, A is a matrix of known coefficients, and c and b are vectors of known coefficients. The expression "cx" is called the objective function, and the equations "Ax=b" are called the constraints. LP is widely used for portfolio optimization, for instance, to mimic the performance of an index, to minimize tracking error of your portfolio, etc. Don't hesitate to try it yourself.
PS: lp-solver can be called as a library from different languages like C, VB, .NET, Delphi, Excel, Java, ...It can also be called from AMPL, MATLAB, O-Matrix, Scilab, Octave, R via a driver program. you will find a way.
Download at http://lpsolve.sourceforge.net/5.5/.
Optimization packages are widelyspread, here is a site i introduced, optimization package. Several days ago a friend of mine sent me a link about lp-solver, which is a Mixed Integer Linear Programming (MILP) solver, convenient to use and highly efficient, cannot help sharing with you all. (please submit your favorite code site if you happen to find one and help others, thanx.)
The name itself tells you this package is for linear programming problem, What is Linear Programming then? A Linear Program (LP) is a problem that can be expressed as follows:
minimize cx
subject to Ax = b
x >= 0
where x is the vector of variables to be solved for, A is a matrix of known coefficients, and c and b are vectors of known coefficients. The expression "cx" is called the objective function, and the equations "Ax=b" are called the constraints. LP is widely used for portfolio optimization, for instance, to mimic the performance of an index, to minimize tracking error of your portfolio, etc. Don't hesitate to try it yourself.
PS: lp-solver can be called as a library from different languages like C, VB, .NET, Delphi, Excel, Java, ...It can also be called from AMPL, MATLAB, O-Matrix, Scilab, Octave, R via a driver program. you will find a way.
Download at http://lpsolve.sourceforge.net/5.5/.
Sep
4
In the post Optimization packages dozens of optimization routines can be downloaded, here I am going to share a special optimization method: evolutionary algorithm.
Evolutionary algorithms (EAs) are search methods that take their inspiration from natural selection and survival of the fittest in the biological world. EAs differ from more traditional optimization techniques in that they involve a search from a "population" of solutions, not from a single point. Each iteration of an EA involves a competitive selection that weeds out poor solutions. The solutions with high "fitness" are "recombined" with other solutions by swaping parts of a solution with another. Solutions are also "mutated" by making a small change to a single element of the solution. Recombination and mutation are used to generate new solutions that are biased towards regions of the space for which good solutions have already been seen.
Evolutionary algorithms (EAs) are search methods that take their inspiration from natural selection and survival of the fittest in the biological world. EAs differ from more traditional optimization techniques in that they involve a search from a "population" of solutions, not from a single point. Each iteration of an EA involves a competitive selection that weeds out poor solutions. The solutions with high "fitness" are "recombined" with other solutions by swaping parts of a solution with another. Solutions are also "mutated" by making a small change to a single element of the solution. Recombination and mutation are used to generate new solutions that are biased towards regions of the space for which good solutions have already been seen.
Aug
21
The efficient frontier was initiative specified by Markowitz in his innovative report . The theory deals an amounts of risky products and searches an optimal portfolio based on those possible investments.
Given a time interval, we could impute expected returns and volatilities. We could also specify a correlation of returns. The "optimal" portfolio can be formed in two methods:
first: for a certain level of volatility, count all portfolios that equal this volatility. amongst them all, choose the one with highest expected return.
second: for a given expected return, count all portfolios having this expected return. Choose the one which has the lowest volatility.
often numerical calculation is applied for optimization as we have additional constraints on the optimal portfolio, for instance, weight limits, etc. below is an Excel file demonstrating many assets Efficient Portfolio can be generated.
Given a time interval, we could impute expected returns and volatilities. We could also specify a correlation of returns. The "optimal" portfolio can be formed in two methods:
first: for a certain level of volatility, count all portfolios that equal this volatility. amongst them all, choose the one with highest expected return.
second: for a given expected return, count all portfolios having this expected return. Choose the one which has the lowest volatility.
often numerical calculation is applied for optimization as we have additional constraints on the optimal portfolio, for instance, weight limits, etc. below is an Excel file demonstrating many assets Efficient Portfolio can be generated.




