Hi Olaf,

Thanks for responding so quickly. I'm sorry if I didn't make it clear
in my previous message, but the script calls an external program and
has a lot of code that handles that aspect of the procedure. In this
script, the bounds are only sometimes violated. Unfortunately, I
cannot supply you with a simple self-contained script that reproduces
the error. I could post the entire script, but due to licensing issues
I cannot post the external program.

I have started rectifying the parameters before passing them to the
external program. This allows the previously failing optimisation run
to complete and seems to produce sensible results. Though I cannot say
the optimisation is working correctly, the parameter values are
reasonable, so in this particular case the error may be only one of
sign. However, there are situations where some parameters that start
at 0 are adjusted to the minimum bound (>0), while others are left at
zero or are subsequently adjusted to zero, so I think the problem is
more complicated than this.

I appreciate I'm not making it easy for you to help, but if there is
anything I can do to help diagnose this, please ask.

Thanks,

Gary


On 14 May 2010 07:15, Olaf Till <[email protected]> wrote:
> On Thu, May 13, 2010 at 09:34:14AM +0100, Gary wrote:
>> Hi all,
>>
>> First, thank you for your efforts in providing the octave packages.
>> This would not be possible without you!
>>
>> PROBLEM:
>> I'm quite new to octave but have managed to cobble a script together
>> that uses leasqr with bounded parameters to fit model parameters to
>> experimental values. The code has been working well, but with certain
>> initial parameters the bounds I've set are not respected and the value
>> of some parameters, almost always only one, become -ve (they should
>> all be +ve). I've searched the archive and the web for reports of
>> similar problems but couldn't find anything relevant.
>>
>> VERSION DETAILS:
>> octave: 3.2.3
>> optim: 1.0.12
>> os: kubuntu 10.04
>>
>> RELEVANT CODE:
>> ## generate parameters for leasqr
>> pin_ones = ones(length(pin),1);
>>
>> stol=0.0001;  # scalar tolerance on fractional improvement in scalar
>> sum ofsquares = sum((wt.*(y-f))^2); default stol = .0001;
>> niter=40;             # maximum number of iterations; default = 20;
>> wt = 1 ./ (0.05*expt_data .* ones(length(expt_data),1)).^(2); #
>> statistical weighting = 1/(variance)^2
>> dp =  0.001*pin_ones; # fractional increment of p for numerical
>> partial derivatives default = .001*ones(size(pin));
>> dFdp = 'dfdp';                #    name of partial derivative function in 
>> quotes;
>> default is 'dfdp'
>> max_Dnt = 1e40;
>> options.bounds = [ 1e-30*pin_ones, max_Dnt*pin_ones ];                # 
>> constraints
>> (also applied to optimised input file parameters)
>>
>> ## Call ctave fitting routine
>> [f,p,kvg,iter,corp,covp,covr,stdresid,Z,r2] = leasqr(expt_Vg_all,
>> expt_data, pin, 'F', stol, niter, wt, dp, dFdp, options);
>
> Please submit a self-contained script, as short and clear as possible,
> to reproduce the bug.
>
> Olaf
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Octave-dev mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/octave-dev
>

------------------------------------------------------------------------------

_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to