Optimization in MATLAB Seth DeLand

Similar documents
Solving Optimization Problems with MATLAB Loren Shure

Optimieren mit MATLAB jetzt auch gemischt-ganzzahlig Dr. Maka Karalashvili Application Engineer MathWorks

Global Optimization with MATLAB Products

MATLAB Based Optimization Techniques and Parallel Computing

Optimization with Scilab

Appendix A MATLAB s Optimization Toolbox Algorithms

Optimization Toolbox Release Notes

PROJECT REPORT. Parallel Optimization in Matlab. Joakim Agnarsson, Mikael Sunde, Inna Ermilova Project in Computational Science: Report January 2013

Genetic Algorithm and Direct Search Toolbox 2 User s Guide

TUTORIAL MATLAB OPTIMIZATION TOOLBOX

Active contour: a parallel genetic algorithm approach

Genetic Algorithm and Direct Search Toolbox For Use with MATLAB

Multi-objective Optimization

THE DEVELOPMENT OF THE POTENTIAL AND ACADMIC PROGRAMMES OF WROCLAW UNIVERISTY OF TECHNOLOGY METAHEURISTICS

Genetic Algorithm and Direct Search Toolbox

Introduction to Genetic Algorithms

Automated Trading with MATLAB Stuart Kozola Computational Finance

CHAPTER 2 CONVENTIONAL AND NON-CONVENTIONAL TECHNIQUES TO SOLVE ORPD PROBLEM

GENETIC ALGORITHM with Hands-On exercise

Module 1 Lecture Notes 2. Optimization Problem and Model Formulation

Development of optimization methods for Volvo fuel economy simulation. Master s thesis in Signal and Systems RAFAEL KLÜPPEL SMIJTINK

Multi-Objective Optimization Using Genetic Algorithms

Introduction to ANSYS DesignXplorer

Lecture 4. Convexity Robust cost functions Optimizing non-convex functions. 3B1B Optimization Michaelmas 2017 A. Zisserman

Application of Genetic Algorithms to CFD. Cameron McCartney

March 19, Heuristics for Optimization. Outline. Problem formulation. Genetic algorithms

The Genetic Algorithm for finding the maxima of single-variable functions

MOSEK Optimization Suite

Data Mining Chapter 8: Search and Optimization Methods Fall 2011 Ming Li Department of Computer Science and Technology Nanjing University

Reflector profile optimisation using Radiance

Heuristic Optimisation

Evolutionary Algorithms and the Cardinality Constrained Portfolio Optimization Problem

An introduction into numerical optimization with KNITRO

Trading Rule Optimization. By Yichi Zhang, Xinyan Hu

Introduction to MATLAB for Economics

Constrained Optimization COS 323

Theoretical Concepts of Machine Learning

Introduction to Linear Programming. Algorithmic and Geometric Foundations of Optimization

OPTIMIZATION METHODS. For more information visit: or send an to:

Space Shuttle External Tank Optimization

Using Genetic Algorithms to Solve the Box Stacking Problem

Introduction to Design Optimization

Today. Golden section, discussion of error Newton s method. Newton s method, steepest descent, conjugate gradient

CHAPTER 6 REAL-VALUED GENETIC ALGORITHMS

Escaping Local Optima: Genetic Algorithm

A Comparative Study of Frequency-domain Finite Element Updating Approaches Using Different Optimization Procedures

Laboratorio di Algoritmi Genetici

HYBRID GENETIC ALGORITHM WITH GREAT DELUGE TO SOLVE CONSTRAINED OPTIMIZATION PROBLEMS

Standard Optimization Techniques

Optimal Reactive Power Dispatch Using Hybrid Loop-Genetic Based Algorithm

Optimal Analysis of Economic Load Dispatch using Artificial Intelligence Techniques

Outline. CS 6776 Evolutionary Computation. Numerical Optimization. Fitness Function. ,x 2. ) = x 2 1. , x , 5.0 x 1.

Chapter 14 Global Search Algorithms

A Combinatorial Algorithm for The Cardinality Constrained Portfolio Optimization Problem

Lecture 25 Nonlinear Programming. November 9, 2009

Fast oriented bounding box optimization on the rotation group SO(3, R)

COUPLING TRNSYS AND MATLAB FOR GENETIC ALGORITHM OPTIMIZATION IN SUSTAINABLE BUILDING DESIGN

Comparative Analysis of Genetic Algorithm Implementations

Optimization in Scilab

Modeling and Simulation Aspects of Topological Design of Distributed Resource Islands

25. NLP algorithms. ˆ Overview. ˆ Local methods. ˆ Constrained optimization. ˆ Global methods. ˆ Black-box methods.

Genetic Algorithms Variations and Implementation Issues

Lecture 5: Optimization of accelerators in simulation and experiments. X. Huang USPAS, Jan 2015

