SlideShare a Scribd company logo
Topics in Optimization
2019 Copyright QuantUniversity LLC.
Presented By:
Anish Shah, CFA
Optimization Lead
QuantUniversity
• Anish leads Optimization workshops at
QuantUniversity.
• Anish has worked as an investment quant at the
alternative data hedge fund Cargometrics,
Northfield, and ITG.
• He holds an MS in Applied Math from Brown
University and an MS in Operations Research from
the University of California, Berkeley.
Anish Shah
Optimization Lead
2
3
Once you work on data, optimization is as fundamental as linear
algebra and appears everywhere, if not explicitly, then under the
hood
Inference typically happens by maximizing a likelihood or probability
OLS regression (solved analytically)
median regression
GARCH
fitting parameters to match the data, e.g. in a Kalman Filter
Why should a quant care? Inference.
Model something, add optimization, and create a “robot”, a tool that
does the task automatically and better
Google Maps models roads and finds short paths
Expedia models flights and finds inexpensive trips
Portfolio optimization models security returns’ movement and maximizes risk-
adjusted return
Algorithmic trading models how stock prices move in response to orders and
executes trades at low cost and risk
Opportunity to create and add tremendous value
Why care? Build robots.
Optimization puts the learning in machine learning
‘Training’ = minimizing a loss function
In classification, e.g. cross-entropy = – log[p(correct label)]
In numeric, e.g. squared error = (true value – prediction)2
To train a network to identify cats
Using many photos labeled cat or not, optimize its weights to minimize
avg cross-entropy of [network’s predicted probability, true label]
Why care? Machine Learning.
In real-world setups, no guarantee that the optimization is solvable
However, particular well-studied classes have good algorithms and
assurances of finding a best solution
Knowing lets you restate or approximate yours as one
Even if you can’t, knowing how things can fail lets you proceed
skillfully
Why care? Knowledge improves outcomes.
x : variables that you can play with
e.g. in portfolio optimization, one entry could be % invested in AMZN
in finding the shortest route, it could be 1 if a road is used, 0 if not
f(x) : ‘objective function’ - criterion you want to maximize or
minimize
e.g. portfolio’s forecasted risk-penalized return – transaction costs
expected time from point A to B – a penalty on variability
h(x) ≤ b : constraints
e.g. no more than 20% of portfolio in tech stocks
at every node (excluding start and finish), sum roads entering = sum exits
General setup
Goal: maximize expected return with a penalty on variance and costs
x : vector of security weights to be found x0 : vector of initial security weights
r : forecast return Σ : forecast covariance
λ : risk aversion ɣ : cost aversion
A, b : define linear constraints
maxx rT x – λ xT Σ x – ɣ cost(x – x0)
s.t. A x ≤ b
Example: (vanilla) portfolio optimization
Convex optimization - minimizing a bowl shaped function under
constraints that, if met by any two points, are also met by all the
points on the line between them
Linear programming - linear objective, linear constraints
Quadratic programming - quadratic objective, linear constraints
SOCP - linear objective, quadratic constraints
All other convex solved by general algorithms
* Note: ‘programming’ just means optimization
Structures that make life easy
Linear constraints
A x ≤ b
Linear objective function in linear programming
min cT x
Quadratic objective function in quadratic programming
min ½ xT Q x + cT x
Linear and quadratic programming
Assorted graph problems - shortest path, maximum flow, …
Algorithm is specific to the problem
Dynamic programming - a general principle used when the problem
separates into contingent subproblems
e.g. the shortest way from NY → LA can be broken into finding
1) the shortest way from NY → every bridge that crosses the Mississippi
2) the shortest way from every bridge that crosses the Mississippi → LA
Encounter things of this flavor in reinforcement learning
EM (expectation maximization) - solvable in alternating steps, very
particular
Structures that make life easy (2)
13
Non-convex objective functions – many extrema
Non-convex constraints – path connecting acceptable points violates
constraints
Integer constraints or variables
e.g. in portfolio optimization, trading securities in fixed sizes (round lots
of 100 shares, whole futures contracts)
Solved by a combination of heuristics and brute force
Structures that make life hard
Relaxation - sequentially approximate as an easier problem and solve
Iterate - from wherever you are, move in a direction that meets
constraints and improves the objective, perhaps leaving opportunity
to jump around (Metropolis) to avoid stalling at a local extremum
What do you outside the easy cases?
Imagine fitting a machine learning model, with N observations of
labeled data
zi : data for ith observation
yi : label for ith observation
x : parameters (to be fit) of the model
g(x, zi) : model’s output for observation i
Given some loss function f, the goal is
Minimizex ∑i=1..N loss(labeli, model outputi) = ∑i=1..N f(yi, g(x, zi) )
Following the gradient
Want to minimizex ∑i=1..N f(yi, g(x, zi) )
Start with an initial value of x and step to improve the objective
Why not the direction of the gradient?
x ← x – a ∑i=1..N ∇f(yi, g(x, zi))
Called ‘steepest descent’ in the optimization literature
Was regarded as a bad idea, slowed by differences in scale
Better is inverse of curvature (2nd derivatives) x gradient
Following the gradient (2)
Want to minimizex ∑i=1..N f(yi, g(x, zi) )
refine x using one or a few sampled points rather than all the data
x ← x – a ∇f(yk, g(x, zk))
k : the random sample
a : the learning rate which is decayed over time
Much lower computational cost
Works as well, except for final refinement
Steepest descent reemerges as
stochastic gradient descent (SGD) in deep learning
Stops at ‘local maximum’ if the function maximized is not a mountain
peak but a mountain range
Proceeds slowly and costly (AWS $) because of a poorly tuned or
inappropriate algorithm
Chases noise or overfits yielding poor out-of-sample results
How can optimization go wrong?
Suppose the goal is minx f(x, y) where y is noisy data
Robust optimization - finds the best worst case given a range of inputs
minx maxy f(x, y) where y, rather than being fixed, takes value in a range
hard to solve except for special cases
Regularization - penalizes the norm of the decision variable
minx f(x, y) + λ |x|
Ridge regression, lasso penalty, ...
Tightly connected to Bayesian statistics
Addressing noise and overfitting
Portfolio optimization
(Anish Shah 2015) Uncertain covariance and (patent-pending)
uncertainty-penalized utility
Maximize E[utility] – ɣ stdev[utility]
Deep learning - ‘dropout’
At each training optimization step, randomly omit connections so
information isn’t overfit and gets spread throughout the network
More on regularization
21
• cvxopt – convex optimizer library
• nlopt – nonlinear optimizer library
• CBC – mixed integer programming library
• Google OR Tools – lp and assorted graph algorithms
• CPLEX – commercial optimizer for the hardest problems
Optimization tools
22
• Portfolio optimization
• Algorithmic trading
• Index/ETF construction
• Hedging
• Asset/liability matching
• Nowcasting covariance
Applications in Finance
Optimization is everywhere, especially as ML becomes pervasive
This is the direction quant is headed
Knowledge lets you create and add more value
The optimization piece of ML doesn’t seem fully matured – there are
puzzles to be solved!
Summary

