<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Numerical Optimization Forum - Support]]></title>
		<link>http://forum.openopt.org/index.php</link>
		<description><![CDATA[The most recent posts in Numerical Optimization Forum.]]></description>
		<lastBuildDate>Mon, 15 Aug 2011 20:03:46 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: problem with interalg]]></title>
			<link>http://forum.openopt.org/viewtopic.php?pid=1372#p1372</link>
			<description><![CDATA[<div class="quotebox"><cite>Dmitrey wrote:</cite><blockquote><p>hi,<br />I&#039;ve fixed it 2 minutes later after committing constraints handling for interalg:<br /><a href="http://trac.openopt.org/openopt/changeset/1189?new_path=%2F">http://trac.openopt.org/openopt/changes &#133; w_path=%2F</a><br />(I forgot to commit another one file baseProblem.py)</p><p>try updating from svn repository</p></blockquote></div><br /><p>Hi Dmitrey,</p><p>Thank you for your amazing responsiveness!</p><p>-c</p>]]></description>
			<author><![CDATA[dummy@example.com (cytochrome)]]></author>
			<pubDate>Mon, 15 Aug 2011 20:03:46 +0000</pubDate>
			<guid>http://forum.openopt.org/viewtopic.php?pid=1372#p1372</guid>
		</item>
		<item>
			<title><![CDATA[Re: problem with interalg]]></title>
			<link>http://forum.openopt.org/viewtopic.php?pid=1371#p1371</link>
			<description><![CDATA[<p>hi,<br />I&#039;ve fixed it 2 minutes later after committing constraints handling for interalg:<br /><a href="http://trac.openopt.org/openopt/changeset/1189?new_path=%2F">http://trac.openopt.org/openopt/changes &#133; w_path=%2F</a><br />(I forgot to commit another one file baseProblem.py)</p><p>try updating from svn repository</p>]]></description>
			<author><![CDATA[dummy@example.com (Dmitrey)]]></author>
			<pubDate>Mon, 15 Aug 2011 20:00:12 +0000</pubDate>
			<guid>http://forum.openopt.org/viewtopic.php?pid=1371#p1371</guid>
		</item>
		<item>
			<title><![CDATA[problem with interalg]]></title>
			<link>http://forum.openopt.org/viewtopic.php?pid=1370#p1370</link>
			<description><![CDATA[<p>Hi,</p><p>I am experiencing an error trying to use the interalg functionality.</p><p>System:<br /></p><ul><li><p>OpenOpt 0.34</p></li><li><p>Windows 7 </p></li><li><p>Enthought Python 7.1-1</p></li></ul><p>I ran exactGlobalNLP.py and got the following traceback:</p><div class="codebox"><pre><code>------------------------- OpenOpt 0.34 -------------------------
solver: interalg_0.21   problem: unnamed    type: GLP
 iter   objFunVal   
    0  1.163e+02 
Traceback (most recent call last):
  File &quot;C:\Users\breisfel\Documents\Programming\python\exactGlobalNLP.py&quot;, line 34, in &lt;module&gt;
    r = p.minimize(solver)
  File &quot;C:\Python27\lib\site-packages\openopt-0.34-py2.7.egg\openopt\kernel\baseProblem.py&quot;, line 196, in &lt;lambda&gt;
    self.minimize = lambda *args, **kwargs: minimize(self, *args, **kwargs)
  File &quot;C:\Python27\lib\site-packages\openopt-0.34-py2.7.egg\openopt\kernel\baseProblem.py&quot;, line 774, in minimize
    return runProbSolver(p, *args, **kwargs)
  File &quot;C:\Python27\lib\site-packages\openopt-0.34-py2.7.egg\openopt\kernel\runProbSolver.py&quot;, line 238, in runProbSolver
    solver(p)
  File &quot;C:\Python27\lib\site-packages\openopt-0.34-py2.7.egg\openopt\solvers\UkrOpt\interalg_oo.py&quot;, line 225, in __solver__
    C = p._FD.nonBoxConsWithTolShift
AttributeError: EmptyClass instance has no attribute &#039;nonBoxConsWithTolShift&#039;</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (cytochrome)]]></author>
			<pubDate>Mon, 15 Aug 2011 19:54:48 +0000</pubDate>
			<guid>http://forum.openopt.org/viewtopic.php?pid=1370#p1370</guid>
		</item>
		<item>
			<title><![CDATA[Re: OpenOpt for non linear problems]]></title>
			<link>http://forum.openopt.org/viewtopic.php?pid=1368#p1368</link>
			<description><![CDATA[<p>however, using stats.norm.pdf as exp(...) has the following serious drawback for interalg: it has several occurences of argument and thus decreases quality of interval analysis, hence interalg may work essentially worse.</p>]]></description>
			<author><![CDATA[dummy@example.com (Dmitrey)]]></author>
			<pubDate>Fri, 12 Aug 2011 09:05:37 +0000</pubDate>
			<guid>http://forum.openopt.org/viewtopic.php?pid=1368#p1368</guid>
		</item>
		<item>
			<title><![CDATA[Re: OpenOpt for non linear problems]]></title>
			<link>http://forum.openopt.org/viewtopic.php?pid=1367#p1367</link>
			<description><![CDATA[<p>gbenoit, your knowledge of python language seems to be absolutely inappropriate for solving the problems like this one.<br />In my last message I&#039;ve already provided all the info you&#039;re need to solve it.<br />If you intend to use openopt w/o funcdesigner, you should use <br />def Psi(x):<br />&nbsp; &nbsp; alpha, a0, a1, b1 = x<br />&nbsp; &nbsp; return math.log(stats.norm.pdf(ThetaSto[j],...)<br />and x0 = [0.2,2,0.2,0.1]</p><p>All Python-scientific folk use numpy.exp, numpy.sin etc instead of math.exp, math.sin etc.</p><p>In correct form FD code should look like this (you should change values of j, ThetaSto and maybe chose more appropriate implicitBounds):<br /></p><div class="codebox"><pre><code>from numpy import *
from openopt import *
from FuncDesigner import *

alpha, a0, a1, b1 = oovars(&#039;alpha a0 a1 b1&#039;)

ThetaSto = array([1,2,3]) 
j = 1    

Psi = (log(sqrt(2*pi)*(a0 + a1*cos(j*2*pi/365) + b1*sin(j*2*pi/365))*sqrt((1-exp(-2*alpha))/(2*alpha))\
                                     )-ThetaSto[j]**2*(1-exp(-alpha))**2/(2*((a0 + a1*cos(j*2*pi/365) + b1*sin(j*2*pi/365))*\
                                     sqrt((1-exp(-2*alpha))/(2*alpha)))**2))
                                     
# parameters estimation
StartPoint = {alpha:0.2, a0:2, a1:0.2, b1:0.1}

p = NLP(Psi, StartPoint, goal=&#039;max&#039;) 

#r = p.solve(&#039;ralg&#039;) - I&#039;m not sure it will work with all those multiextrema funcs like cos, sin, nonconvex log
r = p.solve(&#039;interalg&#039;, implicitBounds = (-1000, 1000), fTol = 1e-10)

print(r(alpha, a0, a1, b1))</code></pre></div><p>however, you have sqrt((1-exp(-2*alpha))/(2*alpha)), that is not defined over whole R^nVars, and with interalg you may encounter something like </p><p>unhandled ValueError<br />&quot;numpy.nanargmin raises on a.shape[axis]==0; Bottleneck too.&quot;<br />File: nanargmin.pyx, Line: 495</p><p>(or another message if you don&#039;t have bottleneck installed). Bugfix for this will be released in few days along with new constrained interalg version. As for some other solvers like ralg or de, you should add constraint (1-exp(-2*alpha))/(2*alpha) &gt; 0.</p>]]></description>
			<author><![CDATA[dummy@example.com (Dmitrey)]]></author>
			<pubDate>Fri, 12 Aug 2011 07:30:25 +0000</pubDate>
			<guid>http://forum.openopt.org/viewtopic.php?pid=1367#p1367</guid>
		</item>
		<item>
			<title><![CDATA[Re: OpenOpt for non linear problems]]></title>
			<link>http://forum.openopt.org/viewtopic.php?pid=1366#p1366</link>
			<description><![CDATA[<div class="quotebox"><cite>Dmitrey wrote:</cite><blockquote><p>So what about other issues? What do you mean with log(stats.norm.pdf(3 parameters)).sum()? </p><p>If it was log(stats.norm.pdf(parameter_1)) + log(stats.norm.pdf(parameter_3)) + log(stats.norm.pdf(parameter_3)), here&#039;s my version by FD (giveas auto derivatives and interval analysis for interalg):</p><div class="codebox"><pre><code>from numpy import *
from openopt import *
from FuncDesigner import *

alpha, a0, a1, b1 = oovars(&#039;alpha a0 a1 b1&#039;)

ThetaSto = array([1,2,3])
j = 1    # actually ThetaSto is an existing array correctly defined (12775x1)

#pdf = lambda x: exp(-x**2/2)/sqrt(2*pi)

logpdf = lambda x: -x**2 / 2.0 - 0.5*log(2*pi)
# however, that fixed constant 0.5*log(2*pi) doesn&#039;t matter for optimal point searching


Psi = logpdf(ThetaSto[j]) + logpdf(ThetaSto[j]*exp(-alpha)) + logpdf((a0 + a1*cos(2*pi*j/365) + b1*sin(2*pi*j/365))*\
                                      sqrt((1-exp(-2*alpha))/(2*alpha)))

# parameters estimation
StartPoint = {alpha:0.2, a0:2, a1:0.2, b1:0.1}

p = NLP(Psi, StartPoint, goal=&#039;max&#039;) 

#r = p.solve(&#039;ralg&#039;) - I&#039;m not sure it will work with all those multiextrema funcs like cos, sin, nonconvex log
r = p.solve(&#039;interalg&#039;, implicitBounds = (-1000, 1000), fTol = 1e-10)

print(r(alpha, a0, a1, b1))
#[500.0, 0.0, 0.0, 0.0]</code></pre></div><p>I intend to add some stats funcs like erf, pdf, but I have some more urgent things for now.<br />In our country we don&#039;t have neither internal study nor internship, could you explain what openopt is used for (which task?)</p><p>Regards, D.</p></blockquote></div><br /><p>Thank you for your answer. I have been away for a few days that&#039;s why I did not answer your last message.<br />I have &quot;simplified&quot; the formula (applying the log on the previous one so I don&#039;t need stats.norm.pdf anymore) :</p><p>&nbsp; &nbsp; Psi = lambda alpha, a0, a1, b1: (-math.log(math.sqrt(2*Pi)*(a0 + a1*math.cos(j*2*pi/365) + b1*math.sin(j*2*pi/365))*math.sqrt((1-math.exp(-2*alpha))/(2*alpha))\<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)-ThetaSto[j]**2*(1-math.exp(-alpha))**2/(2*((a0 + a1*math.cos(j*2*pi/365) + b1*math.sin(j*2*pi/365))*\<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;math.sqrt((1-math.exp(-2*alpha))/(2*alpha)))**2)).sum()</p><p>I have been using oovars and &#039;interalg&#039; instead of &#039;ralg&#039; but I still get the same error : </p><p>&nbsp; File &quot;C:\Python26\lib\site-packages\openopt-0.34-py2.6.egg\openopt\kernel\ooMisc.py&quot;, line 202, in setNonLinFuncsNumber<br />&nbsp; &nbsp; setattr(p, &#039;n&#039;+userFunctionType, asfarray(FV(*(X, ) + args, **kwargs)).size)<br />TypeError: &lt;lambda&gt;() takes exactly 4 arguments (1 given)</p><br /><p>Concerning the kind of study carried out, this is a study on a temperature model.</p><p>Regards,</p><p>GB</p>]]></description>
			<author><![CDATA[dummy@example.com (gbenoit)]]></author>
			<pubDate>Fri, 12 Aug 2011 06:47:30 +0000</pubDate>
			<guid>http://forum.openopt.org/viewtopic.php?pid=1366#p1366</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with problem, galileo and de]]></title>
			<link>http://forum.openopt.org/viewtopic.php?pid=1365#p1365</link>
			<description><![CDATA[<p>This is not mess. oovars yields ooarray, that is derived class of numpy.ndarray and has all its attributes. All solvers except of interalg can handle both oovars() and oovar(), and interalg cannot due to interval analysis, that is currently performed for single-sized oovar only (or ooarray of them). Maybe in long-term future it will be implemented for oovar with size &gt; 1.</p>]]></description>
			<author><![CDATA[dummy@example.com (Dmitrey)]]></author>
			<pubDate>Thu, 11 Aug 2011 05:23:26 +0000</pubDate>
			<guid>http://forum.openopt.org/viewtopic.php?pid=1365#p1365</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with problem, galileo and de]]></title>
			<link>http://forum.openopt.org/viewtopic.php?pid=1363#p1363</link>
			<description><![CDATA[<p>Thanks.</p><p>Are there some plans to consolidate and unify oovars / oovar mess?</p>]]></description>
			<author><![CDATA[dummy@example.com (baryluk)]]></author>
			<pubDate>Wed, 10 Aug 2011 20:31:43 +0000</pubDate>
			<guid>http://forum.openopt.org/viewtopic.php?pid=1363#p1363</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with problem, galileo and de]]></title>
			<link>http://forum.openopt.org/viewtopic.php?pid=1361#p1361</link>
			<description><![CDATA[<p>You could use <br />Theta_DNA_YY1&lt;[1,2,3], Theta_DNA_YY1&gt; [-1,-20,-300] <br />(or numpy arrays).<br />If you use oovars(n) (for interalg) instead of oovar(size=n), then you could use <br /></p><div class="codebox"><pre><code>Theta_DNA_YY1[i] &lt; ub[i], Theta_DNA_YY1[i] &gt; lb[i]</code></pre></div><p>(however, those Theta_DNA_YY1&lt;[1,2,3], Theta_DNA_YY1&gt; [-1,-20,-300] should work as well)</p>]]></description>
			<author><![CDATA[dummy@example.com (Dmitrey)]]></author>
			<pubDate>Tue, 09 Aug 2011 22:26:04 +0000</pubDate>
			<guid>http://forum.openopt.org/viewtopic.php?pid=1361#p1361</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with problem, galileo and de]]></title>
			<link>http://forum.openopt.org/viewtopic.php?pid=1360#p1360</link>
			<description><![CDATA[<p>What if I want different bound on components of vector Theta_DNA_YY1. I want to use interalg, so would like stay in given bounds, and some of them will be different in single vector.&nbsp; Should I manually rescale problem by multipling Theta_DNA_YY1 by some numerical constants?</p><p>Thanks, I changed code as you suggested and it works. I used vector form previously but in actuall full code I have different constrains on components, and also first (vector) form had some other problems previously (I&nbsp; do not remember what problems).</p>]]></description>
			<author><![CDATA[dummy@example.com (baryluk)]]></author>
			<pubDate>Tue, 09 Aug 2011 22:06:42 +0000</pubDate>
			<guid>http://forum.openopt.org/viewtopic.php?pid=1360#p1360</guid>
		</item>
		<item>
			<title><![CDATA[Re: Problem with problem, galileo and de]]></title>
			<link>http://forum.openopt.org/viewtopic.php?pid=1359#p1359</link>
			<description><![CDATA[<p>Correct: </p><p>1) this code should be removed:<br />for i in xrange(Zmiennych):<br />&nbsp; &nbsp; constraints.extend([-1.0e6 &lt;= Theta_DNA_YY1_i, Theta_DNA_YY1_i &lt;= 1.0e6])</p><p>2) use <br />constraints = [0 &lt; K, K &lt; 1000,Theta_DNA_YY1&gt;-1e6, Theta_DNA_YY1 &lt; 1e6]&nbsp; &nbsp; <br />instead. Also, you may use implicitBounds = (-1e6, 1e6) or mere implicitBounds = 1e6 instead, it doesn&#039;t makes problem constrained for those solvers that don&#039;t require finite box bounds.</p>]]></description>
			<author><![CDATA[dummy@example.com (Dmitrey)]]></author>
			<pubDate>Tue, 09 Aug 2011 20:49:10 +0000</pubDate>
			<guid>http://forum.openopt.org/viewtopic.php?pid=1359#p1359</guid>
		</item>
		<item>
			<title><![CDATA[Problem with problem, galileo and de]]></title>
			<link>http://forum.openopt.org/viewtopic.php?pid=1358#p1358</link>
			<description><![CDATA[<p>Hi, I&#039;m trying to use openopt, but find lots of bugs, and when I resolve one, or find some kind of workaround, then next I just find next one.</p><p>Here is simple model, in which I try to fit some parameters to experimental data, essentially using least-square model + additional parameter, making it non-linear. It is here presented as one in 3 variables (original have about Zmiennych=200 + 1 for K), but error is the same.</p><div class="codebox"><pre><code>from openopt import GLP, oosolver
from FuncDesigner import *

from numpy import zeros, ones

#K_ = oovars(1)
#K = K_[0]
K = oovar(size=1)
A0 = 2.0e-6
B0 = 5.0e-6

Zmiennych = 2

Theta_DNA = zeros(Zmiennych) # , int/float)
Theta_YY1 = zeros(Zmiennych)
Theta_Total = zeros(Zmiennych)
Theta_DNA_YY1 = oovar(size=Zmiennych)

for i in range(Zmiennych):
    Theta_YY1[i] = 4.5
    Theta_DNA[i] = 8.7
    Theta_Total[i] = 4.1


S_AB = 0.5*(A0 + B0 + K*1.0e-6 - sqrt( (A0 + B0 + K*1.0e-6)**2 - 4.0*A0*B0 ) )
S_A = (A0 - S_AB)
S_B = (B0 - S_AB)

Roznice = 1.0e-3*(S_A*Theta_DNA + S_B*Theta_YY1 + S_AB*Theta_DNA_YY1) - Theta_Total

f = Roznice[0]**2 + Roznice[1]**2
#f = sum(Roznice**2)

constraints = [0 &lt; K, K &lt; 1000]     # Was trying to use &lt;=, but it doesn&#039;t help
for i in xrange(Zmiennych):
    constraints.extend([-1.0e6 &lt;= Theta_DNA_YY1[i], Theta_DNA_YY1[i] &lt;= 1.0e6])

startPoint = {K: 0.32, Theta_DNA_YY1: ones(Zmiennych)}

p = GLP(f, startPoint, constraints=constraints)

#solver = oosolver(&#039;de&#039;)
solver = oosolver(&#039;galileo&#039;)

r = p.solve(solver, plot=1)</code></pre></div><p>Using de, I got</p><div class="codebox"><pre><code>FuncDesigner warning: Probably scipy installation could speed up running the code involved

------------------------- OpenOpt 0.34 -------------------------
solver: de   problem: unnamed    type: GLP
 iter   objFunVal   log10(maxResidual)   
    0  3.362e+01            -100.00 
OpenOpt Error: this solver requires finite lb, ub: lb &lt;= x &lt;= ub
Traceback (most recent call last):
  File &quot;./bug2.py&quot;, line 47, in &lt;module&gt;
    r = p.solve(solver, plot=1)
  File &quot;/usr/local/lib/python2.6/dist-packages/openopt-0.34-py2.6.egg/openopt/kernel/baseProblem.py&quot;, line 235, in solve
    return runProbSolver(self, *args, **kwargs)
  File &quot;/usr/local/lib/python2.6/dist-packages/openopt-0.34-py2.6.egg/openopt/kernel/runProbSolver.py&quot;, line 238, in runProbSolver
    solver(p)
  File &quot;/usr/local/lib/python2.6/dist-packages/openopt-0.34-py2.6.egg/openopt/solvers/UkrOpt/de_oo.py&quot;, line 74, in __solver__
    if not p.__isFiniteBoxBounded__(): p.err(&#039;this solver requires finite lb, ub: lb &lt;= x &lt;= ub&#039;)
  File &quot;/usr/local/lib/python2.6/dist-packages/openopt-0.34-py2.6.egg/openopt/kernel/oologfcn.py&quot;, line 16, in ooerr
    raise OpenOptException(msg)
oologfcn.OpenOptException: this solver requires finite lb, ub: lb &lt;= x &lt;= ub</code></pre></div><p>and one using galileo</p><div class="codebox"><pre><code>FuncDesigner warning: Probably scipy installation could speed up running the code involved

------------------------- OpenOpt 0.34 -------------------------
solver: galileo   problem: unnamed    type: GLP
OpenOpt Error: the solver galileo cannot handle &#039;A&#039; data
Traceback (most recent call last):
  File &quot;./bug2.py&quot;, line 47, in &lt;module&gt;
    r = p.solve(solver, plot=1)
  File &quot;/usr/local/lib/python2.6/dist-packages/openopt-0.34-py2.6.egg/openopt/kernel/baseProblem.py&quot;, line 235, in solve
    return runProbSolver(self, *args, **kwargs)
  File &quot;/usr/local/lib/python2.6/dist-packages/openopt-0.34-py2.6.egg/openopt/kernel/runProbSolver.py&quot;, line 219, in runProbSolver
    nErr = check(p)
  File &quot;/usr/local/lib/python2.6/dist-packages/openopt-0.34-py2.6.egg/openopt/kernel/check.py&quot;, line 19, in check
    p.err(&#039;the solver &#039; + p.solver.__name__ + &#039; cannot handle &#039; + &quot;&#039;&quot; + fn + &quot;&#039; data&quot;)
  File &quot;/usr/local/lib/python2.6/dist-packages/openopt-0.34-py2.6.egg/openopt/kernel/oologfcn.py&quot;, line 16, in ooerr
    raise OpenOptException(msg)
oologfcn.OpenOptException: the solver galileo cannot handle &#039;A&#039; data</code></pre></div><p>With interalg,</p><div class="codebox"><pre><code>FuncDesigner warning: Probably scipy installation could speed up running the code involved

------------------------- OpenOpt 0.34 -------------------------
solver: interalg_0.21   problem: unnamed    type: GLP
 iter   objFunVal   log10(maxResidual)   
    0  3.362e+01            -100.00 
OpenOpt Error: 
            solver interalg_0.21 requires finite lb, ub: 
            lb &lt;= x &lt;= ub 
            (you can use &quot;implicitBoounds&quot;)
            
Traceback (most recent call last):
  File &quot;./bug2.py&quot;, line 48, in &lt;module&gt;
    r = p.solve(solver, plot=1)
  File &quot;/usr/local/lib/python2.6/dist-packages/openopt-0.34-py2.6.egg/openopt/kernel/baseProblem.py&quot;, line 235, in solve
    return runProbSolver(self, *args, **kwargs)
  File &quot;/usr/local/lib/python2.6/dist-packages/openopt-0.34-py2.6.egg/openopt/kernel/runProbSolver.py&quot;, line 238, in runProbSolver
    solver(p)
  File &quot;/usr/local/lib/python2.6/dist-packages/openopt-0.34-py2.6.egg/openopt/solvers/UkrOpt/interalg_oo.py&quot;, line 46, in __solver__
    &#039;&#039;&#039; % self.__name__)
  File &quot;/usr/local/lib/python2.6/dist-packages/openopt-0.34-py2.6.egg/openopt/kernel/oologfcn.py&quot;, line 16, in ooerr
    raise OpenOptException(msg)
oologfcn.OpenOptException: 
            solver interalg_0.21 requires finite lb, ub: 
            lb &lt;= x &lt;= ub 
            (you can use &quot;implicitBoounds&quot;)</code></pre></div><p>I really do not understand what is going on in both cases. Name (even automatically created) for which data, variable is a problem would be helpful. In first case, I given all constrains, being finite. In second case, I have no idea what solver is asking me about &#039;A&#039; data.</p><p>I&#039;m fighting with this for more than a week, without success. Was trying to use oovar or oovars, in multiple combinations, but then other problems arises. Help will be appreciated. Thanks.</p>]]></description>
			<author><![CDATA[dummy@example.com (baryluk)]]></author>
			<pubDate>Tue, 09 Aug 2011 20:40:44 +0000</pubDate>
			<guid>http://forum.openopt.org/viewtopic.php?pid=1358#p1358</guid>
		</item>
		<item>
			<title><![CDATA[Re: OpenOpt for non linear problems]]></title>
			<link>http://forum.openopt.org/viewtopic.php?pid=1352#p1352</link>
			<description><![CDATA[<p>So what about other issues? What do you mean with log(stats.norm.pdf(3 parameters)).sum()? </p><p>If it was log(stats.norm.pdf(parameter_1)) + log(stats.norm.pdf(parameter_3)) + log(stats.norm.pdf(parameter_3)), here&#039;s my version by FD (giveas auto derivatives and interval analysis for interalg):</p><div class="codebox"><pre><code>from numpy import *
from openopt import *
from FuncDesigner import *

alpha, a0, a1, b1 = oovars(&#039;alpha a0 a1 b1&#039;)

ThetaSto = array([1,2,3])
j = 1    # actually ThetaSto is an existing array correctly defined (12775x1)

#pdf = lambda x: exp(-x**2/2)/sqrt(2*pi)

logpdf = lambda x: -x**2 / 2.0 - 0.5*log(2*pi)
# however, that fixed constant 0.5*log(2*pi) doesn&#039;t matter for optimal point searching


Psi = logpdf(ThetaSto[j]) + logpdf(ThetaSto[j]*exp(-alpha)) + logpdf((a0 + a1*cos(2*pi*j/365) + b1*sin(2*pi*j/365))*\
                                      sqrt((1-exp(-2*alpha))/(2*alpha)))

# parameters estimation
StartPoint = {alpha:0.2, a0:2, a1:0.2, b1:0.1}

p = NLP(Psi, StartPoint, goal=&#039;max&#039;) 

#r = p.solve(&#039;ralg&#039;) - I&#039;m not sure it will work with all those multiextrema funcs like cos, sin, nonconvex log
r = p.solve(&#039;interalg&#039;, implicitBounds = (-1000, 1000), fTol = 1e-10)

print(r(alpha, a0, a1, b1))
#[500.0, 0.0, 0.0, 0.0]</code></pre></div><p>I intend to add some stats funcs like erf, pdf, but I have some more urgent things for now.<br />In our country we don&#039;t have neither internal study nor internship, could you explain what openopt is used for (which task?)</p><p>Regards, D.</p>]]></description>
			<author><![CDATA[dummy@example.com (Dmitrey)]]></author>
			<pubDate>Thu, 04 Aug 2011 16:04:56 +0000</pubDate>
			<guid>http://forum.openopt.org/viewtopic.php?pid=1352#p1352</guid>
		</item>
		<item>
			<title><![CDATA[Re: OpenOpt for non linear problems]]></title>
			<link>http://forum.openopt.org/viewtopic.php?pid=1351#p1351</link>
			<description><![CDATA[<div class="quotebox"><cite>Dmitrey wrote:</cite><blockquote><p>I see something like some bugs in your code.</p><p>stats.norm.pdf(param1, param2, param3, param4) seems to work incorrectly, maybe you meant stats.norm.pdf([param1, param2, param3, param4]) instead?</p><p>--&gt; I tried in the shell and at least this part seems correct.<br />--&gt; I don&#039;t want the probability for a N(0,1) but the probability for a N(m, sigma) : my second parameter is the mean (m), my third parameter the standard deviation (sigma)</p><br /><p>If you want to maximize Psi function, you should use p = NLP(Psi, StartPoint, goal = &#039;max&#039;), elseware minimization will be used (by default).</p><p>There are other issues I&#039;ll comment after your answer.</p><p>What is EDF Research and Development (url) and what is &quot;internal studies&quot;? Education?</p></blockquote></div><p>--&gt; EDF = Electricité de France (french electricity supplier) url: <a href="http://www.edf.com">www.edf.com</a>&nbsp; <br />--&gt; internal study = internship</p><p>--&gt; thank you anyway for your quick answer</p>]]></description>
			<author><![CDATA[dummy@example.com (gbenoit)]]></author>
			<pubDate>Thu, 04 Aug 2011 15:47:32 +0000</pubDate>
			<guid>http://forum.openopt.org/viewtopic.php?pid=1351#p1351</guid>
		</item>
		<item>
			<title><![CDATA[Re: OpenOpt for non linear problems]]></title>
			<link>http://forum.openopt.org/viewtopic.php?pid=1350#p1350</link>
			<description><![CDATA[<p>I see something like some bugs in your code.</p><p>stats.norm.pdf(param1, param2, param3) seems to work incorrectly, maybe you meant stats.norm.pdf([param1, param2, param3]) instead?</p><p>If you want to maximize Psi function, you should use p = NLP(Psi, StartPoint, goal = &#039;max&#039;), elseware minimization will be used (by default).</p><p>There are other issues I&#039;ll comment after your answer.</p><p>What is EDF Research and Development (url) and what is &quot;internal studies&quot;? Education?</p>]]></description>
			<author><![CDATA[dummy@example.com (Dmitrey)]]></author>
			<pubDate>Thu, 04 Aug 2011 15:10:27 +0000</pubDate>
			<guid>http://forum.openopt.org/viewtopic.php?pid=1350#p1350</guid>
		</item>
	</channel>
</rss>
