Personally I also agree with Stefano (something like rescale or rescale itself). Of course in this case - strictly speaking - the demeaning option is not rescaling.



I agree with Jack that maybe recursive demeaning goes a long way (let alone rolling ;) ). But...

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>

Jack (and anyone interested in), have a look in section 3.2, p.585

Michael W. McCracken & Serena Ng (2016) FRED-MD: A Monthly Database
for Macroeconomic Research, Journal of Business & Economic Statistics, 34:4, 574-589, DOI:
10.1080/07350015.2015.1086655


This (recursive standardization) is a feature that I would like to see in the staticfactor package and at a later stage in the DFM package (just to replicate some of those results as in McCracken). Of course, I am not sure (because i have not given a thought) about the theoretical arguments that would support Principal Components estimation or other estimators on recursively demeaned and/or standardized data (moment conditions, consistency, convergence rates).


Apparently, I had - slightly changed - the source code in staticfactor package quite a while ago to replicate the papers diffusion index.


Yiannis