More Related Content

What's hot

Time series analysis : Refresher and Innovations
Time series analysis : Refresher and InnovationsTime series analysis : Refresher and Innovations
Time series analysis : Refresher and Innovations
QuantUniversity
 
Anomaly detection
Anomaly detectionAnomaly detection
Anomaly detection
QuantUniversity
 
Ds for finance day 2
Ds for finance day 2Ds for finance day 2
Ds for finance day 2
QuantUniversity
 
Ds for finance day 3
Ds for finance day 3Ds for finance day 3
Ds for finance day 3
QuantUniversity
 
Data mining Part 1
Data mining Part 1Data mining Part 1
Data mining Part 1
Gautam Kumar
 
Synthetic VIX Data Generation Using ML Techniques
Synthetic VIX Data Generation Using ML TechniquesSynthetic VIX Data Generation Using ML Techniques
Synthetic VIX Data Generation Using ML Techniques
QuantUniversity
 
ML master class
ML master classML master class
ML master class
QuantUniversity
 
Machine Learning Interpretability
Machine Learning InterpretabilityMachine Learning Interpretability
Machine Learning Interpretability
QuantUniversity
 
Explainable AI Workshop
Explainable AI WorkshopExplainable AI Workshop
Explainable AI Workshop
QuantUniversity
 
Constructing Private Asset Benchmarks
Constructing Private Asset BenchmarksConstructing Private Asset Benchmarks
Constructing Private Asset Benchmarks
QuantUniversity
 
Anomaly Detection
Anomaly DetectionAnomaly Detection
Anomaly Detection
guest0edcaf
 
Machine Learning for Finance Master Class
Machine Learning for Finance Master Class Machine Learning for Finance Master Class
Machine Learning for Finance Master Class
QuantUniversity
 
Machine learning algorithms and business use cases
Machine learning algorithms and business use casesMachine learning algorithms and business use cases
Machine learning algorithms and business use cases
Sridhar Ratakonda
 
