Skip to content

Commit e2e8572

Browse files
[WIP] Introduce Phd
1 parent 68b7416 commit e2e8572

File tree

187 files changed

+3604
-174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+3604
-174
lines changed

src/Perfolizer/Perfolizer.Demo/QuantileEstimatorDemo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void Run()
2828
// * Akinshin, Andrey. "Trimmed Harrell-Davis quantile estimator based on the highest density interval of the given width."
2929
// arXiv preprint arXiv:2111.11776 (2021).
3030
// https://arxiv.org/abs/2111.11776
31-
TrimmedHarrellDavisQuantileEstimator.SqrtInstance,
31+
TrimmedHarrellDavisQuantileEstimator.Sqrt,
3232
// The Sfakianakis-Verginis quantile estimators
3333
// They use a weighted sum of all sample elements, weights are assigned according to the Binomial distribution
3434
// * Sfakianakis, Michael E., and Dimitris G. Verginis. "A new family of nonparametric quantile estimators."

src/Perfolizer/Perfolizer.Tests/Mathematics/Cpd/EdPeltTests.cs renamed to src/Perfolizer/Perfolizer.SimulationTests/Cpd/EdPeltTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using JetBrains.Annotations;
22
using Perfolizer.Mathematics.Cpd;
3-
using Perfolizer.Tests.Common;
3+
using Perfolizer.Tests.Infra;
44

5-
namespace Perfolizer.Tests.Mathematics.Cpd;
5+
namespace Perfolizer.SimulationTests.Cpd;
66

77
public class EdPeltTests
88
{

src/Perfolizer/Perfolizer.Tests/Mathematics/Cpd/RqqPeltTests.cs renamed to src/Perfolizer/Perfolizer.SimulationTests/Cpd/RqqPeltTests.cs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
using JetBrains.Annotations;
22
using Perfolizer.Mathematics.Cpd;
33
using Perfolizer.Mathematics.Distributions.ContinuousDistributions;
4-
using Perfolizer.Tests.Common;
5-
using Perfolizer.Tests.Mathematics.Cpd.TestDataSets;
4+
using Perfolizer.SimulationTests.Cpd.TestDataSets;
5+
using Perfolizer.Tests.Infra;
6+
using Xunit.Abstractions;
67

7-
namespace Perfolizer.Tests.Mathematics.Cpd;
8+
namespace Perfolizer.SimulationTests.Cpd;
89

9-
public class RqqPeltTests
10+
public class RqqPeltTests(ITestOutputHelper output)
1011
{
11-
private readonly ITestOutputHelper output;
1212
private readonly PeltChangePointDetector detector = RqqPeltChangePointDetector.Instance;
1313

14-
public RqqPeltTests(ITestOutputHelper output)
15-
{
16-
this.output = output;
17-
}
18-
1914
[AssertionMethod]
2015
private void Check(double[] data, int minDistance, int[] expectedChangePoints)
2116
{
@@ -31,13 +26,13 @@ private void Check(double[] data, int minDistance, int[] expectedChangePoints)
3126
public void Tie01() => Check(new double[]
3227
{
3328
0, 0, 0, 0, 0, 100, 100, 100, 100
34-
}, 1, new[] {4});
29+
}, 1, new[] { 4 });
3530

3631
[Fact]
3732
public void Tie02() => Check(new double[]
3833
{
3934
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2
40-
}, 1, new[] {5, 11});
35+
}, 1, new[] { 5, 11 });
4136

