Skip to content

Commit

Permalink
add 'seed' in random generation in the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pr0m1th3as committed Mar 5, 2024
1 parent 8e6ec93 commit 195715d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions inst/dist_fit/lognfit.m
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@

## Test output
%!test
%! randn ("seed", 1);
%! x = lognrnd (3, 5, [1000, 1]);
%! [paramhat, paramci] = lognfit (x, 0.01);
%! assert (paramci(1,1) < 3);
Expand Down
1 change: 1 addition & 0 deletions inst/dist_obj/LognormalDistribution.m
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ function checkparams (mu, sigma)

## 'paramci' method
%!shared x
%! randn ("seed", 1);
%! x = lognrnd (1, 1, [1, 100]);
%!error <paramci: optional arguments must be in NAME-VALUE pairs.> ...
%! paramci (LognormalDistribution.fit (x), "alpha")
Expand Down

0 comments on commit 195715d

Please sign in to comment.