model simulating
model simulatingmodel simulating
model simulating
FEG
 
Credit card fraud detection using python machine learning
Credit card fraud detection using python machine learningCredit card fraud detection using python machine learning
Credit card fraud detection using python machine learning
Sandeep Garg
 
Supervised learning
Supervised learningSupervised learning
Supervised learning
Johnson Ubah
 
L2. Evaluating Machine Learning Algorithms I
L2. Evaluating Machine Learning Algorithms IL2. Evaluating Machine Learning Algorithms I
L2. Evaluating Machine Learning Algorithms I
Machine Learning Valencia
 
Machine learning algorithms
Machine learning algorithmsMachine learning algorithms
Machine learning algorithms
Shalitha Suranga
 
Machine Learning and Real-World Applications
Machine Learning and Real-World ApplicationsMachine Learning and Real-World Applications
Machine Learning and Real-World Applications
MachinePulse
 
Data Analysis: Evaluation Metrics for Supervised Learning Models of Machine L...
Data Analysis: Evaluation Metrics for Supervised Learning Models of Machine L...Data Analysis: Evaluation Metrics for Supervised Learning Models of Machine L...
Data Analysis: Evaluation Metrics for Supervised Learning Models of Machine L...
Md. Main Uddin Rony
 

What's hot (20)

Time series analysis : Refresher and Innovations
Time series analysis : Refresher and InnovationsTime series analysis : Refresher and Innovations
Time series analysis : Refresher and Innovations
 
Anomaly detection
Anomaly detectionAnomaly detection
Anomaly detection
 
Ds for finance day 2
Ds for finance day 2Ds for finance day 2
Ds for finance day 2
 
Ds for finance day 3
Ds for finance day 3Ds for finance day 3
Ds for finance day 3
 
Data mining Part 1
Data mining Part 1Data mining Part 1
Data mining Part 1
 
Synthetic VIX Data Generation Using ML Techniques
Synthetic VIX Data Generation Using ML TechniquesSynthetic VIX Data Generation Using ML Techniques
Synthetic VIX Data Generation Using ML Techniques
 
ML master class
ML master classML master class
ML master class
 
Machine Learning Interpretability
Machine Learning InterpretabilityMachine Learning Interpretability
Machine Learning Interpretability
 
Explainable AI Workshop
Explainable AI WorkshopExplainable AI Workshop
Explainable AI Workshop
 
Constructing Private Asset Benchmarks
Constructing Private Asset BenchmarksConstructing Private Asset Benchmarks
Constructing Private Asset Benchmarks
 
Anomaly Detection
Anomaly DetectionAnomaly Detection
Anomaly Detection
 
Machine Learning for Finance Master Class
Machine Learning for Finance Master Class Machine Learning for Finance Master Class
Machine Learning for Finance Master Class
 
Machine learning algorithms and business use cases
Machine learning algorithms and business use casesMachine learning algorithms and business use cases
Machine learning algorithms and business use cases
 
model simulating
model simulatingmodel simulating
model simulating
 
Credit card fraud detection using python machine learning
Credit card fraud detection using python machine learningCredit card fraud detection using python machine learning
Credit card fraud detection using python machine learning
 
Supervised learning
Supervised learningSupervised learning
Supervised learning
 
L2. Evaluating Machine Learning Algorithms I
L2. Evaluating Machine Learning Algorithms IL2. Evaluating Machine Learning Algorithms I
L2. Evaluating Machine Learning Algorithms I
 
Machine learning algorithms
Machine learning algorithmsMachine learning algorithms
Machine learning algorithms
 
Machine Learning and Real-World Applications
Machine Learning and Real-World ApplicationsMachine Learning and Real-World Applications
Machine Learning and Real-World Applications
 
Data Analysis: Evaluation Metrics for Supervised Learning Models of Machine L...
Data Analysis: Evaluation Metrics for Supervised Learning Models of Machine L...Data Analysis: Evaluation Metrics for Supervised Learning Models of Machine L...
Data Analysis: Evaluation Metrics for Supervised Learning Models of Machine L...
 

Similar to Optimization

Machine Learning Notes for beginners ,Step by step
Machine Learning Notes for beginners ,Step by stepMachine Learning Notes for beginners ,Step by step
Machine Learning Notes for beginners ,Step by step
SanjanaSaxena17
 
Dask glm-scipy2017-final
Dask glm-scipy2017-finalDask glm-scipy2017-final
Dask glm-scipy2017-final
Hussain Sultan
 