4237
[Fact]
4338
public void Check_WhenTwoMinDistanceLessThanDataLength_ReturnEmptyArray() => Check(new double[]
@@ -47,7 +42,7 @@ public void Check_WhenTwoMinDistanceLessThanDataLength_ReturnEmptyArray() => Che
4742

4843
[Fact]
4944
[Trait(TraitConstants.Category, TraitConstants.Slow)]
50-
public void ArithmeticProgression() => Check(Enumerable.Range(1, 500).Select(it => (double) it).ToArray(), 10, new[]
45+
public void ArithmeticProgression() => Check(Enumerable.Range(1, 500).Select(it => (double)it).ToArray(), 10, new[]
5146
{
5247
9, 19, 29, 39, 49, 59, 69, 79, 89, 99, 109, 119, 129, 139, 149, 159, 169, 179, 189, 199, 209, 219, 229, 239,
5348
249, 259, 269, 279, 289, 299, 309, 319, 329, 339, 349, 359, 369, 379, 389, 399, 409, 419, 429, 439, 449,
@@ -91,11 +86,13 @@ public void GaussianStdDevProgression(int error, string stdDevValuesString)
9186
var indexes = detector.GetChangePointIndexes(data.ToArray(), 20);
9287
Check100(stdDevValues.Length, error, indexes);
9388
}
94-
95-
private static readonly IReadOnlyList<CpdTestData> ReferenceDataSet = CpdReferenceDataSet.Generate(new Random(42), 1);
89+
90+
private static readonly IReadOnlyList<CpdTestData> ReferenceDataSet =
91+
CpdReferenceDataSet.Generate(new Random(42), 1);
9692

9793
[UsedImplicitly]
98-
public static TheoryData<string> ReferenceDataSetNames = TheoryDataHelper.Create(ReferenceDataSet.Select(d => d.Name));
94+
public static TheoryData<string> ReferenceDataSetNames =
95+
TheoryDataHelper.Create(ReferenceDataSet.Select(d => d.Name));
9996

10097
[Theory]
10198
[MemberData(nameof(ReferenceDataSetNames))]

src/Perfolizer/Perfolizer.Tests/Mathematics/Cpd/TestDataSets/CpdBinomialMeanProgressionDataSet.cs renamed to src/Perfolizer/Perfolizer.SimulationTests/Cpd/TestDataSets/CpdBinomialMeanProgressionDataSet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Perfolizer.Mathematics.Distributions.ContinuousDistributions;
22
using Perfolizer.Mathematics.Randomization;
33

4-
namespace Perfolizer.Tests.Mathematics.Cpd.TestDataSets;
4+
namespace Perfolizer.SimulationTests.Cpd.TestDataSets;
55

66
public static class CpdBinomialMeanProgressionDataSet
77
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Perfolizer.Mathematics.Distributions.ContinuousDistributions;
22

3-
namespace Perfolizer.Tests.Mathematics.Cpd.TestDataSets;
3+
namespace Perfolizer.SimulationTests.Cpd.TestDataSets;
44

55
public static class CpdFrechetLocationProgressionDataSet
66
{

src/Perfolizer/Perfolizer.Tests/Mathematics/Cpd/TestDataSets/CpdGaussianMeanProgressionDataSet.cs renamed to src/Perfolizer/Perfolizer.SimulationTests/Cpd/TestDataSets/CpdGaussianMeanProgressionDataSet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Perfolizer.Mathematics.Distributions.ContinuousDistributions;
22

3-
namespace Perfolizer.Tests.Mathematics.Cpd.TestDataSets;
3+
namespace Perfolizer.SimulationTests.Cpd.TestDataSets;
44

55
public static class CpdGaussianMeanProgressionDataSet
66
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Perfolizer.Mathematics.Distributions.ContinuousDistributions;
22

3-
namespace Perfolizer.Tests.Mathematics.Cpd.TestDataSets;
3+
namespace Perfolizer.SimulationTests.Cpd.TestDataSets;
44

55
public static class CpdGumbelLocationProgressionDataSet
66
{

src/Perfolizer/Perfolizer.Tests/Mathematics/Cpd/TestDataSets/CpdRealDataSet.cs renamed to src/Perfolizer/Perfolizer.SimulationTests/Cpd/TestDataSets/CpdRealDataSet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Perfolizer.Tests.Mathematics.Cpd.TestDataSets;
1+
namespace Perfolizer.SimulationTests.Cpd.TestDataSets;
22

33
public static class CpdRealDataSet
44
{

src/Perfolizer/Perfolizer.Tests/Mathematics/Cpd/TestDataSets/CpdReferenceDataSet.cs renamed to src/Perfolizer/Perfolizer.SimulationTests/Cpd/TestDataSets/CpdReferenceDataSet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Perfolizer.Tests.Mathematics.Cpd.TestDataSets;
1+
namespace Perfolizer.SimulationTests.Cpd.TestDataSets;
22

33
public static class CpdReferenceDataSet
44
{

src/Perfolizer/Perfolizer.Tests/Mathematics/Cpd/TestDataSets/CpdTestData.cs renamed to src/Perfolizer/Perfolizer.SimulationTests/Cpd/TestDataSets/CpdTestData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Perfolizer.Tests.Mathematics.Cpd.TestDataSets;
1+
namespace Perfolizer.SimulationTests.Cpd.TestDataSets;
22

33
public class CpdTestData
44
{

0 commit comments

Comments
 (0)