On 18/10/2025 14:28, Cottrell, Allin wrote:
On Fri, Oct 17, 2025 at 10:27 AM Riccardo (Jack) Lucchetti
<p002264(a)staff.univpm.it> wrote:
> Hi all,
>
> I've begun to explore the issue of the numerical performance of OLS regression,
where you want to condition on a qualitative variable with many different values [and have
come up with an efficient solution].
This is nice. I'd say it's a bit too specialized to be an option to
"ols", and a function package would be a good way to go. But since it
seems that aggregate() does the heavy lifting, we could revisit that
to see if there's a tweak that could speed things up in this case.
However, I wouldn't be opposed to a new "fols" command (fols y xlist ;
faclist) if that has an additional speed advantage.
In fact, it's not just
aggregate(); the effect of replace() on total CPU
time is not negligible either. I had a look at the code to see if there
could be some optimisations we could use with that (pre-sorting of the
vector to replace springs to mind --- of course it wouldn't be uniformly
beneficial, but in some cases it may) but I didn't pursue the matter
much further.
-------------------------------------------------------
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
-------------------------------------------------------