[ADMB Users] Interpolation while optimising
Richard Methot
Richard.Methot at noaa.gov
Tue Oct 5 10:38:42 PDT 2010
When I need to join two discontinuous functions in a differentiable way,
I do something like:
f1(x) for x<X
f2(x) for x>=X
steep=10.; // or larger value depending on expected magnitude of x-X
join(x) =1./(1.+mfexp(steep*(x-X)))); // so is steep and centered on X
// composite function is then
f(x) = f1(x)*join(x) + f2(x)*(1.-join(x));
this is not perfect and depending on the slope of f1 and f2 near X may
result in a small wrinkle in the composite function, but it has served
my purposes.
Rick Methot
Mark Payne wrote:
> Hi,
>
> I have been wondering about this for quite some time. What is the "correct" way to do interpolation in ADMB, so that you don't run into problems with discontinuous gradients? I see that there are a series of cubic spline interpolation functions in there, spine(), splint() but that they are also marked for replacement. Is there something else in the works or is this the best approach?
>
> Cheers,
>
> Mark
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users
>
More information about the Users
mailing list