Skip to content

Commit 1e952db

Browse files
nsamp in subsequent LS steps fixed
1 parent f41538f commit 1e952db

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

toolbox/regression/LTSts.m

+9-4
Original file line numberDiff line numberDiff line change
@@ -1405,12 +1405,11 @@
14051405
% adjust nsamp if it is greater than (n p)
14061406
if nsamp_gt_ncomb
14071407
if isscalar(options.nsamp)
1408-
options.nsamp = ncomb;
14091408
disp(['It is reduced to (n p)=' num2str(ncomb)]);
1409+
options.nsamp = ncomb;
14101410
elseif numel(options.nsamp) == 2
1411+
disp(['nsamp(1) reduced from ' num2str(options.nsamp(1)) ' to ' num2str(ncomb) ]);
14111412
options.nsamp(1) = min(options.nsamp(1) , ncomb);
1412-
options.nsamp(2) = min(options.nsamp(2) , ncomb);
1413-
disp(['It is reduced to nsamp(1)=' num2str(options.nsamp(1)) ' and nsamp(2)=' num2str(options.nsamp(2))]);
14141413
end
14151414
end
14161415

@@ -1524,7 +1523,13 @@
15241523
% vector.
15251524
LSH = lshift(:)';
15261525
% total number of subsets to pass to procedure subsets.
1527-
ncombLSH = bc(T-1-nummissing,pini+1); %DDD
1526+
ncombLSH = bc(T-1-nummissing,pini+1);
1527+
if numel(options.nsamp) == 2
1528+
if options.msg == 1 && options.nsamp(2) > ncombLSH
1529+
disp(['nsamp(2) > ncombLSH: only ' num2str(ncombLSH) , 'samples are used' ]);
1530+
end
1531+
nsampsubsequentsteps = min(options.nsamp(2) , ncombLSH);
1532+
end
15281533
else
15291534
LSH=0;
15301535
ncombLSH=0;

0 commit comments

Comments
 (0)