Questions on the optimization functions of Mathematica such as FindMinimum/FindMaximum, Minimize/Maximize, NMinimize/NMaximize, etc.

learn more… | top users | synonyms (2)

3
votes
3answers
109 views

How to use a compiled function in numerical optimization

I'm trying to wrap my head around function Compile. So, this is a spin-off question from: a previous question on using compile[] correctly. I have a function that ...
18
votes
4answers
4k views

Finding Local Minima / Maxima in Noisy Data

I'm trying to find local minima / maxima in noisy data, consisting of data values taken at certain time intervals. Ideally, the function should take a pair of lists (one containing time values and one ...
2
votes
1answer
51 views
0
votes
0answers
53 views

Finding the maximum of a expression constrained by a relation between the variables [on hold]

I am trying to find the result of an equation based on another equation but I couldn't find how to do it. I tried with the Solve and ...
0
votes
0answers
91 views

Help optimizing some code [closed]

I have a code that numerically solves a series of equations, but the code is painfully slow. I was hoping someone could help me improve/optimize the code. When I run the code: ...
0
votes
0answers
44 views

Calculate the relationship between the duration of two oscillating functions

I am trying to quantitatively determine the relationship between the length of two oscillating functions. Meaning, what is the duration of the green spike in relation to the blue square? Does anyone ...
7
votes
1answer
982 views

Linear programming with many variables and parameters

I am trying to reconstruct the answer that is given in this report. (page 153 in Appendix B; Section B.2.1). They are given variables, parameters, constraints, and the objective function to minimize. ...
5
votes
1answer
93 views

Optimizing code containing an infinite sum

I have the following expression. It's based on the negative-log-likelihood of a Poisson-Gaussian noise model, i.e. a convolution of a Poisson & Normal distribution. The value $x_{i}$ is the ...
1
vote
0answers
83 views

NMaximize with matrix input

I defined function f[x_, fixed_] := {...}. Here x is an $M\times N$ matrix. I want to maximize $f$ with respect to $x$. I have ...
1
vote
0answers
41 views

Optimizing evaluation of expressions dependent on four variables and containing double summation

I would like to optimize my code which I use to evaluate expressions containing double summation. These expressions are dependent on 3 space variables ($r$, $\theta$, $\phi$) and time $t$ and consist ...
4
votes
1answer
69 views

Possible bug / numerical issues with HypergeometricU — any suggestions for a fast workaround?

I've encountered some problematic behaviour with HypergeometricU. I have a probability distribution on the positive integers that takes the following form after ...
1
vote
1answer
32 views

NMaximize not substutiting parameters of objective function [duplicate]

NMaximize is not substituting parameters of its objective function. Is there a way to fix that? I have a three line program that exhibits the problem. ...
1
vote
0answers
122 views

Solving mixed integer programming using Mathematica

Let $x_{ij}$ be an $n\times k$ matrix defined as follows: $ x_{ij}=\begin{cases} 1, & \text{if }s_i\text{ is assigned to }S_j \\ 0, & \text{otherwise } \end{cases} $ and $S$ is a set of $k$ ...
1
vote
0answers
39 views

NMaximize stops evaluating my function when run in parallel

I am trying to maximize the results of a Monte Carlo simulation with respect to some input variables. ...
0
votes
1answer
90 views

How to differentiate a geometric sum [closed]

How do I differentiate both sides of the equation shown below with respect to r?
5
votes
0answers
206 views

Problems extending NelderMeadMinimize into 2D

Update The eventual route I followed was to adapt a version of the NM-simplex written in C and link to it with MathLink. Once I've tested this out fully I'll post it here. I've been playing around ...
11
votes
2answers
399 views

Find maximum value of interpolation function - obviously wrong result

Minimizing and maximizing interpolation function has already been asked and answered, see here for example. Yet, I observe a strange behaviour. Well, I can understand that the wrong guess of ...
3
votes
0answers
63 views

Efficient processing of Special Ordered Sets with LinearProgramming

I'm playing with integer linear programming, especially problems involving lots of constraints which would appear to be special ordered sets. Below is a toy example, three last rows of the matrix ...
6
votes
0answers
53 views

Listable compiled functions used in NMinimize

This is an example from MMA: cListable = Compile[{x}, (x-1)^2, RuntimeAttributes -> {Listable}] In case of single entry: ...
9
votes
0answers
136 views

Can code optimize code?

Are there functions, programs or packages that deal with optimizing mathematica code i.e. re-writing ineffecive or convoluted code. -This question has haunted me since I joined SE. The background for ...
2
votes
1answer
80 views

How to build a list of constraints for NMinimize

Let's say I have aset = {-1, 0, 2}. I would like to create a variable Var that takes values from that set, i.e. ...
1
vote
2answers
118 views
1
vote
0answers
72 views

Optimization in Mathematica [closed]

There is a R package called TIMP. By this package someone can fit data to a model. There is a GUI for TIMP called Glotaran. When I fit my data by this package it does not take so much time to get the ...
2
votes
1answer
61 views

