• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Optimization algorithms - use cases in finance

Hi all,

I have been programming some optimization algorithms during my spare time [link to the git repo] - just the basics such as GD, CGD, DIRECT, simulated annealing. I thought of creating my own little Julia package out of it - inspired by Optim.jl. What areas of finance is mathematical programming used?

If possible, I'd like to implement a small homegrown toy project.

Thanks,
Quasar.
 

Daniel Duffy

C++ author, trainer
Hi all,

I have been programming some optimization algorithms during my spare time [link to the git repo] - just the basics such as GD, CGD, DIRECT, simulated annealing. I thought of creating my own little Julia package out of it - inspired by Optim.jl. What areas of finance is mathematical programming used?

If possible, I'd like to implement a small homegrown toy project.

Thanks,
Quasar.
That's 3 questions

1. optimisation
2. Julia
3. Finance

Learn all 3 at once??

I would focus on least squares in C/C++. Then goto next level.

 
That's 3 questions

1. optimisation
2. Julia
3. Finance

Learn all 3 at once??

I would focus on least squares in C/C++. Then goto next level.

Hi Daniel,

My maxim : "stay hungry, stay foolish". But, I completely submit, that being structured, trying to learn a thing at a time will help.

I started writing code in Julia, as I felt, it's well suited to the problem domain of OR/optimization, perhaps it's the closest to human readable pseudo-code/algorithms. Super-excited to try and code solvers & implement the formulae from the books(my main reference is (i) Chong & Zak (ii) Nocedal), unit test on test functions.
 

Daniel Duffy

C++ author, trainer
Do you mean Nocedal and Wright? mathematically advanced and too theoretical for the current project. It is black belt stuff.

Bronson "Operations Research" (Schaum) is super!

A bit of free/non-binding advice..

I use Nocedal _And_ Nocedal at different times for different reasons.
Python has all that stuff. You could use it on the same problems as Julia ;)
Julia is probably OK but it is a quiche language IMHO, just like Rust etc.

Anyways, "different strokes for different folks", no one size fits all :)
 
Last edited:

Ken Abbott

Managing Director
Last edited:

Ken Abbott

Managing Director

Attachments

  • Elementary Portfolio Optimization.pdf
    225.9 KB · Views: 14
Do you mean Nocedal and Wright? mathematically advanced and too theoretical for the current project. It is black belt stuff.

Bronson "Operations Research" (Schaum) is super!

Yeah, Nocedal and Wright, only, referring to teeny weeny bits of it though, would be an overkill otherwise.

Thanks for suggesting about Bronson.
 
Last edited:

Daniel Duffy

C++ author, trainer
Another scenario is solving the Portfolio optimisation problem by using the existing libraries in Julia. Of course, it is possible to write your own code but why bother unless you want to become a numerical analyst?
 
Another scenario is solving the Portfolio optimisation problem by using the existing libraries in Julia. Of course, it is possible to write your own code but why bother unless you want to become a numerical analyst?
Solving the portfolio optimization problem is the number one scenario for me. Daniel, to begin with, I won't feel full, if I don't write a naive implementation of the meat of the algorithm. After a point of course, I'll just start using some QP solvers.

I am also keen to write some automatic differentiation code.

I'll post my stuff in this thread, it'll be good to get some feedback from folks out here.
 

Daniel Duffy

C++ author, trainer
The nice thing about Bronson is that it's got good examples that can be done with pencil and paper. Once that is done means the step to coding is easy and better than trial-and-error programming.
 

Ken Abbott

Managing Director
Solving the portfolio optimization problem is the number one scenario for me. Daniel, to begin with, I won't feel full, if I don't write a naive implementation of the meat of the algorithm. After a point of course, I'll just start using some QP solvers.

I am also keen to write some automatic differentiation code.

I'll post my stuff in this thread, it'll be good to get some feedback from folks out here.
This was my view. My experience with this was in the 1980s, so I did it using the linear algebra functions in Lotus 123, which for those under 50, is kind of like Latin compared with modern Italian. Getting my hands dirty with the actual calculus was very helpful.
 

Daniel Duffy

C++ author, trainer
Anyone out there used Visicalc on Apple II


It represented a revolution in personal computing. It was popular with e.g. cost engineers.

"VisiCalc isn't as easy to use as prepackaged home accounting programs, because you're required to design both the layout and the formulas used by the program. Because it is not pre-packaged, however, it's infinitely more powerful and flexible than such programs. You can use VisiCalc to balance your checkbook, keep track of credit card purchases, calculate your net worth, do your taxes—the possibilities are practically limitless."
 
Last edited:

Daniel Duffy

C++ author, trainer
This was my view. My experience with this was in the 1980s, so I did it using the linear algebra functions in Lotus 123, which for those under 50, is kind of like Latin compared with modern Italian. Getting my hands dirty with the actual calculus was very helpful.
Indeed. In many cases the best way to understand a model is to work out all the steps by hand in simplest case with pencil and paper, e.g. 2X2 case. Then automate the process.
 
Top