A tour of the top 10 algorithms for machine learning newbies
A tour of the top 10 algorithms for machine learning newbiesA tour of the top 10 algorithms for machine learning newbies
A tour of the top 10 algorithms for machine learning newbies
Vimal Gupta
 
supervised.pptx
supervised.pptxsupervised.pptx
supervised.pptx
MohamedSaied316569
 
Introduction to Machine Learning Aristotelis Tsirigos
Introduction to Machine Learning Aristotelis Tsirigos Introduction to Machine Learning Aristotelis Tsirigos
Introduction to Machine Learning Aristotelis Tsirigos butest
 
Support Vector Machines
Support Vector MachinesSupport Vector Machines
Support Vector Machinesnextlib
 
4.Support Vector Machines.ppt machine learning and development
4.Support Vector Machines.ppt machine learning and development4.Support Vector Machines.ppt machine learning and development
4.Support Vector Machines.ppt machine learning and development
PriyankaRamavath3
 
AML_030607.ppt
AML_030607.pptAML_030607.ppt
AML_030607.pptbutest
 
Machine learning (5)
Machine learning (5)Machine learning (5)
Machine learning (5)NYversity
 
isabelle_webinar_jan..
isabelle_webinar_jan..isabelle_webinar_jan..
isabelle_webinar_jan..butest
 
Text Classification with Lucene/Solr, Apache Hadoop and LibSVM
Text Classification with Lucene/Solr, Apache Hadoop and LibSVMText Classification with Lucene/Solr, Apache Hadoop and LibSVM
Text Classification with Lucene/Solr, Apache Hadoop and LibSVM
lucenerevolution
 
Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)
Zihui Li
 
Textmining Predictive Models
Textmining Predictive ModelsTextmining Predictive Models
Textmining Predictive Models
guest0edcaf
 
Textmining Predictive Models
Textmining Predictive ModelsTextmining Predictive Models
Textmining Predictive Models
Datamining Tools
 
Textmining Predictive Models
Textmining Predictive ModelsTextmining Predictive Models
Textmining Predictive Models
DataminingTools Inc
 
Keynote at IWLS 2017
Keynote at IWLS 2017Keynote at IWLS 2017
Keynote at IWLS 2017
Manish Pandey
 
Software tookits for machine learning and graphical models
Software tookits for machine learning and graphical modelsSoftware tookits for machine learning and graphical models
Software tookits for machine learning and graphical modelsbutest
 
Machine learning for_finance
Machine learning for_financeMachine learning for_finance
Machine learning for_finance
Stefan Duprey
 
DeepLearningLecture.pptx
DeepLearningLecture.pptxDeepLearningLecture.pptx
DeepLearningLecture.pptx
ssuserf07225
 

Similar to Optimization (20)

Machine Learning Notes for beginners ,Step by step
Machine Learning Notes for beginners ,Step by stepMachine Learning Notes for beginners ,Step by step
Machine Learning Notes for beginners ,Step by step
 
Dask glm-scipy2017-final
Dask glm-scipy2017-finalDask glm-scipy2017-final
Dask glm-scipy2017-final
 
A tour of the top 10 algorithms for machine learning newbies
A tour of the top 10 algorithms for machine learning newbiesA tour of the top 10 algorithms for machine learning newbies
A tour of the top 10 algorithms for machine learning newbies
 
supervised.pptx
supervised.pptxsupervised.pptx
supervised.pptx
 
Introduction to Machine Learning Aristotelis Tsirigos
Introduction to Machine Learning Aristotelis Tsirigos Introduction to Machine Learning Aristotelis Tsirigos
Introduction to Machine Learning Aristotelis Tsirigos
 
Support Vector Machines
Support Vector MachinesSupport Vector Machines
Support Vector Machines
 
DAA UNIT 3
DAA UNIT 3DAA UNIT 3
DAA UNIT 3
 
4.Support Vector Machines.ppt machine learning and development
4.Support Vector Machines.ppt machine learning and development4.Support Vector Machines.ppt machine learning and development
4.Support Vector Machines.ppt machine learning and development
 
AML_030607.ppt
AML_030607.pptAML_030607.ppt
AML_030607.ppt
 
Machine learning (5)
Machine learning (5)Machine learning (5)
Machine learning (5)
 
isabelle_webinar_jan..
isabelle_webinar_jan..isabelle_webinar_jan..
isabelle_webinar_jan..
 
Text Classification with Lucene/Solr, Apache Hadoop and LibSVM
Text Classification with Lucene/Solr, Apache Hadoop and LibSVMText Classification with Lucene/Solr, Apache Hadoop and LibSVM
Text Classification with Lucene/Solr, Apache Hadoop and LibSVM
 
Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)
 
