On Sat, Mar 20, 2010 at 6:15 PM, Søren Hauberg <so...@hauberg.org> wrote:

> fre, 12 03 2010 kl. 10:13 +0100, skrev Olaf Till:
> > To your original question, I'd now think that just the necessary
> > change should be made (your suggestion of disallowing extra arguments
> > since we have anonymous functions seems fine to me), and additional
> > interface changes are not necessary so much since (IMO) there should
> > be general wrappers anyway sometime. How to implement the latter could
> > be discussed separately from the original problem.
>
> I've been looking a bit at this. My first thought was simply to remove
> the option of passing extra arguments to the functions via lists.
> However, it seems like lists are also used to control which dimensions
> should be optimised. Lists also seems to be used internally.
>
> I don't use the these functionalities, so I fear that if I "fix" the
> problems, then I'll just break the code. So, I would really appreciate
> some help here.
>
> Can somebody who actually use all this 'list' stuff look into replacing
> it by something more modern? Let me stress that if this doesn't happen,
> then 'optim' will NOT be usable with Octave 3.4. IMHO that would be
> quite a loss.
>
> Søren
>
>
I think that replacing list with cell arrays is pretty straightforward. I
did that for samin and bfgsmin quite a while ago, when lists were
deprecated. I suggest that the authors of the functions in question take
care of this before Octave 3.4 appears. If they don't, then functions that
stop working can be moved to a "deep freeze" directory, so that they can be
recovered when someone has time to work on them.

About requiring objective functions to accept only one argument, I don't
think this is a good idea. There are situations where and objective function
depends naturally on several things. An example is a statistical model,
where there is the parameter to be estimated, the data, and perhaps special
switches that influence the model, but are known ahead of time. If one
contemplates two such statistical models, the data is the same, but the
switches may change. When fitting the two models, it is useful to pass the
name of the model as an argument. For these reasons, I find that an
interface like
myobj(x, data, name_of_model, switches_for_model)
is useful. Perhaps anonymous functions can achieve this in a convenient way,
I'm not sure. If mle_example.m in the Econometrics package could be
rewritten using an anonymous objective function, that would be a helpful
example. IEven if it can be done, I'm not convinced that there are benefits
to doing so, however. What is the advantage.

Cheers, Michael
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to