swh:1:snp:3aec91c51d538d62f3f51f6a0af59fe452f330ab
Tip revision: 6e780aec172e7389965f7e64499053b5d3fc30f3 authored by Zhu Wang on 09 February 2022, 20:20:02 UTC
version 0.4-2.21
version 0.4-2.21
Tip revision: 6e780ae
activeset.f
C update the active set with only non-zero coefficients
C input: m, beta, eps
C output: activeset, jk
subroutine find_activeset(m, beta, eps, activeset, jk)
implicit none
integer j, jk, m, activeset(m)
double precision beta(m), eps
do 90 j=1, m
activeset(j)=0
90 continue
C jk: number of variables in active set
jk = 0
C it is possible, jk=0 if beta=0, like intercept-only
C model
do 60 j=1, m
if(dabs(beta(j)) .GT. eps)then
C used jk not j, to be indexed in loop_gaussian subroutine
jk=jk+1
activeset(jk)=j
endif
60 continue
return
end