Am 13.06.2018 um 12:01 schrieb Riccardo (Jack) Lucchetti:
On Tue, 5 Jun 2018, Sven Schreiber wrote:
> This thread is dangling. Should I open a ticket on the tracker for
> this bandwidth default thing?
I've given the matter some thought, and I am convinced that the best
long-run solution is to deprecate the old function and introduce a new
one. Hence, the following proposal: let's have a function with a
slightly different name (ie nadwat()) with 5 arguments, as in
function series nadwat(seties y, series x, scalar bandwidth[auto],
bool leave_one_out[0], scalar trim[4])
The old function can keep working for a version or two, and then we
retire it together with the nadarwat_trim libset variable.
I don't see why we need to rename and deprecate the nadarwat function to
achieve what you want. In the old version the user always has to give y,
x and h (bandwidth). Plus in the background there is the nadarwat_trim
setting (default 4).
So if we extend the function as you say, then only two things need to be
done internally if the function is called with only the first three args:
1) Check whether bandwidth is negative. If so, set leave_one_out to 1
and bandwidth to abs(bandwidth).
2) Check whether the nadarwat_trim value is != 4. If so, set the trim
arg to that value.
If instead the (new incarnation of) the function is called with 4 or all
5 arguments, then:
1) Check whether bandwidth is negative. If so, raise an error (since
leave_one_out is now responsible for that choice).
2) Always ignore the nadarwat_trim setting, as the usage of the function
with more than 3 args indicates the new version is meant.
So I think backwards compatibility can be achieved quite easily here.
The deprecation would only apply to the nadarwat_trim setting.
cheers,
sven