MATLAB Based Optimization Techniques and Parallel Computing

Similar documents
Optimization in MATLAB Seth DeLand

Solving Optimization Problems with MATLAB Loren Shure

Global Optimization with MATLAB Products

Active contour: a parallel genetic algorithm approach

Using Parallel Computing Toolbox to accelerate the Video and Image Processing Speed. Develop parallel code interactively

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

Speeding up MATLAB Applications The MathWorks, Inc.

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

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

Introduction to MATLAB for Finance

Automated Trading with MATLAB Stuart Kozola Computational Finance

Parallel and Distributed Computing with MATLAB The MathWorks, Inc. 1

Using Genetic Algorithms to Solve the Box Stacking Problem

Parallel and Distributed Computing with MATLAB Gerardo Hernández Manager, Application Engineer

Optimizing and Accelerating Your MATLAB Code

Introduction to Genetic Algorithms

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

Vectorization Using Stochastic Local Search

GENETIC ALGORITHM with Hands-On exercise

Genetic Algorithm and Direct Search Toolbox

Speeding up MATLAB Applications Sean de Wolski Application Engineer

HYBRID GENETIC ALGORITHM WITH GREAT DELUGE TO SOLVE CONSTRAINED OPTIMIZATION PROBLEMS

Heuristic Optimisation

Multicore Computer, GPU 및 Cluster 환경에서의 MATLAB Parallel Computing 기능

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

Lecture x: MATLAB - advanced use cases

Design of a control system model in SimulationX using calibration and optimization. Dynardo GmbH

What s New with the MATLAB and Simulink Product Families. Marta Wilczkowiak & Coorous Mohtadi Application Engineering Group

Integrate MATLAB Analytics into Enterprise Applications

Metaheuristic Optimization with Evolver, Genocop and OptQuest

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?

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

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

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

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

An Introduction to Evolutionary Algorithms

Genetic Algorithm and Direct Search Toolbox For Use with MATLAB

Integrate MATLAB Analytics into Enterprise Applications

CPSC 340: Machine Learning and Data Mining. Principal Component Analysis Fall 2016

A Genetic Algorithm for Graph Matching using Graph Node Characteristics 1 2

5 Machine Learning Abstractions and Numerical Optimization

Multi-objective Optimization

Monika Maharishi Dayanand University Rohtak

Large Data in MATLAB: A Seismic Data Processing Case Study U. M. Sundar Senior Application Engineer

APPLIED OPTIMIZATION WITH MATLAB PROGRAMMING

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Module 1 Lecture Notes 2. Optimization Problem and Model Formulation

Technical Computing with MATLAB

LECTURE NOTES Non-Linear Programming

Introduction to Evolutionary Computation

Genetic Algorithm Based Template Optimization for a Vision System: Obstacle Detection

AN IMPROVED ITERATIVE METHOD FOR SOLVING GENERAL SYSTEM OF EQUATIONS VIA GENETIC ALGORITHMS

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

Webinar. Machine Tool Optimization with ANSYS optislang

Reflector calculation, validation and optimisation using Radiance Krzysztof WANDACHOWICZ

Ant Colony Optimization: A New Stochastic Solver for Modeling Vapor-Liquid Equilibrium Data

A Parallel Evolutionary Algorithm for Discovery of Decision Rules

Contents. I The Basic Framework for Stationary Problems 1

Communication and Wall clock time

CS281 Section 3: Practical Optimization

Experiment 6 SIMULINK

Parallel Computing with MATLAB

CHAPTER 4 WAVELET TRANSFORM-GENETIC ALGORITHM DENOISING TECHNIQUE

Dr.-Ing. Johannes Will CAD-FEM GmbH/DYNARDO GmbH dynamic software & engineering GmbH

Mit MATLAB auf der Überholspur Methoden zur Beschleunigung von MATLAB Anwendungen

DETERMINING MAXIMUM/MINIMUM VALUES FOR TWO- DIMENTIONAL MATHMATICLE FUNCTIONS USING RANDOM CREOSSOVER TECHNIQUES

Genetic Algorithm and Direct Search Toolbox 2 User s Guide

Developing Optimization Algorithms for Real-World Applications

A Parallel Architecture for the Generalized Traveling Salesman Problem

Application of Genetic Algorithms to CFD. Cameron McCartney

Classical Gradient Methods

A Combinatorial Algorithm for The Cardinality Constrained Portfolio Optimization Problem

MATLAB. Senior Application Engineer The MathWorks Korea The MathWorks, Inc. 2

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

Optimal Reactive Power Dispatch Using Hybrid Loop-Genetic Based Algorithm

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

Topological Machining Fixture Layout Synthesis Using Genetic Algorithms

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

A New Technique using GA style and LMS for Structure Adaptation

Experiment 8 SIMULINK

Natural Numbers and Integers. Big Ideas in Numerical Methods. Overflow. Real Numbers 29/07/2011. Taking some ideas from NM course a little further

The Cross-Entropy Method for Mathematical Programming

Solving Traveling Salesman Problem Using Parallel Genetic. Algorithm and Simulated Annealing

Real-Time Simulation of Simscape Models