How to minimize a list of data points?

I have a list called diff1: ...
1
vote
1answer
124 views

Finding the minimum of a function

I asked this question Mark Minimum Value in DensityPlot. Another question has come up, or better said, a task: Find the minimum of a function. I haven't been able to write the needed code for that, ...
2
votes
0answers
53 views

Maximizing Large Multivariable Function over Region with Parameter Constraints

Brand new Mathematica user here. I have a complicated function to maximize, and thought I would try software like Mathematica instead of taking derivatives by hand. I found some Mathematica ...
2
votes
1answer
90 views

Minimizing a function with some restrictions

I need help in finding a way to minimize a function with some complex constraints. I'm not an expert in this field, but I'm still trying to understand if I can do something with my problem. So, ...
17
votes
1answer
295 views

How to work with Experimental`NumericalFunction?

This question is intimately connected with previous one: "How to create internally optimized expression for computing with high WorkingPrecision?" Oleksandr R. correctly states in the comment: A ...
1
vote
1answer
83 views

Manual maximum likelihood estimation of a mixture with no closed form

Let $X$ be a random variable that is from a mixture of two Lognormals (Lognormals(mu1,sigma) and Lognormals(mu2,sigma)) and set $Y=X_1+X_2+...+X_{10}$ a sum of 10 random variables from this mixture. ...
0
votes
0answers
51 views

how to solve an optimization problem in terms of matrices as the argument

How can I minimize an expression of the form a^T A a where a is a matrix. The following approach does not work if ...
0
votes
1answer
50 views

Solving minimum length confidence interval problem

I'm trying to find the minimum length of a confidence interval for the variance from a sample iid with normal distribution. I tried ...
2
votes
0answers
89 views

Convex optimization

I am playing with some Compressed Sensing (think single pixel camera) applications and would like to have a Mathematica equivalent of a Matlab package call Convex Optimization (CVX). Specifically, I ...
4
votes
0answers
140 views

Simulated Annealing Parameters and Results

I am using SimulatedAnnealing method for a simulation based optimization problem and was wondering if someone can enlighten me on the following features: Is there ...
0
votes
0answers
29 views

What is that Root[…] inside the answer represent? [duplicate]

So I am encountering this situation, in which mathematica doesn't give me the answer, but in a form of "Root". How do I interpret this ? what is the number after the "&" represent? How should I ...
1
vote
2answers
117 views

Minimize loop optimization

I'm new in Mathematica 10. So far, I have a two variable-function and I've use Minimize to find the optimal solution. Nevertheless, I'd like to make a sensibility analysis and study how this optimal ...
0
votes
0answers
85 views

FindMinimum slower in MMA10

I've recently updated one of my PCs (both have the exact same build) to Mathematica 10. After running the exact same notebook (which has two FindMinimum calls) on ...
7
votes
2answers
217 views

Using least independent rectangle area to separate every point

Description I want to add vertical line and horizonal lines between data to make every point have an independent rectangle area. In addtion, every independent rectangle has a number ...
0
votes
1answer
62 views
1
vote
0answers
56 views

on convergence in optimization [closed]

I am trying to solve a nonlinear programming problem using FindMinimum solver on Mathematica. When I execute, it is printing FindMinimum::eit: "The algorithm does not converge to the tolerance of ...
1
vote
1answer
56 views

2D Arrangment/Optimization Problem

Okay, I have a list of angles, call it A. How would I arrange them in a 2D m-by-n grid G such that the distances between each adjacent angle-element (row- and column-wise) is minimized? G has as ...
4
votes
4answers
251 views

How can I name “a[[i]]” the parts of Table “a”? Or how to make Table “a” grow inside FindMinimum?

Let's say I want to minimize a function that uses a Table named a with the Conjugate Gradient Method of ...
1
vote
0answers
94 views

Speeding up NDSolve for system of differential equations

I am wondering if there is a way to speed up this function that solves a system of ordinary differential equations with NDSolve? Thus far I've tried specifying a few different methods such as LSODA, ...
6
votes
1answer
441 views

Simulated Annealing Convergence

I am using Simulated Annealing method for a simulation based optimization of a process that has 3 variables, using NMinimize. I print the input/output during every ...
0
votes
3answers
184 views
1
vote
1answer
54 views

What domain does Resolve assume by default?

Consider the statement: $\forall x\left(x<7\Rightarrow \exists a\exists b\exists c(a^2+b^2+c^2=x)\right)$ This is true provided the universe of discourse is $\mathbb{N}$ Now I use ...
0
votes
1answer
47 views
0
votes
1answer
92 views
17
votes
2answers
500 views

Obtain approximate Hessian using FindMinimum

According to the documentation, when FindMinimum is told to use the method "QuasiNewton" on a unconstrained problem, it uses the ...
57
votes
2answers
4k views

Shaving the last 50 ms off NMinimize

The epilogue: A paper where the below answer is used was published. The answer below is cited among the references:) The background: I have to fit an objective function for ~10 000 datasets in near ...