[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #65186] potential regression due to "isargout"
From: |
Dmitri A. Sergatskov |
Subject: |
[Octave-bug-tracker] [bug #65186] potential regression due to "isargout" changes |
Date: |
Sat, 20 Jan 2024 15:55:37 -0500 (EST) |
URL:
<https://savannah.gnu.org/bugs/?65186>
Summary: potential regression due to "isargout" changes
Group: GNU Octave
Submitter: dasergatskov
Submitted: Sat 20 Jan 2024 08:55:37 PM UTC
Category: Interpreter
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Regression
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: 9.0.90
Discussion Lock: Any
Operating System: GNU/Linux
Fixed Release: None
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Sat 20 Jan 2024 08:55:37 PM UTC By: Dmitri A. Sergatskov <dasergatskov>
With
changeset: 32783:56995fce2adc
branch: stable
parent: 32780:e96e2f9f9f37
user: John W. Eaton <jwe@octave.org>
date: Fri Jan 19 14:06:27 2024 -0500
summary: prepare for eventual removal of isargout
I see:
octave:1> pkg load statistics
octave:2> test gpfit verbose
>>>>>
/home/dima/.local/share/octave/api-v58/packages/statistics-1.6.1/dist_fit/gpfit.m
***** demo
## Sample 2 populations from different generalized Pareto distibutions
## Assume location parameter is known
mu = 0;
rand ("seed", 5); # for reproducibility
r1 = gprnd (1, 2, mu, 20000, 1);
rand ("seed", 2); # for reproducibility
r2 = gprnd (3, 1, mu, 20000, 1);
r = [r1, r2];
## Plot them normalized and fix their colors
hist (r, [0.1:0.2:100], 5);
h = findobj (gca, "Type", "patch");
set (h(1), "facecolor", "r");
set (h(2), "facecolor", "c");
ylim ([0, 1]);
xlim ([0, 5]);
hold on
## Estimate their α and β parameters
k_sigmaA = gpfit (r(:,1));
k_sigmaB = gpfit (r(:,2));
## Plot their estimated PDFs
x = [0.01, 0.1:0.2:18];
y = gppdf (x, k_sigmaA(1), k_sigmaA(2), mu);
plot (x, y, "-pc");
y = gppdf (x, k_sigmaB(1), k_sigmaB(2), mu);
plot (x, y, "-sr");
hold off
legend ({"Normalized HIST of sample 1 with k=1 and σ=2", ...
"Normalized HIST of sample 2 with k=2 and σ=2", ...
sprintf("PDF for sample 1 with estimated k=%0.2f and σ=%0.2f", ...
k_sigmaA(1), k_sigmaA(2)), ...
sprintf("PDF for sample 3 with estimated k=%0.2f and σ=%0.2f", ...
k_sigmaB(1), k_sigmaB(2))})
title ("Three population samples from different generalized Pareto
distibutions")
text (2, 0.7, "Known location parameter μ = 0")
hold off
!!!!! demo failed
'data' undefined near line 232, column 24
octave:3> version -hgid
ans = 56995fce2adc
With previous changeset (32780:e96e2f9f9f37)
octave:1> pkg load statistics
octave:2> test gpfit verbose
>>>>>
/home/dima/.local/share/octave/api-v58/packages/statistics-1.6.1/dist_fit/gpfit.m
***** demo
## Sample 2 populations from different generalized Pareto distibutions
## Assume location parameter is known
mu = 0;
rand ("seed", 5); # for reproducibility
r1 = gprnd (1, 2, mu, 20000, 1);
rand ("seed", 2); # for reproducibility
r2 = gprnd (3, 1, mu, 20000, 1);
r = [r1, r2];
## Plot them normalized and fix their colors
hist (r, [0.1:0.2:100], 5);
h = findobj (gca, "Type", "patch");
set (h(1), "facecolor", "r");
set (h(2), "facecolor", "c");
ylim ([0, 1]);
xlim ([0, 5]);
hold on
## Estimate their α and β parameters
k_sigmaA = gpfit (r(:,1));
k_sigmaB = gpfit (r(:,2));
## Plot their estimated PDFs
x = [0.01, 0.1:0.2:18];
y = gppdf (x, k_sigmaA(1), k_sigmaA(2), mu);
plot (x, y, "-pc");
y = gppdf (x, k_sigmaB(1), k_sigmaB(2), mu);
plot (x, y, "-sr");
hold off
legend ({"Normalized HIST of sample 1 with k=1 and σ=2", ...
"Normalized HIST of sample 2 with k=2 and σ=2", ...
sprintf("PDF for sample 1 with estimated k=%0.2f and σ=%0.2f", ...
k_sigmaA(1), k_sigmaA(2)), ...
sprintf("PDF for sample 3 with estimated k=%0.2f and σ=%0.2f", ...
k_sigmaB(1), k_sigmaB(2))})
title ("Three population samples from different generalized Pareto
distibutions")
text (2, 0.7, "Known location parameter μ = 0")
hold off
Press <enter> to continue:
***** test
shape = 5; scale = 2;
x = gprnd (shape, scale, 0, 1, 100000);
[hat, ci] = gpfit (x);
assert (hat, [shape, scale], 1e-1);
assert (ci, [shape, scale; shape, scale], 2e-1);
***** test
shape = 1; scale = 1;
x = gprnd (shape, scale, 0, 1, 100000);
[hat, ci] = gpfit (x);
assert (hat, [shape, scale], 1e-1);
assert (ci, [shape, scale; shape, scale], 1e-1);
***** test
shape = 3; scale = 2;
x = gprnd (shape, scale, 0, 1, 100000);
[hat, ci] = gpfit (x);
assert (hat, [shape, scale], 1e-1);
assert (ci, [shape, scale; shape, scale], 1e-1);
***** error<gpfit: X must be a vector.> gpfit (ones (2))
***** error<gpfit: X must contain only positive values.> gpfit ([-1, 2])
***** error<gpfit: X must contain only positive values.> gpfit ([0, 1, 2])
***** error<gpfit: wrong value for alpha.> gpfit ([1, 2], 0)
***** error<gpfit: wrong value for alpha.> gpfit ([1, 2], 1.2)
***** error<gpfit: OPTIONS must be a structure for 'fminsearch' function.>
...
gpfit ([1:10], 0.05, 5)
PASSES 9 out of 9 tests
octave:3> test gpfit
PASSES 9 out of 9 tests
octave:4> version -hgid
ans = e96e2f9f9f37
statistics 1.6.1
Dmitri.
--
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?65186>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #65186] potential regression due to "isargout" changes,
Dmitri A. Sergatskov <=