Em 16 de junho de 2018, Sven Schreiber escreveu:
Am 16.06.2018 um 13:04 schrieb Riccardo (Jack) Lucchetti:
On Sat, 16 Jun 2018, Sven Schreiber wrote:

Hi Henrique,
thanks for this code. This could be quite easily turned into a nice function package. What would it take to convince you to do it?

Really very nice. The equivalent for vectors, in two varieties. The first is a slighly more idiomatic adaptation of Henrique's code, the other one uses recursion.

Thanks Jack. I think one of your two implementations should eventually go into the extra.gfn package. I slightly prefer the second one, but what do you think?

I'm attaching some code with a function that uses your AltPSetMat function to do the combinatorial regression. (Henrique, I haven't measured it, but my intuition would be that it is faster to refer to the variables by their ID numbers instead of their names, so that's what is done here.) Something like this could become a function package.

And slightly OT about gretl internals: Along the way I've noticed two things. The first is that the deflist() function doesn't accept a vector of series IDs as input, in the way that genr-based list construction like "list L = {1,2}" does; maybe deflist should accept that.
The second thing is that it would be nice to have a generalization of the varnum() function, to return a vector of series IDs for a list input. See my workaround helper function listIDs in the file. (This would be a bit like the generalization of varname to varnames, for example.)

Dear Sven and Jack,

I would like to make some speed tests using the approaches suggested by me and Jack before we decide the best way (in terms of speed) to use the powerset function inside Gretl. I think we could consider using C code too (the powerset is really a bottleneck when we have more than 15 variables to combine).

Best,
Henrique Andrade