I write documentation for MATLAB mathematical toolboxes, primarily optimization. I have also written documentation for PDE, statistics, symbolic math, and econometrics.

My pre-MathWorks job was with Bell Labs, primarily in mathematical models of data traffic, with a strong interest in parallel computation and in rare events (large deviations).

I do not provide private consulting. If you have a question, please ask on a public forum such as MATLAB Answers.

Answered

How to use ga() without generating a prepopulated figure with stop and pause button with matlab app

If you don't want the buttons, then use an output function instead of a plot function. See Custom Output Function for Genetic Al...

How to use ga() without generating a prepopulated figure with stop and pause button with matlab app

If you don't want the buttons, then use an output function instead of a plot function. See Custom Output Function for Genetic Al...

24 hours ago | 0

Answered

How to solve non-linear equations having modulus expression?

As long as you have no bounds, you can use lsqnonlin directly. See Fit a Model to Complex-Valued Data. Alan Weiss MATLAB mathe...

How to solve non-linear equations having modulus expression?

As long as you have no bounds, you can use lsqnonlin directly. See Fit a Model to Complex-Valued Data. Alan Weiss MATLAB mathe...

24 hours ago | 0

Answered

Problem when passing numerical solution of an equation as model function to lsqcurvefit

You did not specify T or en so I cannot try to reproduce your results. But clearly, the error is due to a data type mismatch bet...

Problem when passing numerical solution of an equation as model function to lsqcurvefit

You did not specify T or en so I cannot try to reproduce your results. But clearly, the error is due to a data type mismatch bet...

11 days ago | 0

Answered

Fitting data with multiple inputs, ODE equation, and lsqnonlin

I do not have the time right now to help debug your code, sorry. But I believe that you might be able to use some documentation ...

Fitting data with multiple inputs, ODE equation, and lsqnonlin

I do not have the time right now to help debug your code, sorry. But I believe that you might be able to use some documentation ...

11 days ago | 0

Answered

How to optimize hyperparameters for fitcensemble using a customized maximize function?

I am not sure, but maybe you can use the fitcensemble 'Cost' name-value argument. Give the negative of your customized accuracy ...

How to optimize hyperparameters for fitcensemble using a customized maximize function?

I am not sure, but maybe you can use the fitcensemble 'Cost' name-value argument. Give the negative of your customized accuracy ...

18 days ago | 0

Answered

understanding how the SQP optimization method works

The fmincon sqp algorithm is described here, with some tweaks explained here. Perhaps this will provide some help, or at least p...

understanding how the SQP optimization method works

The fmincon sqp algorithm is described here, with some tweaks explained here. Perhaps this will provide some help, or at least p...

18 days ago | 0

Answered

Can I have checkpoints in Bayesian optimization for tuning hyperparameters of a neural network?

There is one other possible solution to your problem. surrogateopt froom Optimization Toolbox™ can checkpoint automatically. It ...

Can I have checkpoints in Bayesian optimization for tuning hyperparameters of a neural network?

There is one other possible solution to your problem. surrogateopt froom Optimization Toolbox™ can checkpoint automatically. It ...

18 days ago | 1

Answered

Selective Iterative Display Print

I believe that you could do this using an output function. For syntax details, see Output Function and Plot Function Syntax. Wh...

Selective Iterative Display Print

I believe that you could do this using an output function. For syntax details, see Output Function and Plot Function Syntax. Wh...

29 days ago | 0

Answered

intlinprog summation MILP optimization problem: ALREADY SOLVED IN GAMS [PROVIDED CODE] BUT CONFUSED IN MATLAB

I suspect that you would be best served by the problem-based approach. You would have a bit of overhead to learn this approach, ...

intlinprog summation MILP optimization problem: ALREADY SOLVED IN GAMS [PROVIDED CODE] BUT CONFUSED IN MATLAB

I suspect that you would be best served by the problem-based approach. You would have a bit of overhead to learn this approach, ...

1 month ago | 0

| accepted

Answered

Calling a function within an fmincon slows it down?

One more thing you can try is to reduce the number of function evaluations using this technique. I am not sure what "hello" is ...

Calling a function within an fmincon slows it down?

One more thing you can try is to reduce the number of function evaluations using this technique. I am not sure what "hello" is ...

1 month ago | 0

Answered

FMINCON first order optimality non-zero

From your problem description it is very likely that the objective function is not smooth. Your black box functions may respond ...

FMINCON first order optimality non-zero

From your problem description it is very likely that the objective function is not smooth. Your black box functions may respond ...

1 month ago | 0

| accepted

Answered

Bayesian Optimization: How should we parameterize hidden units for changing number of layers (depth) of a BiLSTM network using bayesopt?

I believe that you can perform the optimization the way you want using conditional constraints. If M is the number of layers tha...

Bayesian Optimization: How should we parameterize hidden units for changing number of layers (depth) of a BiLSTM network using bayesopt?

I believe that you can perform the optimization the way you want using conditional constraints. If M is the number of layers tha...

1 month ago | 0

| accepted

Answered

Using fmincon with multiple inequality constraints

You can easily formulate these constraint for fmincon using the recipes in Write Constraints. Your first two constraints, and ,...

Using fmincon with multiple inequality constraints

You can easily formulate these constraint for fmincon using the recipes in Write Constraints. Your first two constraints, and ,...

1 month ago | 1

| accepted

Answered

Problem using FSOLVE 'OptimalityTolerance' is not an option

I am surprised that you got that error, but here is what the fsolve documentation has to say about that option: Internally, the...

Problem using FSOLVE 'OptimalityTolerance' is not an option

