# [SciPy-User] lower bounds argument for scipy.optimize.anneal

Mon Oct 4 18:48:27 CDT 2010

```The classic hack to keep a parameter positive is to fit the square root of the
parameter rather than the parameter itself - when you square your rejigged
parameter in your expression it's guaranteed to be positive.

cheers,
David

----- Original Message ----
To: SciPy Users List <scipy-user@scipy.org>
Sent: Tue, 5 October, 2010 10:20:21 AM
Subject: Re: [SciPy-User] lower bounds argument for scipy.optimize.anneal

So is there any way I can hack around this functionality? I only want
to allow my parameters to be zero or higher.

I see that I can use some of these algorithms for constrained optimization:
fmin_slsqp
fmin_l_bfgs_b
fmin_cobyla

but I have never used any of them.......how sensitive are they to local minima?

Thanks

On 4 October 2010 21:47,  <josef.pktd@gmail.com> wrote:
> On Mon, Oct 4, 2010 at 12:59 PM, Nathan Harmston
>> Hi,
>>
>> So I'm trying to use the siman function to minimise a likelihood function:
>>
>> print anneal(anneal_ll,[100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
>> 100.0, 100.0, 100.0, 100.0, 100.0, 100.0],lower=[0.0, 0.0, 0.0, 0.0,
>> 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
>> full_output=1,feps=1e-4,maxiter=1000000000,schedule='cauchy')
>>
>> My parameters estimate properly however I get negative values for some
>> of the parameters. I thought the lower argument specified the lowest
>> value a parameter could take? Am I doing something incredibly stupid
>> or is this functionality not implemented?
>
> It's not implemented from what I understand, see
>
> http://projects.scipy.org/scipy/ticket/1126
>
> Josef
>
>>
>>
>> Nathan Harmston
>>
>> --
>> Nathan Harmston
>> PhD Researcher: Theoretical Systems Biology
>> Biochemistry Building
>> Department of Biological Sciences
>> Imperial College London
>> SW7 2AY London
>> Tel: +44 (0)20 7594 5044
>>
>> Theoretical Systems Biology - Imperial College London
>> http://www3.imperial.ac.uk/theoreticalsystemsbiology/people/nathanharmston
>>
>> http://biogeeks.wordpress.com/
>> http://biostar.stackexchange.com/users/236/nathan-harmston
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User@scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>

--
Nathan Harmston
PhD Researcher: Theoretical Systems Biology
Biochemistry Building
Department of Biological Sciences
Imperial College London
SW7 2AY London
Tel: +44 (0)20 7594 5044

Theoretical Systems Biology - Imperial College London
http://www3.imperial.ac.uk/theoreticalsystemsbiology/people/nathanharmston

http://biogeeks.wordpress.com/
http://biostar.stackexchange.com/users/236/nathan-harmston
_______________________________________________
SciPy-User mailing list
SciPy-User@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user

```