Cost Functions in Machine Learning

Multidisciplinary System Optimization of Spacecraft Interferometer Testbed

Meta- Heuristic based Optimization Algorithms: A Comparative Study of Genetic Algorithm and Particle Swarm Optimization

Research on time optimal trajectory planning of 7-DOF manipulator based on genetic algorithm

Aero-engine PID parameters Optimization based on Adaptive Genetic Algorithm. Yinling Wang, Huacong Li

LECTURE NOTES Non-Linear Programming

International Journal of Digital Application & Contemporary research Website: (Volume 1, Issue 7, February 2013)

Genetic Algorithms. Kang Zheng Karl Schober

Computational Financial Modeling

A Brief Overview of Optimization Problems. Steven G. Johnson MIT course , Fall 2008

Machine Evolution. Machine Evolution. Let s look at. Machine Evolution. Machine Evolution. Machine Evolution. Machine Evolution

Neural Network Weight Selection Using Genetic Algorithms

Optimization. Using Analytic Solver Platform REVIEW BASED ON MANAGEMENT SCIENCE

Fast-Lipschitz Optimization

Developing Optimization Algorithms for Real-World Applications

Suppose you have a problem You don t know how to solve it What can you do? Can you use a computer to somehow find a solution for you?

Application of a Genetic Algorithm to a Scheduling Assignement Problem

CHAPTER 5 ENERGY MANAGEMENT USING FUZZY GENETIC APPROACH IN WSN

Tools & Applications 1. Introduction 2. Design of Matrix Turbines

MATLAB: The greatest thing ever. Why is MATLAB so great? Nobody s perfect, not even MATLAB. Prof. Dionne Aleman. Excellent matrix/vector handling

Webinar. Machine Tool Optimization with ANSYS optislang

CONLIN & MMA solvers. Pierre DUYSINX LTAS Automotive Engineering Academic year

Convex Optimization. August 26, 2008

Comparison between Neighbourhood and Genetic Algorithms on two Analytic Objective Functions and on a 2.5D Synthetic Seismic Inverse Problems

An evolutionary annealing-simplex algorithm for global optimisation of water resource systems

A Global Optimization Approach Applied to Structural Dynamic Updating

Metaheuristic Optimization with Evolver, Genocop and OptQuest

Classification of Optimization Problems and the Place of Calculus of Variations in it

Vectorization Using Stochastic Local Search

Influence of the tape number on the optimized structural performance of locally reinforced composite structures

DERIVATIVE-FREE OPTIMIZATION

OPTIMIZATION FOR SURFACE ROUGHNESS, MRR, POWER CONSUMPTION IN TURNING OF EN24 ALLOY STEEL USING GENETIC ALGORITHM

Speeding up MATLAB Applications The MathWorks, Inc.

Topological Machining Fixture Layout Synthesis Using Genetic Algorithms

Faculty of Science and Technology MASTER S THESIS

A = [1, 6; 78, 9] Note: everything is case-sensitive, so a and A are different. One enters the above matrix as

ARTIFICIAL INTELLIGENCE (CSCU9YE ) LECTURE 5: EVOLUTIONARY ALGORITHMS

Transcription:

Optimization in MATLAB Seth DeLand 4 The MathWorks, Inc.

Topics Intro Using gradient-based solvers Optimization in Comp. Finance toolboxes Global optimization Speeding up your optimizations

Optimization workflow Modify Design Variables No Initial Design Variables Model Objectives met? Yes Optimal Design

Optimization Problems Maximize Fuel Efficiency Minimize Risk Maximize Profits 4

Demo: Solving an optimization problem Simple objective function of variables: f x = log + x x x + x 4 Bound constraints:.5 x.5.5 x.5 6 4 - - - - 5

Portfolio Optimization Quadratic Constraints Maximize returns, constraint is risk minimize f T x subject to xt Cx Cmax Use fmincon interior-point algorithm Specify analytic gradients of objective function and constraints g = f (gradient of objective function) gc = Cx (gradient of constraint) Hessian (H) of Lagrangian L = f T x + λ( xt Cx Cmax) H = L = λc This is a second order conic programming problem 6

Demo: Cash-flow matching 5 x 5 Idea: Buy bonds to cover pension fund obligations Variables: How many of each bond to buy? Payments ($) 5 4 5 6 7 8 Time Period Constraints: Payments from bonds must be greater than or equal to pension fund obligations Objective: Minimize the size of the investment you make Cash Flow ($) 8 6 4 4 5 6 7 8 Time Period 7

Extending the problem x: n n 5 n = y n 5 = y 5 n n 5 y y 5 min x f T x s.t. Ax b A eq x = b eq lb x ub x(intcon) must be integers n n 5 y y 5 = cashflows n n 5 obligations cashflows zeros(8,5) n n 5 y y 5 obligations 8