Constrained Optimization COS 323

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

Outline. Motivation. Introduction of GAs. Genetic Algorithm 9/7/2017. Motivation Genetic algorithms An illustrative example Hypothesis space search

Parallel Computing with MATLAB

Genetic Algorithms Variations and Implementation Issues

Linear Methods for Regression and Shrinkage Methods

Accelerating Simulink Optimization, Code Generation & Test Automation Through Parallelization

A New Selection Operator - CSM in Genetic Algorithms for Solving the TSP

Neural Network Weight Selection Using Genetic Algorithms

MATLAB Distributed Computing Server Release Notes

Fundamentals of Integer Programming

Reflector profile optimisation using Radiance

Sparse Matrices Reordering using Evolutionary Algorithms: A Seeded Approach

Contents. I Basics 1. Copyright by SIAM. Unauthorized reproduction of this article is prohibited.

Using Existing Numerical Libraries on Spark

NEW ADVANCES IN GPU LINEAR ALGEBRA

Transcription:

MATLAB Based Optimization Techniques and Parallel Computing Bratislava June 4, 2009 2009 The MathWorks, Inc. Jörg-M. Sautter Application Engineer The MathWorks

Agenda Introduction Local and Smooth Optimization Example: Portfolio Optimization, part 1 Expected Shortfall GARCH Global or Non-Smooth Optimization Example: Portfolio Optimization, part 2 Parallel Computing Summary 2

Optimization workflow Major steps Define your problem Solve your problem possibly subject to constraints Analyze and visualize the result Demands Appropriate solver Fast solver Robust solver Customizable solver settings Easy to use 3

What you have to do Situation You know your objective function You know the constraints (if there are any) What you have to do Code your objective function (in MATLAB, C, C++, Excel, ) Code your constraints Determine the type of optimization problem Call the appropriate solver Note: there are exceptions which are even easier to handle 4

5 Classification Stochastic Stochastic Programming Programming Integer Integer Programming Programming Nonlinear Nonlinear Minimization Minimization Continuous Continuous Discrete Discrete Unconstrained Unconstrained Constrained Constrained Nonlinear Nonlinear Equations Equations Nonlinear Nonlinear Least Least-Squares Squares Global Global Optimization Optimization Linear Linear Programming Programming Nonlinearly Nonlinearly Constrained Constrained Quadratic Quadratic Programming Programming Nondifferentiable Nondifferentiable Optimization Optimization Constrained Constrained Linear Linear Least Least-Squares Squares Bound Bound Constrained Constrained Optimization Optimization Global Global Optimization Optimization

MATLAB Based Optimization Tools MATLAB Curve Fitting Toolbox Optimization Toolbox Genetic Algorithms and Direct Search Toolbox as well as Statistics Toolbox Symbolic Math Toolbox 6

Optimization with MATLAB Direct methods for linear systems square systems LU-decomposition Cholesky-decomposition QR-decomposition underdetermined systems overdetermined systems Iterative methods for linear systems cg-method (and variants) GMRES, QMR, MINRES, Polynomial approximation 7

Agenda Introduction Local and Smooth Optimization Example: Portfolio Optimization, part 1 Expected Shortfall GARCH Global or Non-Smooth Optimization Example: Portfolio Optimization, part 2 Parallel Computing Summary 8

Optimization Toolbox Graphical user interface and command line functions for: Linear and nonlinear programming Quadratic programming Nonlinear least squares and nonlinear equations Multi-objective optimization Binary integer programming Customizable algorithm options Standard and large-scale algorithms Output diagnostics 9

Example: Minimum of a smooth function 10

Agenda Introduction Local and Smooth Optimization Example: Portfolio Optimization, part 1 Expected Shortfall GARCH Global or Non-Smooth Optimization Example: Portfolio Optimization, part 2 Parallel Computing Summary 11

Example: Portfolio Optimization 12

Classic Mean-Variance A portfolio is MV optimal if it has least risk for a given level of returns: minimize subject to and possibly 13

Example: Expected Shortfall 14

Agenda Introduction Local and Smooth Optimization Example: Portfolio Optimization, part 1 Expected Shortfall GARCH Global or Non-Smooth Optimization Example: Portfolio Optimization, part 2 Parallel Computing Summary 15

Genetic Algorithm and Direct Search Toolbox Graphical user interface and command line functions for: Genetic algorithm solver Direct search solver Simulated annealing solver Useful for problems not easily addressed with Optimization Toolbox: Discontinuous Highly nonlinear Stochastic Discrete or custom data types 16

What is a Genetic Algorithm? Genetic Algorithms use concepts from evolutionary biology to find exact or approximate solutions to optimization problems Start with an initial generation of candidate solutions that are tested against the objective function Subsequent generations evolve from the 1 st through selection, crossover and mutation The individual that best minimizes the given objective is returned as the ideal solution 17

Example: Minimum of a stochastic function 18

Agenda Introduction Local and Smooth Optimization Example: Portfolio Optimization, part 1 Expected Shortfall GARCH Global or Non-Smooth Optimization Example: Portfolio Optimization, part 2 Parallel Computing Summary 19

