Re: Optimization in Mathmatica
- To: mathgroup at smc.vnet.net
- Subject: [mg85023] Re: Optimization in Mathmatica
- From: Ray Koopman <koopman at sfu.ca>
- Date: Thu, 24 Jan 2008 04:44:37 -0500 (EST)
- References: <fn2158$h2p$1@smc.vnet.net>
On Jan 21, 3:54 am, "Ludsteck Johannes" <Johannes.Ludst... at iab.de>
wrote:
> Dear MathGroup Members,
> I want to minimize a function of about 20-30 variables using FindMinimum
> and NMinimize.
> The objective is a statistical function, i.e. a sum of several thousand
> data points.
> If the number of Data points exceeds 30000, Mathematica shuts down and
> tells me that nout enough memory is available.
> My computer has, however, about 2GB available which should suffice for a
> problem of this dimension. After some experimentation
> I found that the shut down can be avoided by providing two starting
> values. Then Mathematica uses the Brent algorithm
> which works without derivatives. A further working solution is Nminimize
> with option Method->{NelderMead, PostProcess->"KKT"}.
> Both strategies are, however, extremely inefficient. I assume that
> Mathematica shuts down with other options since it tries to
> compute gradients and hessians symbolically. These objects may be huge.
> Question: How can I urge Mathematica to do the minimization without
> symbolic computations. I searched the documentation but
> didn't find detailed information on memory usage in FindMinimum and
> Nminimize
>
> Thank you and best regads,
> Johannes Ludsteck
>
> Probably that is not important for you. Nevertheless, here are parts of
> my code:
>
> chi[u_,v_,d_]:=Which[
> d<=-v,u^2-2 u (v+d),
> -v<d<u,(u-v-d)^2,
> True,v^2+2 v (d-u)];
> SetAttributes[chi,Listable];
>
> chiSumPair[y1_,y2_,dx_,b_]:=Total[chi[y1,y2,dx.b]];
>
> chiSumTotal[y1_,y2_,dx_,bx_,bd_]:=
> Total[MapThread[
> chiSumPair[#2,#1,Map[Append[#,-1]&,-#3],Append[bx,#4]]&,
> {y2,y1,dx,bd}]];
>
> ...
> sol=Last[FindMinimum[chiSumTotal[y1,y2,dx,bx,bd],
> Evaluate[Sequence@@start],
> MaxIterations->500,Method->"QuasiNewton"]];
Is this some sort of regression problem, with y1 & y2 specifying an
interval dependent variable, dx a predictor matrix, and bx & bd a
to-be-solved-for vector & scalar, respectively? Will y1 & y2 always
be positive?