Textmining Predictive Models
Textmining Predictive ModelsTextmining Predictive Models
Textmining Predictive Models
 
Textmining Predictive Models
Textmining Predictive ModelsTextmining Predictive Models
Textmining Predictive Models
 
Textmining Predictive Models
Textmining Predictive ModelsTextmining Predictive Models
Textmining Predictive Models
 
Keynote at IWLS 2017
Keynote at IWLS 2017Keynote at IWLS 2017
Keynote at IWLS 2017
 
Software tookits for machine learning and graphical models
Software tookits for machine learning and graphical modelsSoftware tookits for machine learning and graphical models
Software tookits for machine learning and graphical models
 
Machine learning for_finance
Machine learning for_financeMachine learning for_finance
Machine learning for_finance
 
DeepLearningLecture.pptx
DeepLearningLecture.pptxDeepLearningLecture.pptx
DeepLearningLecture.pptx
 

More from QuantUniversity

EU Artificial Intelligence Act 2024 passed !
EU Artificial Intelligence Act 2024 passed !EU Artificial Intelligence Act 2024 passed !
EU Artificial Intelligence Act 2024 passed !
QuantUniversity
 
Managing-the-Risks-of-LLMs-in-FS-Industry-Roundtable-TruEra-QuantU.pdf
Managing-the-Risks-of-LLMs-in-FS-Industry-Roundtable-TruEra-QuantU.pdfManaging-the-Risks-of-LLMs-in-FS-Industry-Roundtable-TruEra-QuantU.pdf
Managing-the-Risks-of-LLMs-in-FS-Industry-Roundtable-TruEra-QuantU.pdf
QuantUniversity
 
PYTHON AND DATA SCIENCE FOR INVESTMENT PROFESSIONALS
PYTHON AND DATA SCIENCE FOR INVESTMENT PROFESSIONALSPYTHON AND DATA SCIENCE FOR INVESTMENT PROFESSIONALS
PYTHON AND DATA SCIENCE FOR INVESTMENT PROFESSIONALS
QuantUniversity
 
Qu for India - QuantUniversity FundRaiser
Qu for India  - QuantUniversity FundRaiserQu for India  - QuantUniversity FundRaiser
Qu for India - QuantUniversity FundRaiser
QuantUniversity
 
Ml master class for CFA Dallas
Ml master class for CFA DallasMl master class for CFA Dallas
Ml master class for CFA Dallas
QuantUniversity
 
Algorithmic auditing 1.0
Algorithmic auditing 1.0Algorithmic auditing 1.0
Algorithmic auditing 1.0
QuantUniversity
 
Towards Fairer Datasets: Filtering and Balancing the Distribution of the Peop...
Towards Fairer Datasets: Filtering and Balancing the Distribution of the Peop...Towards Fairer Datasets: Filtering and Balancing the Distribution of the Peop...
Towards Fairer Datasets: Filtering and Balancing the Distribution of the Peop...
QuantUniversity
 
Machine Learning: Considerations for Fairly and Transparently Expanding Acces...
Machine Learning: Considerations for Fairly and Transparently Expanding Acces...Machine Learning: Considerations for Fairly and Transparently Expanding Acces...
Machine Learning: Considerations for Fairly and Transparently Expanding Acces...
QuantUniversity
 
Seeing what a gan cannot generate: paper review
Seeing what a gan cannot generate: paper reviewSeeing what a gan cannot generate: paper review
Seeing what a gan cannot generate: paper review
QuantUniversity
 
AI Explainability and Model Risk Management
AI Explainability and Model Risk ManagementAI Explainability and Model Risk Management
AI Explainability and Model Risk Management
QuantUniversity
 
Algorithmic auditing 1.0
Algorithmic auditing 1.0Algorithmic auditing 1.0
Algorithmic auditing 1.0
QuantUniversity
 
Machine Learning in Finance: 10 Things You Need to Know in 2021
Machine Learning in Finance: 10 Things You Need to Know in 2021Machine Learning in Finance: 10 Things You Need to Know in 2021
Machine Learning in Finance: 10 Things You Need to Know in 2021
QuantUniversity
 
Bayesian Portfolio Allocation
Bayesian Portfolio AllocationBayesian Portfolio Allocation
Bayesian Portfolio Allocation
QuantUniversity
 
The API Jungle
The API JungleThe API Jungle
The API Jungle
QuantUniversity
 
