Skip to content

Unsorted group does not throw an error #59

@dajmcdon

Description

@dajmcdon

The expectation (documented) is that group is a sorted integer vector 1:nvars. But an error is not thrown.

library(sparsegl)
X <- matrix(rnorm(20 * 5), nrow = 20)
beta <- c(1, 1, 0, 0, 1)
y <- X %*% beta + rnorm(20)
group1 <- c(3, 3, 3, 1, 2)
pf1 <- c(0, 2, 0)
sparsegl(X, y, group = group1, asparse = 0, pf_group = pf1)
#> 
#> Call:  sparsegl(x = X, y = y, group = group1, pf_group = pf1, asparse = 0) 
#> 
#> Summary of Lambda sequence:
#>           lambda index nnzero active_grps
#> Max.    4.67e-01     1      0           0
#> 3rd Qu. 4.57e-02    26      5           3
#> Median  4.89e-03    50      5           3
#> 1st Qu. 4.78e-04    75      5           3
#> Min.    4.67e-05   100      5           3

Created on 2026-01-09 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions