On Thu, 14 Jun 2018, Sven Schreiber wrote:
Am 14.06.2018 um 07:17 schrieb Riccardo (Jack) Lucchetti:
> On Wed, 13 Jun 2018, Sven Schreiber wrote:
>
>> 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.
>
> My concern is: how do you get automatic bandwidth selection and the
> leave-one-out option together? I guess that, in your scheme, you could
> leave the third argument empty and set the fourth one to 1, but it looks
> sort of awkward to me. Anyway, it's a possibility.
Jack, please reformulate your proposal in strict hansl. Because you wrote:
function series nadwat(seties y, series x, scalar bandwidth[auto],
bool leave_one_out[0], scalar trim[4])
but there is no such thing as an "auto" default value in hansl AFAIK,
Ok, something like
<hansl>
function series nadwat(seties y, series x, scalar bandwidth[0],
bool leave_one_out[0], scalar trim[4])
if bandwidth == 0
bandwidth = set_auto($nobs, x)
endif
[...]
end function
</hansl>
and also you put the default for leave_one_out to 0 whereas verbally
it
sounds as if you want to have 1. So this is confusing.
I have no strong opinion on this. Either 0 and 1 are equally tenable
default values, in my opinion.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------