Responsible AI in Action
Responsible AI in ActionResponsible AI in Action
Responsible AI in Action
QuantUniversity
 
Qu speaker series 14: Synthetic Data Generation in Finance
Qu speaker series 14: Synthetic Data Generation in FinanceQu speaker series 14: Synthetic Data Generation in Finance
Qu speaker series 14: Synthetic Data Generation in Finance
QuantUniversity
 
Qwafafew meeting 5
Qwafafew meeting 5Qwafafew meeting 5
Qwafafew meeting 5
QuantUniversity
 
Qu speaker series:Ethical Use of AI in Financial Markets
Qu speaker series:Ethical Use of AI in Financial MarketsQu speaker series:Ethical Use of AI in Financial Markets
Qu speaker series:Ethical Use of AI in Financial Markets
QuantUniversity
 
Fintech in the Post-Covid Age
Fintech in the Post-Covid AgeFintech in the Post-Covid Age
Fintech in the Post-Covid Age
QuantUniversity
 
Ml master class northeastern university
Ml master class   northeastern universityMl master class   northeastern university
Ml master class northeastern university
QuantUniversity
 

More from QuantUniversity (20)

EU Artificial Intelligence Act 2024 passed !
EU Artificial Intelligence Act 2024 passed !EU Artificial Intelligence Act 2024 passed !
EU Artificial Intelligence Act 2024 passed !
 
Managing-the-Risks-of-LLMs-in-FS-Industry-Roundtable-TruEra-QuantU.pdf
Managing-the-Risks-of-LLMs-in-FS-Industry-Roundtable-TruEra-QuantU.pdfManaging-the-Risks-of-LLMs-in-FS-Industry-Roundtable-TruEra-QuantU.pdf
Managing-the-Risks-of-LLMs-in-FS-Industry-Roundtable-TruEra-QuantU.pdf
 
PYTHON AND DATA SCIENCE FOR INVESTMENT PROFESSIONALS
PYTHON AND DATA SCIENCE FOR INVESTMENT PROFESSIONALSPYTHON AND DATA SCIENCE FOR INVESTMENT PROFESSIONALS
PYTHON AND DATA SCIENCE FOR INVESTMENT PROFESSIONALS
 
Qu for India - QuantUniversity FundRaiser
Qu for India  - QuantUniversity FundRaiserQu for India  - QuantUniversity FundRaiser
Qu for India - QuantUniversity FundRaiser
 
Ml master class for CFA Dallas
Ml master class for CFA DallasMl master class for CFA Dallas
Ml master class for CFA Dallas
 
Algorithmic auditing 1.0
Algorithmic auditing 1.0Algorithmic auditing 1.0
Algorithmic auditing 1.0
 
Towards Fairer Datasets: Filtering and Balancing the Distribution of the Peop...
Towards Fairer Datasets: Filtering and Balancing the Distribution of the Peop...Towards Fairer Datasets: Filtering and Balancing the Distribution of the Peop...
Towards Fairer Datasets: Filtering and Balancing the Distribution of the Peop...
 
Machine Learning: Considerations for Fairly and Transparently Expanding Acces...
Machine Learning: Considerations for Fairly and Transparently Expanding Acces...Machine Learning: Considerations for Fairly and Transparently Expanding Acces...
Machine Learning: Considerations for Fairly and Transparently Expanding Acces...
 
Seeing what a gan cannot generate: paper review
Seeing what a gan cannot generate: paper reviewSeeing what a gan cannot generate: paper review
Seeing what a gan cannot generate: paper review
 
AI Explainability and Model Risk Management
AI Explainability and Model Risk ManagementAI Explainability and Model Risk Management
AI Explainability and Model Risk Management
 
Algorithmic auditing 1.0
Algorithmic auditing 1.0Algorithmic auditing 1.0
Algorithmic auditing 1.0
 
Machine Learning in Finance: 10 Things You Need to Know in 2021
Machine Learning in Finance: 10 Things You Need to Know in 2021Machine Learning in Finance: 10 Things You Need to Know in 2021
Machine Learning in Finance: 10 Things You Need to Know in 2021
 
Bayesian Portfolio Allocation
Bayesian Portfolio AllocationBayesian Portfolio Allocation
Bayesian Portfolio Allocation
 
The API Jungle
The API JungleThe API Jungle
The API Jungle
 
Responsible AI in Action
Responsible AI in ActionResponsible AI in Action
Responsible AI in Action
 
Qu speaker series 14: Synthetic Data Generation in Finance
Qu speaker series 14: Synthetic Data Generation in FinanceQu speaker series 14: Synthetic Data Generation in Finance
Qu speaker series 14: Synthetic Data Generation in Finance
 
