On Wed, 13 Nov 2019, Sven Schreiber wrote:
Am 13.11.2019 um 10:33 schrieb Riccardo (Jack) Lucchetti:
> On Wed, 13 Nov 2019, Stefano Fachin wrote:
>
>>
>> I think adding this to the GUI and extend it to operate on lists is a
>> great idea. We should be careful about definitions, though -
>> "standardize" means "center on the mean AND divide by standard
>> deviation". Probably something more neutral like "scale" or
"rescale"
>> is more suitable for a function which can be flagged to either center
>> only or center + divide by s.d. (with or without d.f. correction)
>
> I think Stefano has a point here; if I had to choose, I'd go by
> "rescale".
IMHO, if a very generic name is chosen (which in principle is fine with
me) then I would suggest to put more thought and perhaps more
functionality into it. For example R's scale function
(
https://www.rdocumentation.org/packages/base/versions/3.6.1/topics/scale)
allows to give obs-specific values to be subtracted (for centering) and
other obs-specific values for division (scaling as such).
Also I would like to mention a specific use case, namely recursive
recentering. Say x is a T-element column vector then for the wanted
result m we would have m[t] = x[t] - mean(x[1:t]). This could of course
be generalized to recursive standardization. (And I hear somebody
already screaming for rolling recentering :-)
I wouldn't endow a function with too many options, I find that very R-ish,
but maybe it's just me. Anyway, recursive demeaning (that I have never
seen used anywhere, I'd be curious to see a real-life use case) is easy
enough to do in hansl:
<hansl>
X = mnormal(20,3)
M = X - cum(X) ./ seq(1, rows(X))'
</hansl>
-------------------------------------------------------
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
-------------------------------------------------------