On Thu, 10 Jun 2021, Sven Schreiber wrote:
Am 10.06.2021 um 10:57 schrieb Riccardo (Jack) Lucchetti:
> Folks,
>
> while revising some old code I stumbled into a function that I'd
> written a while back, and I realised this could go into the extra
> package. Note: for large input vectors (n > 5) the recursion approach
> really is much slower than direct calculation, so there is quite a lot
> of room for optimisation.
>
> Opinions?
OK, so what's the use case?
I had written this in the context of a loop where I was comparing models
of size k chosen from a set of n regressors. But of course this is more
general than this. By the way, Octave has a similar function (nchoosek,
IIRC).
-------------------------------------------------------
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
-------------------------------------------------------