Qwafafew meeting 5
Qwafafew meeting 5Qwafafew meeting 5
Qwafafew meeting 5
 
Qu speaker series:Ethical Use of AI in Financial Markets
Qu speaker series:Ethical Use of AI in Financial MarketsQu speaker series:Ethical Use of AI in Financial Markets
Qu speaker series:Ethical Use of AI in Financial Markets
 
Fintech in the Post-Covid Age
Fintech in the Post-Covid AgeFintech in the Post-Covid Age
Fintech in the Post-Covid Age
 
Ml master class northeastern university
Ml master class   northeastern universityMl master class   northeastern university
Ml master class northeastern university
 

Recently uploaded

原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
u86oixdj
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTESAdjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Subhajit Sahu
 
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptxData_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
AnirbanRoy608946
 
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
dwreak4tg
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
TravisMalana
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
slg6lamcq
 
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
v3tuleee
 
一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单
ewymefz
 
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
2023240532
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
jerlynmaetalle
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
John Andrews
 
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
slg6lamcq
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
Subhajit Sahu
 
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
ewymefz
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
ahzuo
 
The Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series DatabaseThe Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series Database
javier ramirez
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Subhajit Sahu
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
balafet
 
Everything you wanted to know about LIHTC
Everything you wanted to know about LIHTCEverything you wanted to know about LIHTC
Everything you wanted to know about LIHTC
Roger Valdez
 

Recently uploaded (20)

原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTESAdjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
 
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptxData_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
 
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
一比一原版(BCU毕业证书)伯明翰城市大学毕业证如何办理
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
 
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
 
一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单
 
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
Quantitative Data AnalysisReliability Analysis (Cronbach Alpha) Common Method...
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
 
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
 
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
 
The Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series DatabaseThe Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series Database
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
 
Everything you wanted to know about LIHTC
Everything you wanted to know about LIHTCEverything you wanted to know about LIHTC
Everything you wanted to know about LIHTC
 