Example: Custom Evolution Algorithms Encode which subset of equities to test using bit strings of 1 s and 0 s In this case, there are 30 bits with exactly 6 bits equal to 1 In general, each bit string will have N bits with exactly K bits equal to 1 It is inefficient to test every possible bit string. For N = 30, K = 6, there are 593,775 possible combinations! 20

Example: Custom Evolution Algorithms Selection Retain the best performing bit strings from one generation to the next. Favor these for reproduction Crossover parent1 = [ 1 0 1 0 0 1 1 0 0 0 ] parent2 = [ 1 0 0 1 0 0 1 0 1 0 ] child = [ 1 0 0 0 0 1 1 0 1 0 ] Mutation parent = [ 1 0 1 0 0 1 1 0 0 0 ] child = [ 0 1 0 1 0 1 0 0 0 1 ] 21

Toolbox Comparison Faster Can handle larger problems Better on non smooth, noisy, stochastic problems More likely to find global solution Can solve problems that involve custom data types Optimization Toolbox Genetic Algorithm and Direct Search Toolbox 22

Agenda Introduction Local and Smooth Optimization Example: Portfolio Optimization, part 1 Expected Shortfall GARCH Global or Non-Smooth Optimization Example: Portfolio Optimization, part 2 Parallel Computing Summary 23

Parallel Computing with MATLAB Why parallel computing? How easy is it to use? Licensing Do I need special hardware? Parallel computing and optimization 24

Large Data Set Handling Workarounds Reduce Data Wait Solutions Increase Addressable Memory Add Processors 25

calculation time Number of machines increases number of machines 26

calculation time Calculation time decreases number of machines 27

Parallel Computing with MATLAB Why parallel computing? How easy is it to use? Licensing Do I need special hardware? Parallel computing and optimization 28

Parallel Computing with MATLAB and Simulink MATLAB Distributed Computing Server Client Machine Task Result CPU Worker Task Job Result CPU Worker Toolboxes Parallel Computing Toolbox Result Job Manager Task Result CPU Worker Blocksets Task Result CPU Worker MPI support 29

Distributing Tasks (Task Parallel) Processes Time Time 30

Parallel for loops parfor (i = 1 : n) % do something with i end Mix task parallel and serial code in the same function Run loops on a pool of MATLAB resources Iterations must be order-independent M-Lint analysis helps to identify if existing for loops can be changed to parfor 31

Large Data Sets (Data Parallel) 11 26 41 12 27 42 13 28 43 14 29 44 15 30 45 16 31 46 17 32 47 17 33 48 19 34 49 20 35 50 21 36 51 22 37 52 11 26 41 12 27 42 13 28 43 14 29 44 15 30 45 16 31 46 17 32 47 17 33 48 19 34 49 20 35 50 21 36 51 22 37 52 32

Parallel Computing with MATLAB Why parallel computing? How easy is it to use? Licensing Do I need special hardware? Parallel computing and optimization 33

Run eight local workers with a PCT license Easy to experiment with explicit parallelism on multi-core machines Parallel Computing Toolbox Rapidly develop distributed and parallel applications on local computer Take full advantage of desktop power No separate compute cluster required 34

Scale up to cluster configuration with no code changes Compute cluster MATLAB Distributed Computing Server Parallel Computing Toolbox Task Result Task CPU Worker Job Result Worker CPU Result Scheduler Task Result Worker CPU Task Result Worker CPU 35

Dynamic Licensing Computer Cluster CPU Worker Worker CPU Scheduler Worker CPU Worker CPU 36

Dynamic Licensing Computer Cluster CPU Worker Worker CPU Scheduler Worker CPU Worker CPU 37

Dynamic Licensing Computer Cluster CPU Worker Worker CPU Scheduler Worker CPU Worker CPU 38

Dynamic Licensing Multiple Users Computer Cluster CPU Worker Worker CPU Scheduler Worker CPU Worker CPU 39

Parallel Computing with MATLAB Why parallel computing? How easy is it to use? Licensing Do I need special hardware? Parallel computing and optimization 40

Supported on all MATLAB platforms 41

Parallel Computing with MATLAB Why parallel computing? How easy is it to use? Licensing Do I need special hardware? Parallel computing and optimization 42

Parallel Computing and Optimization Both, the Optimization Toolbox and the Genetic Algorithms and Direct Search Toolbox contain solvers which incorporate parallel optimization functionality, parallel estimation of gradients, nested parallel functions provided the Parallel Computing Toolbox is available. 43

Parallel Computing with MATLAB Why parallel computing? Process large amounts of data faster How easy is it to use? Small modifications to your existing MATLAB programs Licensing Dynamic! Do I need special hardware? Windows, Linux, Solaris, or Mac are fine Parallel computing and optimization Nicely integrated 44

Agenda Introduction Local and Smooth Optimization Example: Portfolio Optimization, part 1 Expected Shortfall GARCH Global or Non-Smooth Optimization Example: Portfolio Optimization, part 2 Parallel Computing Summary 45

Benefits Solvers for a wide range of optimization problems Easy to use Optimization supported by parallel computing 46