demo can not run, for function lasso in matlab 2014a
1 view (last 30 days)
Show older comments
Hi Is there anyone who have tried the lasso in matlab 2014a? I have tried it in several PC, it doesn't work and report mistakes for either lasso or lassoglm However, it works in lower edition, e.g. matlab 2013 and matlab 2012b the demo code is from the help document like that
n = 1000; p = 250;
X = randn(n,p);
beta = randn(p,1); beta0 = randn;
Y = beta0 + X*beta + randn(n,1);
lambda = 0:.01:.5;
[B,S] = lasso(X,Y,'Lambda',lambda);
lassoPlot(B,S);
1 Comment
N/A
on 17 Jun 2015
Your code executes on 2014b. Posting the error you get might make it easier to find answers.
Answers (1)
Walter Roberson
on 17 Jun 2015
lasso() is part of the Statistics toolbox. It is possible that Stats toolbox is not installed or not licensed on some of your versions.
2 Comments
Alan Weiss
on 17 Jun 2015
Take a look at the code for zscore:
function [z,mu,sigma] = zscore(x,flag,dim)
So there is nothing wrong with calling zscore(X,1). Whatever the problem is, it is not because the script uses an unsupported syntax.
Alan Weiss
MATLAB mathematical toolbox documentation
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!