Optimization

  • 1. Topics in Optimization 2019 Copyright QuantUniversity LLC. Presented By: Anish Shah, CFA Optimization Lead QuantUniversity
  • 2. • Anish leads Optimization workshops at QuantUniversity. • Anish has worked as an investment quant at the alternative data hedge fund Cargometrics, Northfield, and ITG. • He holds an MS in Applied Math from Brown University and an MS in Operations Research from the University of California, Berkeley. Anish Shah Optimization Lead 2
  • 3. 3
  • 4. Once you work on data, optimization is as fundamental as linear algebra and appears everywhere, if not explicitly, then under the hood Inference typically happens by maximizing a likelihood or probability OLS regression (solved analytically) median regression GARCH fitting parameters to match the data, e.g. in a Kalman Filter Why should a quant care? Inference.
  • 5. Model something, add optimization, and create a “robot”, a tool that does the task automatically and better Google Maps models roads and finds short paths Expedia models flights and finds inexpensive trips Portfolio optimization models security returns’ movement and maximizes risk- adjusted return Algorithmic trading models how stock prices move in response to orders and executes trades at low cost and risk Opportunity to create and add tremendous value Why care? Build robots.
  • 6. Optimization puts the learning in machine learning ‘Training’ = minimizing a loss function In classification, e.g. cross-entropy = – log[p(correct label)] In numeric, e.g. squared error = (true value – prediction)2 To train a network to identify cats Using many photos labeled cat or not, optimize its weights to minimize avg cross-entropy of [network’s predicted probability, true label] Why care? Machine Learning.
  • 7. In real-world setups, no guarantee that the optimization is solvable However, particular well-studied classes have good algorithms and assurances of finding a best solution Knowing lets you restate or approximate yours as one Even if you can’t, knowing how things can fail lets you proceed skillfully Why care? Knowledge improves outcomes.
  • 8. x : variables that you can play with e.g. in portfolio optimization, one entry could be % invested in AMZN in finding the shortest route, it could be 1 if a road is used, 0 if not f(x) : ‘objective function’ - criterion you want to maximize or minimize e.g. portfolio’s forecasted risk-penalized return – transaction costs expected time from point A to B – a penalty on variability h(x) ≤ b : constraints e.g. no more than 20% of portfolio in tech stocks at every node (excluding start and finish), sum roads entering = sum exits General setup
  • 9. Goal: maximize expected return with a penalty on variance and costs x : vector of security weights to be found x0 : vector of initial security weights r : forecast return Σ : forecast covariance λ : risk aversion ɣ : cost aversion A, b : define linear constraints maxx rT x – λ xT Σ x – ɣ cost(x – x0) s.t. A x ≤ b Example: (vanilla) portfolio optimization
  • 10. Convex optimization - minimizing a bowl shaped function under constraints that, if met by any two points, are also met by all the points on the line between them Linear programming - linear objective, linear constraints Quadratic programming - quadratic objective, linear constraints SOCP - linear objective, quadratic constraints All other convex solved by general algorithms * Note: ‘programming’ just means optimization Structures that make life easy
  • 11. Linear constraints A x ≤ b Linear objective function in linear programming min cT x Quadratic objective function in quadratic programming min ½ xT Q x + cT x Linear and quadratic programming
  • 12. Assorted graph problems - shortest path, maximum flow, … Algorithm is specific to the problem Dynamic programming - a general principle used when the problem separates into contingent subproblems e.g. the shortest way from NY → LA can be broken into finding 1) the shortest way from NY → every bridge that crosses the Mississippi 2) the shortest way from every bridge that crosses the Mississippi → LA Encounter things of this flavor in reinforcement learning EM (expectation maximization) - solvable in alternating steps, very particular Structures that make life easy (2)
  • 13. 13 Non-convex objective functions – many extrema Non-convex constraints – path connecting acceptable points violates constraints Integer constraints or variables e.g. in portfolio optimization, trading securities in fixed sizes (round lots of 100 shares, whole futures contracts) Solved by a combination of heuristics and brute force Structures that make life hard
  • 14. Relaxation - sequentially approximate as an easier problem and solve Iterate - from wherever you are, move in a direction that meets constraints and improves the objective, perhaps leaving opportunity to jump around (Metropolis) to avoid stalling at a local extremum What do you outside the easy cases?
  • 15. Imagine fitting a machine learning model, with N observations of labeled data zi : data for ith observation yi : label for ith observation x : parameters (to be fit) of the model g(x, zi) : model’s output for observation i Given some loss function f, the goal is Minimizex ∑i=1..N loss(labeli, model outputi) = ∑i=1..N f(yi, g(x, zi) ) Following the gradient
  • 16. Want to minimizex ∑i=1..N f(yi, g(x, zi) ) Start with an initial value of x and step to improve the objective Why not the direction of the gradient? x ← x – a ∑i=1..N ∇f(yi, g(x, zi)) Called ‘steepest descent’ in the optimization literature Was regarded as a bad idea, slowed by differences in scale Better is inverse of curvature (2nd derivatives) x gradient Following the gradient (2)
  • 17. Want to minimizex ∑i=1..N f(yi, g(x, zi) ) refine x using one or a few sampled points rather than all the data x ← x – a ∇f(yk, g(x, zk)) k : the random sample a : the learning rate which is decayed over time Much lower computational cost Works as well, except for final refinement Steepest descent reemerges as stochastic gradient descent (SGD) in deep learning
  • 18. Stops at ‘local maximum’ if the function maximized is not a mountain peak but a mountain range Proceeds slowly and costly (AWS $) because of a poorly tuned or inappropriate algorithm Chases noise or overfits yielding poor out-of-sample results How can optimization go wrong?
  • 19. Suppose the goal is minx f(x, y) where y is noisy data Robust optimization - finds the best worst case given a range of inputs minx maxy f(x, y) where y, rather than being fixed, takes value in a range hard to solve except for special cases Regularization - penalizes the norm of the decision variable minx f(x, y) + λ |x| Ridge regression, lasso penalty, ... Tightly connected to Bayesian statistics Addressing noise and overfitting
  • 20. Portfolio optimization (Anish Shah 2015) Uncertain covariance and (patent-pending) uncertainty-penalized utility Maximize E[utility] – ɣ stdev[utility] Deep learning - ‘dropout’ At each training optimization step, randomly omit connections so information isn’t overfit and gets spread throughout the network More on regularization
  • 21. 21 • cvxopt – convex optimizer library • nlopt – nonlinear optimizer library • CBC – mixed integer programming library • Google OR Tools – lp and assorted graph algorithms • CPLEX – commercial optimizer for the hardest problems Optimization tools
  • 22. 22 • Portfolio optimization • Algorithmic trading • Index/ETF construction • Hedging • Asset/liability matching • Nowcasting covariance Applications in Finance
  • 23. Optimization is everywhere, especially as ML becomes pervasive This is the direction quant is headed Knowledge lets you create and add more value The optimization piece of ML doesn’t seem fully matured – there are puzzles to be solved! Summary