Serving the Quantitative Finance Community

 
User avatar
EagerTigger
Topic Author
Posts: 1
Joined: February 20th, 2004, 4:17 pm

Optimization of least squares

August 19th, 2004, 2:41 pm

Hi everyone, I need to optimize an expression which is objective function, z = sum{[P(x1,x2,x3) - P]^2}where P(x1, x2, x3, x4) is a function with four variables x1, x2, x3 and x4 and whereby there're separate constraints on each of these four variables.May I ask if anyone has any similar ready VBA / C source code for such a optimization routine? Or can anyone advise what is the best algorithm for running this? Any direction/references will be welcome.Thanks!
 
User avatar
SPAAGG
Posts: 3
Joined: March 21st, 2003, 1:31 pm

Optimization of least squares

August 19th, 2004, 3:08 pm

I would use Differential Evolution algohttp://www.icsi.berkeley.edu/~storn/code.htmlthis is certainly too heavy machinery, but still interesting and you'll end up with a global minhope it helps
 
User avatar
yuanche17
Posts: 0
Joined: August 8th, 2003, 3:34 am

Optimization of least squares

August 19th, 2004, 3:25 pm

goto http://www.ics.forth.gr/~lourakis/levmar/I have used Levenberg-Marquardt of nonlinear least square of relatively few variables. The algorithm is proven to be robust and efficient.
 
User avatar
challenged
Posts: 1
Joined: February 24th, 2003, 3:26 pm

Optimization of least squares

August 19th, 2004, 3:48 pm

You could use Excel’s Solver and call it from your VBA code.
 
User avatar
Maelo
Posts: 0
Joined: July 28th, 2002, 3:17 am

Optimization of least squares

August 20th, 2004, 8:55 am

Matlab programming; you could comapre L-M against solver excel output (be advise: I found that excel solver has some sort of glitch when it come to integer prog.). M
 
User avatar
EagerTigger
Topic Author
Posts: 1
Joined: February 20th, 2004, 4:17 pm

Optimization of least squares

August 22nd, 2004, 3:07 pm

thanks guys. found all the comments pretty useful. Cheers!