# Tag Info

9

Brute forcing it: (The edit at the end is a much faster alternative) n = 9; IntegerPartitions[n + 1, {3}] (* {{8, 1, 1}, {7, 2, 1}, {6, 3, 1}, {6, 2, 2}, {5, 4, 1}, {5, 3, 2}, {4, 4, 2}, {4, 3, 3}}*) are the ways to split ten digits. The numbers on the first row can't produce viable sums, so we need to check only the partitions on the bottom row. ...

8

I also got interested in this problem and solved it using Quantile Regression. See my blog post Finding local extrema in noisy data using Quantile Regression . The proposed Quantile Regression algorithm is a version of the polynomial fitting solution proposed by Leonid Shifrin above, and has the following advantages: (i) it requires less parameter tweaking, ...

6

I am not sure how useful my answer is, but I hope it will bring some points to be clarified in the question. (Also I spent some time on this so I wanna proclaim some of the results of my efforts...) Since the data was not provided in the original question I extracted it from the image shown following the (great) explanations here: Recovering data points ...

6

What follows is, of course, a terrible hack... since NMinimize is implemented entirely in top-level Mathematica, its code allows inspection by spelunking tools. The relevant function is NMinimize[1, x]; (* force autoloading *) Needs["GeneralUtilities"] PrintDefinitions[OptimizationNMinimizeDumpCoreDE] and the desired behavior can be achieved by ...

5

No, there have not been any significant changes since 2004 that would affect what you are asking about. It is also worth noting that NMinimize is not necessarily coded in the most efficient way possible, so it may not be the best solution compared to your own hand-written differential evolution (DE) code (to which you can, of course, easily add parallelism). ...

4

I added an extra definition for exprSquareError that will only fire when the parameters are numeric. I redefined exprMinimize to call this version of exprSquareError. Thus, exprMinimize's call of exprSquareError does not expand until the parameters are numeric. exprSquareError[expr1_, expr2_, vars_, strategy_: Automatic, maxpnts_: Automatic] := ...

4

The "LevenbergMarquardt" Method is an unconstrained optimization algorithm, so it does not allow setting bounds for the parameters. If you need to set bounds you should use one of the algorithms for constrained optimization. The correct syntax for local constrained optimization is given on the Documentation page for FindMinimum: FindMinimum[{f[x,y,...], ...

3

Just to put you on a better path: gau[y_, v_] := Exp[-(y^2)/(2*v)]/Sqrt[2*Pi*v]; means = {-1, 0, 1}; l = Length@means; vars = {B1, B0, B1}; ord = 3; p[x_, v_] := Tr@MapThread[gau, {x - means, vars + v}]/l h = D[Log[p[x, v]], {v, #}] & /@ Range[0, ord - 1] /. v -> 0; hSample[b0_, b1_] := Block[{B0 = b0, B1 = b1}, Fold[Plus, 0, h /. x -> # & /@ ...

3

It takes some careful coding to make sure the right values are explicitly numeric at the time they need to be (in the inner optimization). Can be done as below. And there may be better ways, I'm no expert. stratmin[p_ /; MatrixQ[p, Element[#, Reals] &], xlist_List /; VectorQ[xlist, Element[#, Reals] &]] := Module[ {y, c = Length[p], yvars, ...

2

I would first note that the problem you are posing can be reduced to a two-variable one by substituting in your inequality constraint, to eliminate z. I note that your constraint g implies x + y < 1. Minimize[{f[x, y, 1 - x - y], x + y < 1, m1 > 0, m2 > 0, m3 > 0, x > 0, y > 0}, {x, y}] I then tried solving the unconstrained ...

2

One can use generate an ElementMesh once and for all (15-16 sec.); then use ElementMeshInterpolation on each coordinate to construct interpolations (1.7 sec.). Needs["NDSolveFEM`"] SeedRandom[0]; inputlist = RandomReal[{-10, 10}, {200000, 3}]; outputlist = RandomReal[{-10, 10}, {200000, 3}]; ( mesh = DelaunayMesh[inputlist]; elem = ...

1

To confirm @belisarius comment: f[x_, y_, z_] := (m1 x + m2 y + m3 z)/Sqrt[m1^2 x + m2^2 y + m3^2 z] g[x_, y_, z_] := x + y + z - 1 L = f[x, y, z] + \[Lambda] g[x, y, z]; Solve[{Grad[L, {x, y, z}] == 0, g[x, y, z] == 0, m1 > 0, m2 > 0, m3 > 0, x > 0, y > 0, z > 0}, {x, y, z, \[Lambda]}] {} Simplify[Reduce[{Grad[L, {x, y, z}] == 0, ...

Only top voted, non community-wiki answers of a minimum length are eligible