Skip to content

Commit

Permalink
Optimized code
Browse files Browse the repository at this point in the history
  • Loading branch information
atuldeshpande committed Apr 4, 2019
1 parent cf1110e commit ffc3ce3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion code/dropSamples.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [XR] = dropZeroSamples(varargin)
function [XR] = dropSamples(varargin)
probRemove = (varargin{1});
if ~iscell(varargin{2})
infile = varargin{2};
Expand Down
10 changes: 6 additions & 4 deletions code/iLasso_for_SCINGE.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@
for i = (B+1):N1
bm(i-B) = Series{1}(1, i);
ti = (Series{1}(2, i) - (L)*Dt):Dt:(Series{1}(2, i)-Dt);
ti = repmat(ti, length(Series{j}(2, :)), 1);
tSelect = repmat(Series{j}(2, :)', 1, L0);
ySelect = repmat(Series{j}(1, :)', 1, L0);
% ti = repmat(ti, length(Series{j}(2, :)), 1);
% tSelect = repmat(Series{j}(2, :)', 1, L0);
tSelect = Series{j}(2, :)';
%ySelect = repmat(Series{j}(1, :)', 1, L0);
ySelect = Series{j}(1, :)';
switch krnl
case 'Sinc' % The sinc Kernel
Kp = sinc((ti-tSelect)/SIG);
Expand All @@ -53,7 +55,7 @@
otherwise
Kp = exp(-((ti-tSelect).^2)/SIG); % The Gaussian Kernel
end
Am(i-B, ((j-1)*L0+1):(j*L0) ) = sum(ySelect.*Kp)./sum(Kp);
Am(i-B, ((j-1)*L0+1):(j*L0)) = (ySelect'*Kp)./sum(Kp);
end
end
% Solving Lasso using a solver; here the 'GLMnet' package
Expand Down

0 comments on commit ffc3ce3

Please sign in to comment.