Commit cb67f3f
committed
Comprehensive bugfixes, correctness improvements, and code quality enhancements
Phase 1 - Critical correctness fixes:
- Fix InverseChiSquared CDF and InverseCDF formulas (was computing survival function)
- Fix NormalCopula CDF computing survival copula instead of copula
- Fix AMH, Frank, and Normal copula ValidateParameter returning non-null for valid params
- Fix MultipleGrubbsBeckTest static mutable fields (thread safety)
- Fix TimeSeries OneQuarter interval off by factor of 4
- Fix Search.Hunt always assuming descending order for OrderedPairedData overload
- Fix Bilinear UseSmartSearch copy-paste bug (X2LI never set)
- Fix KMeans++ initialization always using centroid[0]
- Fix SNIS weight filter wrong boolean operator (|| vs &&)
- Fix KNearestNeighbors multi-row GetNeighbors overwriting results
Phase 2 - High-priority fixes:
- Fix TimeSeries StartDate/EndDate crash on empty series
- Fix TimeSeries InterpolateMissingData index -1 crash
- Fix TimeSeries CumulativeSum NaN vs zero confusion
- Fix TimeSeries Divide silent infinity on zero divisor
- Fix TimeSeries StandardDeviation/Duration/SummaryPercentiles NaN handling
- Fix LogPearsonTypeIII Clone() dropping Base parameter
- Fix ChiSquared PDF overflow for large degrees of freedom (log-space)
- Fix Bernoulli Skewness/Kurtosis division by zero at p=0,1
- Fix Binomial InverseCDF off-by-one (never returns NumberOfTrials)
- Fix Rayleigh MoM wrong estimator
- Fix UniformDiscrete StandardDeviation wrong formula (continuous vs discrete)
- Fix GeneralizedBeta Mode 0/0 at Alpha=Beta=1
- Fix TruncatedNormal ValidateParameters reading property instead of parameter
- Fix EmpiricalDistribution/KernelDensity GetParameters NotImplementedException
- Fix Statistics HarmonicMean missing zero guard
- Fix GoodnessOfFit RSR using N instead of N-1
- Fix Histogram multiple issues (BinWidth=0, swapped args, empty guard)
- Fix MCMCDiagnostics GelmanRubin wrong denominator with warmup
- Fix GLM bounds inversion for negative intercept
- Fix HMC boundary enforcement (add momentum reflection)
- Fix NaiveBayes NaN for singleton classes
- Fix JenksCluster numerically unstable variance (Welford's algorithm)
- Fix ARWMH ProposalSigma division by zero when N=1
- Fix PowerFunction MinimumOfParameters/MaximumOfParameters wrong array length
- Fix LinearFunction/PowerFunction SetParameters not updating _normal
- Fix LinearFunction InverseFunction division by zero when Beta=0
- Fix MCMCSampler AcceptanceRates/ProgressChanged division by zero
- Fix DEMCz infinite loop when PopulationMatrix.Count=1
- Fix Autocorrelation/Correlation division by zero for constant series
- Fix HypothesisTests division-by-zero issues
- Fix BoxCox/GrubbsBeckTest non-positive values not guarded
- Remove VonMises Kurtosis dead computation
Phase 3 - Security (TimeSeriesDownload):
- Use static HttpClient instances (prevent socket exhaustion)
- Add CancellationToken support to all public async methods
- Validate redirect URLs against expected domains
- Remove UseProxy=false bypass
- Replace browser User-Agent with library identifier
- Replace Google.com connectivity check with target endpoint
- Sanitize GHCN station numbers
- Fix temp file leak on error
- Add explicit timeouts and retry logic with exponential backoff
- Use automatic gzip decompression
Phase 4 - Robustness:
- Fix Brent.Solve returning 0 instead of last iterate on failure
- Fix Series.SyncRoot returning unstable object
- Fix FrankCopula generator division by zero at Theta=0
- Fix TruncatedDistribution ValidateParameters exact float equality
- Fix Mixture EM convergence check placement
- Fix Deterministic/Binomial wrong parameter names in exceptions
- Fix JsonConverters silent zero-fill on malformed input
- Fix SafeProgressReporter MessageCount thread safety
- Fix ExtensionMethods.NextDoubles exact type check (use 'is')
- Fix TimeSeries FillMissingDates O(n^2) to O(n)
- Fix TimeSeries ResampleWithKNN index exceeding neighbor count
- Fix AdaptiveGaussKronrod wrong exception type
Phase 5 - Code quality:
- Remove useless catch/throw blocks (SobolSequence)
- Remove unused Microsoft.VisualBasic using (Gamma.cs)
- Fix CubicSpline XML doc saying "linear interpolation"
- Remove dead code (HypothesisTests, Search, YeoJohnson, DEMCzs)
- Fix KernelDensity typo GuassianKernel -> GaussianKernel
- Fix bitwise | vs logical || (Ordinate, Search)
- Remove unused NUnit references from test project
- Fix KNN XML doc "clusters" -> "nearest neighbors"
- Fix PowerFunction.Minimum setter no-op -> NotSupportedException
- Enable CS1591 (missing XML doc) warning and add missing XML docs
- Add XML docs for BinaryHeap, Network, SafeProgressReporter,
MCMCSampler, MultivariateNormal, KernelDensity, SimulatedAnnealing,
TimeSeries.FillMissingDates
Phase 6 - Unit tests with Python-verified reference values:
- Update InverseChiSquared tests for corrected CDF/InverseCDF
- Add InverseChiSquared CDF/InverseCDF roundtrip test
- Add NormalCopula CDF asymmetric inputs test
- Add Bernoulli boundary skewness/kurtosis test
- Add Binomial InverseCDF boundary test
- Add ChiSquared PDF large DoF test
- Add GeneralizedBeta Mode uniform case test
- Add Rayleigh MoM estimation test
- Add UniformDiscrete StandardDeviation test
- Add Statistics HarmonicMean zero value test
- Add KNN multi-row GetNeighbors test
- Add MCMCDiagnostics GelmanRubin warmup test
- Add HMC non-finite gradient crash test
- Fix MSTEST0037 analyzer warnings across test project1 parent cc58b63 commit cb67f3f
72 files changed
Lines changed: 1254 additions & 490 deletions
File tree
- Numerics
- Data
- Interpolation
- Support
- Paired Data
- Statistics
- Time Series
- Support
- Distributions
- Bivariate Copulas
- Multivariate
- Univariate
- Functions
- Machine Learning
- Supervised
- Support
- Unsupervised
- Mathematics
- Integration
- Optimization
- Dynamic
- Global
- Root Finding
- Special Functions
- Sampling
- MCMC
- Base
- Support
- Utilities
- Test_Numerics
- Data
- Statistics
- Time Series
- Distributions
- Bivariate Copulas
- Univariate
- Machine Learning/Supervised
- Sampling/MCMC
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
762 | 762 | | |
763 | 763 | | |
764 | 764 | | |
765 | | - | |
| 765 | + | |
766 | 766 | | |
767 | 767 | | |
768 | 768 | | |
| |||
816 | 816 | | |
817 | 817 | | |
818 | 818 | | |
819 | | - | |
| 819 | + | |
820 | 820 | | |
821 | 821 | | |
822 | 822 | | |
| |||
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
852 | | - | |
853 | 852 | | |
854 | 853 | | |
855 | 854 | | |
| |||
965 | 964 | | |
966 | 965 | | |
967 | 966 | | |
968 | | - | |
| 967 | + | |
969 | 968 | | |
970 | 969 | | |
971 | 970 | | |
| |||
998 | 997 | | |
999 | 998 | | |
1000 | 999 | | |
1001 | | - | |
1002 | 1000 | | |
1003 | 1001 | | |
1004 | 1002 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| 218 | + | |
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| |||
239 | 240 | | |
240 | 241 | | |
241 | 242 | | |
| 243 | + | |
242 | 244 | | |
243 | 245 | | |
244 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
834 | 834 | | |
835 | 835 | | |
836 | 836 | | |
837 | | - | |
| 837 | + | |
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
| |||
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
| 221 | + | |
220 | 222 | | |
221 | 223 | | |
222 | 224 | | |
| |||
322 | 324 | | |
323 | 325 | | |
324 | 326 | | |
| 327 | + | |
325 | 328 | | |
326 | 329 | | |
327 | 330 | | |
| |||
458 | 461 | | |
459 | 462 | | |
460 | 463 | | |
461 | | - | |
| 464 | + | |
462 | 465 | | |
463 | 466 | | |
464 | 467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| 86 | + | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| |||
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
| 149 | + | |
147 | 150 | | |
148 | 151 | | |
149 | 152 | | |
150 | 153 | | |
| 154 | + | |
151 | 155 | | |
152 | 156 | | |
153 | 157 | | |
| |||
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
| 184 | + | |
| 185 | + | |
180 | 186 | | |
181 | 187 | | |
182 | 188 | | |
| |||
329 | 335 | | |
330 | 336 | | |
331 | 337 | | |
332 | | - | |
333 | 338 | | |
334 | 339 | | |
335 | 340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | 176 | | |
181 | 177 | | |
182 | 178 | | |
| |||
187 | 183 | | |
188 | 184 | | |
189 | 185 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | 186 | | |
197 | | - | |
| 187 | + | |
198 | 188 | | |
199 | | - | |
| 189 | + | |
200 | 190 | | |
201 | 191 | | |
202 | 192 | | |
| |||
206 | 196 | | |
207 | 197 | | |
208 | 198 | | |
209 | | - | |
| 199 | + | |
210 | 200 | | |
211 | 201 | | |
212 | 202 | | |
213 | 203 | | |
214 | 204 | | |
215 | 205 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | 206 | | |
220 | 207 | | |
221 | 208 | | |
| |||
261 | 248 | | |
262 | 249 | | |
263 | 250 | | |
| 251 | + | |
264 | 252 | | |
265 | 253 | | |
266 | 254 | | |
| |||
0 commit comments