On Fri, May 20, 2022 at 4:11 PM Sven Schreiber <svetosch(a)gmx.net> wrote:
Am 20.05.2022 um 21:59 schrieb Cottrell, Allin:
> On Fri, May 20, 2022 at 10:35 AM Sven Schreiber <svetosch(a)gmx.net> wrote:
>>
>> Hi, one other trivial question about regls:
>>
>> In the result bundle we have the member "B" with all coefficients,
and
>> "nzb" with the non-zero coefficients. Fine, but then we also have
"nzX".
>> What I'm saying is that we have a mixture of upper- and lowercase
>> conventions here. Would it be too late to introduce "nzB" as an alias
>> for "nzb"? Or maybe even better to have "b" mean the same
thing as "B",
>> since the beta vector is also a small greek letter?
>
> I see your point, but here's my rationale for the use of 'b' versus
> 'B'. Other than in the (unlikely, not very practical) case where the
> user wants results for a single penalty value, the object "B" in the
> bundle returned by regls will be a matrix with several columns, while
> nzb will always be a column vector holding the non-zero elements of
> the "optimal" coeff vector (where "optimality" is determined
either
> via BIC or cross validation).
Right, that makes sense - except in the case where single_b is switched
on and a single output vector is requested for B.
But actually this makes me think: Could there be a case for a matrices
array nzB of length nlambda, where each entry holds the associated
nzb-s? And perhaps likewise nzLX an array of lists with individual nzX-s
in them? But maybe it's overkill.
IMO it would indeed be overkill. You have the big B matrix if you want
to do anything non-standard. Cutting a given column of B down to its
non-zero elements is easy enough given the tools available in hansl,
but only offers a marginal efficiency gain relative to using the
column "as-is", with zeros included.
Allin