# BoundsError using fit(LassoPath, X,Y, lambda = grid)

**URL:** <https://discourse.julialang.org/t/boundserror-using-fit-lassopath-x-y-lambda-grid/76831>\
**Category:** Statistics\
**Tags:** question\
**Created:** [February 21, 2022, 7:00am UTC](https://discourse.julialang.org/t/boundserror-using-fit-lassopath-x-y-lambda-grid/76831 "2022-02-21T07:00:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aminath\_Shausan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aminath_shausan/32/33587_2.png) [@Aminath\_Shausan](https://discourse.julialang.org/u/Aminath_Shausan)\
**Post date:** [February 21, 2022, 7:00am UTC](https://discourse.julialang.org/t/boundserror-using-fit-lassopath-x-y-lambda-grid/76831/1 "2022-02-21T07:00:01Z")

</div>

Hi,  
I am a beginner of Julia language. I am learning to fit a multiple regression model using lasso.jl, with **fit(LassoPath, X,Y, lambda = grid)** My feature matrix (X) contains 238 variables with 52 rows. The response vector has 52 elements. lambda is a vector 751 elements ranging from 0 to 150.

When the dimension of my feature matrix (X) exceeds 104, I get the error: **BoundsError: attempt to access 104×105 Matrix{Float64} at index [105, 1]**

I did some googling about this error, and couldn’t find solution to this problem. Could you please help.  
Thanks  
Aminath

---

<div class="post-metadata">

**Author:** ![Aminath\_Shausan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aminath_shausan/32/33587_2.png) [@Aminath\_Shausan](https://discourse.julialang.org/u/Aminath_Shausan)\
**Post date:** [February 21, 2022, 7:28am UTC](https://discourse.julialang.org/t/boundserror-using-fit-lassopath-x-y-lambda-grid/76831/2 "2022-02-21T07:28:44Z")

</div>

Ok, I found that the solution is to increase the ‘maxncoef’ argument, and it worked.