Optimization Toolbox solvers Linear and Mixed- Integer LINPROG INTLINPROG Least Squares LSQLIN LSQNONNEG LSQCURVEFIT LSQNONLIN Quadratic QUADPROG Nonlinear FMINCON FMINUNC FMINBND FMINSEARCH FSEMINF Nonlinear Equation Solving FSOLVE FZERO Multiobjective FGOALATTAIN FMINIMAX 9

Key optimization problems addressed by financial toolboxes Financial Toolbox Mean-variance portfolio optimization Conditional Value at Risk (CVaR) portfolio optimization Econometrics Toolbox Parameter estimation of conditional mean/variance models Financial Instruments Toolbox Hedging portfolios Fitting interest rate curves Bootstrapping

Global optimization algorithms MultiStart Peaks GlobalSearch Patternsearch 8 6 4 - -4 Genetic Algorithm Simulated Annealing -6 - y Local minima - - - Global minima x

What is MultiStart? Run a local solver from each set of start points Option to filter starting points based on feasibility Supports parallel computing

MultiStart demo nonlinear regression lsqcurvefit solution MultiStart solution

What is Pattern Search? An approach that uses a pattern of search directions around the existing points Expands/contracts around the current point when a solution is not found Does not rely on gradients: works on smooth and nonsmooth problems 4

Pattern Search overview Iteration Run from specified x y - - - - - - x 5

Pattern Search overview Iteration Apply pattern vector, poll new points for improvement Mesh size = Pattern vectors = [,], [,], [-,], [,-] Pnew mesh _ size* pattern _ vector x *[,] x.8 4.6.6 First poll successful y.4 - Complete Poll (not default) - - - - - x 6

Pattern Search overview Iteration Mesh size = Pattern vectors = [,], [,], [-,], [,-] 4.6.8.6 y -.8.4. - - - - - - x -4 Complete Poll 7

Pattern Search overview Iteration Mesh size = 4 Pattern vectors = [,], [,], [-,], [,-] 4.6.8.6 y -.8.4. - - -4 - - - - x 8

Pattern Search overview Iteration 4 Mesh size = 4*.5 = Pattern vectors = [,], [,], [-,], [,-] 4.6.8.6 y -.8.4. - - -4 - - - - x 9

Pattern Search overview Iteration N Continue expansion/contraction until convergence 4.6.8.6 y -.8.4. - -6.5 - -4 - - - - x

Patternsearch demo stochastic function Stochastic objective function

What is a Genetic Algorithm? Uses concepts from evolutionary biology Start with an initial generation of candidate solutions that are tested against the objective function Subsequent generations evolve from the st through selection, crossover and mutation

How evolution works binary case Selection Retain the best performing bit strings from one generation to the next. Favor these for reproduction parent = [ ] parent = [ ] Crossover parent = [ ] parent = [ ] child = [ ] Mutation parent = [ ] child = [ ]

Genetic Algorithm Iteration Evaluate initial population y - - - - - - x 4

Genetic Algorithm Iteration Select a few good solutions for reproduction y - - - - - - x 5

Genetic Algorithm Iteration Generate new population and evaluate y - - - - - - x 6

Genetic Algorithm Iteration y - - - - - - x 7

Genetic Algorithm Iteration y - - - - - - x 8

Genetic Algorithm Iteration y - - - - - - x 9

Genetic Algorithm Iteration N Continue process until stopping criteria are met y - Solution found - - - - - x

Genetic Algorithm demo - Multiobjective Use gamultiobj to find Pareto front Two competing objectives: Second objective has sinusoidal component results in discontinuous front

Global Optimization Solvers designed to explore the solution space and find global solutions Problems can be stochastic, or nonsmooth Solvers in Global Optimization Toolbox MultiStart GlobalSearch simulannealbnd patternsearch ga (single- and multi-objective) Parallel Computing with ga, patternsearch, MultiStart

Speeding up with Parallel Computing Toolbox Global Optimization Toolbox: ga: Members of population evaluated in parallel at each generation patternsearch: Pattern evaluated in parallel (CompletePoll == on) MultiStart: Start points evaluated in parallel Optimization Toolbox: fmincon: parallel evaluation of objective function for finite differences fminimax, fgoalattain: same as fmincon In the objective function parfor

Key takeaways Solvers for a wide variety of problems New Mixed-Integer Linear Programming Solver Supply gradient and Hessian if possible Global solvers for multiple minimum and nonsmooth problems Speed up with parallel computing 4

Learn more about optimization with MATLAB MATLAB Digest: Using Symbolic Gradients for Optimization MATLAB Digest: Improving Optimization Performance with Parallel Computing Recorded webinar: Tips and Tricks Getting Started Using Optimization with MATLAB Recorded webinar: Global Optimization with MATLAB Products 5