Why 'lasso' performs differently for 'Lambda' as vector and 'Lambda' as scalar value

Hello,
I have a question regarding lasso (or lassoglm) function. As it said I can put there my values of 'Lambda' (it should be a vector of nonnegative values).
I tried two different options:
  1. I made a vector L = [0.001, 0.003, 0.01, 0.03, 0.1], run the algorithm with these values and got an output (I understood, the coefficients will be calculated for every value in the vector).
  2. I created separate scalar values L1 = 0.001, L2 = 0.003, L3 = 0.01, L4 = 0.03, L5 = 0.1, run the algorithm for each of them and got an output.
As you can see, I put the same values of Lambda but in the first case it's a vector and in the second case it is separate values. I expected, I have to get the same output for both cases. However, the outputs are totally different.
Where from comes this difference?

回答(0 个)

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by