Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Bounds error thrown for small regularization parameters #61

Open
hkraemer opened this issue Jul 8, 2021 · 0 comments
Open

Bug: Bounds error thrown for small regularization parameters #61

hkraemer opened this issue Jul 8, 2021 · 0 comments

Comments

@hkraemer
Copy link

hkraemer commented Jul 8, 2021

Hey people,

maybe this is related to #54 , but LassoPath seems to struggle for small λ's, in particular for λ=0 (least squares solution). Here is a MWE:

using Lasso
using StatsBase
using Random

##

Random.seed!(1234)
# time series length
N = 5
# create a random time series of length N
s = rand(N)

# create a Data Matrix
Θ = ones(N,15)
Θ[1:50] .= 0
shuffle!(Θ)

# λ 1e-1 works
Lf = fit(LassoPath, Θ, s; standardize = false, intercept = false, λ=[1e-1])

# λ 1e-2 fails
Lf = fit(LassoPath, Θ, s; standardize = false, intercept = false, λ=[1e-2])

# ERROR: BoundsError: attempt to access 10×15 Array{Float64,2} at index [11, 12]

In Matlab's lasso this is no problem and λ=0 yields the least squares solution.

What am I missing here? Any help is appreciated,

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant