Am 14.11.24 um 11:57 schrieb Riccardo (Jack) Lucchetti:
For some work I'm doing, I need to apply PCA to data containing missing
values. So I dug up some old code that I had around, which implements
Stock and Watson's EM algorithm (detailed in the 2002 JBES article).
I'm attaching a script with the function and an example if anyone's
interested.
Of course, it'd be nice to make this procedure more readily available to
gretl users. I see four (not mutually exclusive) ways of doing so:
1) modify our existing "pca" command to handle missing values;
2) modify our existing "princomp" function to handle missing values;
3) create a small self-contained function package;
4) integrate the code into the existing "staticfactor" function package.
Which one do you this is best?
Hi Jack,
without having looked at your code. BUT, just in case we decide for a
new package, your code and my unpublished pcaTools package may be merged:
https://github.com/atecon/pcaTools
By the way, the pcaTools package includes a very ad hoc implementation
of sparse-PCA based on my very superficial understanding of some paper
by Tibshirani or so). To be hones, I do not know whether this actually
is a statistically valid implementation of his and others work.
Best
Artur