I am surprised that you got that error, but here is what the fsolve documentation has to say about that option: Internally, the...

1 month ago | 0

| accepted

Answered

find optimal hyperparameters in SVM

Read what the bayesopt documentation has to say about your chosen acquisition function: "Acquisition functions whose names inclu...

find optimal hyperparameters in SVM

Read what the bayesopt documentation has to say about your chosen acquisition function: "Acquisition functions whose names inclu...

1 month ago | 0

| accepted

Answered

Problem with non-linear least squares fit to a non-linear model function using Gauss-Newtons method

I suggest that you try to follow the example Curve Fitting via Optimization. If you have an Optimization Toolbox license, you wo...

Problem with non-linear least squares fit to a non-linear model function using Gauss-Newtons method

I suggest that you try to follow the example Curve Fitting via Optimization. If you have an Optimization Toolbox license, you wo...

1 month ago | 0

Answered

Is fmincon correct for this problem?

I see that you define a quantity Y in your nonlinear constraint expression, but you don't seem to use it. Was this an oversight?...

Is fmincon correct for this problem?

I see that you define a quantity Y in your nonlinear constraint expression, but you don't seem to use it. Was this an oversight?...

1 month ago | 0

Answered

Error when using fminsearch to find least squares fit of data using a given equation

I suggest that you use the debugger. Alan Weiss MATLAB mathematical toolbox documentation

Error when using fminsearch to find least squares fit of data using a given equation

I suggest that you use the debugger. Alan Weiss MATLAB mathematical toolbox documentation

1 month ago | 0

Answered

is there a gradient based and mixed integer optimization algorithm in Matlab?

No, the only two solvers for nonlinear integer-constrained problems are ga and surrogateopt, neither of which is gradient-based....

is there a gradient based and mixed integer optimization algorithm in Matlab?

No, the only two solvers for nonlinear integer-constrained problems are ga and surrogateopt, neither of which is gradient-based....

1 month ago | 0

Answered

penalty fitness value not changing

There may be only one feasible point that ga found. Alan Weiss MATLAB mathematical toolbox documentation

penalty fitness value not changing

There may be only one feasible point that ga found. Alan Weiss MATLAB mathematical toolbox documentation

1 month ago | 0

Answered

fsolve function give poor results for multiple equations

I wasn't able to find a very good answer either. I'm not sure that one exists. I think that lsqnonlin is a more appropriate solv...

fsolve function give poor results for multiple equations

I wasn't able to find a very good answer either. I'm not sure that one exists. I think that lsqnonlin is a more appropriate solv...

2 months ago | 0

Answered

How to use "fmincon" function to find the minimum of a function with nonlinear constraints

I think that you are on the right track using fmincon. See the function reference page for details. Also, there is a topic on ho...

How to use "fmincon" function to find the minimum of a function with nonlinear constraints

I think that you are on the right track using fmincon. See the function reference page for details. Also, there is a topic on ho...

2 months ago | 0

| accepted

Answered

Three inequality constraints for multi-objective genetic algorithm

These are linear constraints, so you should not use a nonlinear constraint function (which has errors in signs in any case: you ...

Three inequality constraints for multi-objective genetic algorithm

These are linear constraints, so you should not use a nonlinear constraint function (which has errors in signs in any case: you ...

2 months ago | 0

| accepted

Answered

symbolic matrices optimization with fmincon

I was able to modify your program to run. I don't know if it is correct, but at least it runs. chi= rand(4,4) %% for example s...

symbolic matrices optimization with fmincon

I was able to modify your program to run. I don't know if it is correct, but at least it runs. chi= rand(4,4) %% for example s...

2 months ago | 0

| accepted

Answered

How can I require an optimization function to only consider a step successful if it decreases the cost function by a user-defined amount?

I think that you can accomplish what you want by using a custom search function. The syntax of a search function is function [s...

How can I require an optimization function to only consider a step successful if it decreases the cost function by a user-defined amount?

I think that you can accomplish what you want by using a custom search function. The syntax of a search function is function [s...

2 months ago | 0

Answered

What are the limitations for gamultiobj

There is no built-in limitation to either the number of variables or the number of objectives. Depending on your software versio...

What are the limitations for gamultiobj

There is no built-in limitation to either the number of variables or the number of objectives. Depending on your software versio...

2 months ago | 0

Answered

How to Iteratively optimise an equation [OPTIMTOOLBOX]

Are you asking how to write a loop in MATLAB or how to store the results? This is just a sketch, it is missing some values, but ...

How to Iteratively optimise an equation [OPTIMTOOLBOX]

Are you asking how to write a loop in MATLAB or how to store the results? This is just a sketch, it is missing some values, but ...

2 months ago | 0

Answered

MultiStart Parallel processing doubt

I am not an expert in MATLAB parallel computation, but I believe that generally the answer is no to both of your questions. Whil...

MultiStart Parallel processing doubt

I am not an expert in MATLAB parallel computation, but I believe that generally the answer is no to both of your questions. Whil...

2 months ago | 0

Answered

Set hessian function only once for fmincon

It seems to me that if you are changing the problem Hessian at each iteration then you will have to change the fmincon Hessian a...

Set hessian function only once for fmincon

It seems to me that if you are changing the problem Hessian at each iteration then you will have to change the fmincon Hessian a...

2 months ago | 1

| accepted

Answered

how to define sqrt in Optimization?

I'm not sure what you are talking about. If you are trying to extend the problem-based method, then the short answer is you are ...

how to define sqrt in Optimization?

I'm not sure what you are talking about. If you are trying to extend the problem-based method, then the short answer is you are ...

3 months ago | 0