Nimd_at

10 Reputation

One Badge

2 years, 314 days

MaplePrimes Activity


These are replies submitted by Nimd_at

So I tried to write my own residuals function (I need it as I am going to use multiple datasets to fit the same model) as follows

resid:=proc(eta_L, L0)
sum( (ffit2(eta_L, L0, 'X0[i]') - 'Y0[i]')^2, i=1..6)
end proc;

and find its minimum via DirectSearch

DS3:=CodeTools:-Usage ( DirectSearch:-DataFit(resid2(eta_L, L0)
                      , [eta_L=0.0001 .. 0.1, L0=1.5e10 .. 1.7e10]
                      , X0, Y0, t
                      , strategy=globalsearch
                      , evaluationlimit=30000 , initialpoint=[eta_L=0.005, L0=1.6e10 ]
                              ) );

To my surprise DirectSearch omitted one of the parameters

Addition of dummy index t to resid didn't help. Can you suggest what could be done about it? How I can still minimize my function with both parameters found? Thank you in advance!

Thank you, now it is working!

A bit strangely though - with given initial point it didn't even tried to leave

but I think it is becaue the initial point is good enough; w/o initialpoint option it converges to

which is pretty close. Thank you again!

@Carl Love Thank you! It is outside, indeed, but with the initial value inside the range error persists:

Warning, initial point [L0 = 0.16e11, etaL = etaL] does not satisfy the inequality constraints; trying to find a feasible initial point
Error, (in pr) unable to evaluate etaL to floating-point

Swapping eta0 and L0 doesn't change it either. So somehow it does not treat the second part of the initialpoint as value...

so I modified DirectSearch call a bit and now receiving a strange error:

DirectSearch:-DataFit(ffit2(etaL, L0, t)
                      , [eta_L=0.0001 .. 0.1, L0=1.5e10 .. 1.7e10]
                      , X0, Y0, t
                      , strategy=globalsearch
                      , evaluationlimit=30000 , initialpoint=[L0=1e10, eta_L=0.006]
                              );

Warning, initial point [L0 = 0.1e11, etaL = etaL] does not satisfy the inequality constraints; trying to find a feasible initial point
Error, (in pr) unable to evaluate etaL to floating-point


And I get this error regardless of actual value chosen for eta_L inside initialpoint=[...].

 

Without initialpoint=[...] part it choose initial point well outside the quoted region and of course get bad fit:

Warning, initial point [L0 = .9, etaL = .9] does not satisfy the inequality constraints; trying to find a feasible initial point
Error, (in DirectSearch:-Search) cannot find feasible initial point; specify a new one

 

Please suggest what could be done about it?

Thank you in advance!

Page 1 of 1