File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
lib/src/Uncertainty/StatTests Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,21 @@ VisualTest::VisualTest()
40
40
{
41
41
}
42
42
43
+ /* Draw the empirical CDF of the Sample when its dimension is 1 */
44
+ Graph VisualTest::DrawEmpiricalCDF (const Sample & sample)
45
+ {
46
+ if (sample.getDimension () != 1 )
47
+ throw InvalidDimensionException (HERE) << " In VisualTest::DrawEmpiricalCDF: sample should be of dimension 1, here dimension=" << sample.getDimension ();
48
+ return UserDefined (sample).drawCDF ();
49
+ }
50
+
43
51
/* Draw the empirical CDF of the Sample when its dimension is 1 */
44
52
Graph VisualTest::DrawEmpiricalCDF (const Sample & sample,
45
53
const Scalar xMin,
46
54
const Scalar xMax)
47
55
{
56
+ if (sample.getDimension () != 1 )
57
+ throw InvalidDimensionException (HERE) << " In VisualTest::DrawEmpiricalCDF: sample should be of dimension 1, here dimension=" << sample.getDimension ();
48
58
return UserDefined (sample).drawCDF (xMin, xMax);
49
59
}
50
60
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ public:
40
40
41
41
42
42
/* * Draw the empirical CDF of the Sample when its dimension is 1 */
43
+ static Graph DrawEmpiricalCDF (const Sample & sample);
44
+
43
45
static Graph DrawEmpiricalCDF (const Sample & sample,
44
46
const Scalar xMin,
45
47
const Scalar xMax);
Original file line number Diff line number Diff line change @@ -268,6 +268,7 @@ Draw an histogram:
268
268
"Draw an empirical CDF.
269
269
270
270
Available usages:
271
+ VisualTest.DrawEmpiricalCDF(*sample*)
271
272
VisualTest.DrawEmpiricalCDF(*sample, Xmin, Xmax*)
272
273
273
274
Parameters
@@ -296,12 +297,10 @@ Generate a random sample from a Normal distribution:
296
297
297
298
>>> ot.RandomGenerator.SetSeed(0)
298
299
>>> sample = ot.Normal(1).getSample(100)
299
- >>> Xmin = sample.getMin()[0]
300
- >>> Xmax = sample.getMax()[0]
301
300
302
301
Draw an empirical CDF:
303
302
304
- >>> empiricalCDF = ot.VisualTest.DrawEmpiricalCDF(sample, Xmin - 1.0, Xmax + 1.0 )
303
+ >>> empiricalCDF = ot.VisualTest.DrawEmpiricalCDF(sample)
305
304
>>> View(empiricalCDF).show()"
306
305
307
306
// ---------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments