hoppMCMC 2.2.0__tar.gz → 2.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/NEWS.txt +1 -2
  2. {hoppmcmc-2.2.0/src/hoppMCMC.egg-info → hoppmcmc-2.2.1}/PKG-INFO +1 -1
  3. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/pyproject.toml +1 -1
  4. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/setup.cfg +1 -1
  5. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/src/hoppMCMC/__init__.py +1 -1
  6. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1/src/hoppMCMC.egg-info}/PKG-INFO +1 -1
  7. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/src/inferFun/__init__.py +46 -0
  8. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/LICENSE +0 -0
  9. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/MANIFEST.in +0 -0
  10. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/README.txt +0 -0
  11. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/setup.py +0 -0
  12. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/src/hoppMCMC/doc/hoppMCMC_manual.pdf +0 -0
  13. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/src/hoppMCMC/examples/example1.py +0 -0
  14. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/src/hoppMCMC/examples/example2.py +0 -0
  15. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/src/hoppMCMC/examples/example3.py +0 -0
  16. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/src/hoppMCMC/examples/example4.py +0 -0
  17. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/src/hoppMCMC/examples/example5.py +0 -0
  18. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/src/hoppMCMC.egg-info/SOURCES.txt +0 -0
  19. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/src/hoppMCMC.egg-info/dependency_links.txt +0 -0
  20. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/src/hoppMCMC.egg-info/not-zip-safe +0 -0
  21. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/src/hoppMCMC.egg-info/requires.txt +0 -0
  22. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/src/hoppMCMC.egg-info/top_level.txt +0 -0
  23. {hoppmcmc-2.2.0 → hoppmcmc-2.2.1}/src/myMPI/__init__.py +0 -0
@@ -1,14 +1,13 @@
1
1
  News
2
2
  ====
3
3
 
4
- 2.2.0
4
+ 2.2.1
5
5
  -----
6
6
 
7
7
  *Release date: 13-Jul-2026*
8
8
 
9
9
  inferFun is now updated to include ABCModel and inferABCModels as the main ABC-SMC inference tools
10
10
 
11
- 2.1.0
12
11
  1.2.1
13
12
  1.2
14
13
  1.1 *13-Sep-2018*
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hoppMCMC
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Summary: An adaptive basin-hopping Markov-chain Monte Carlo algorithm for Bayesian optimisation
5
5
  Author: Kamil Erguler
6
6
  Author-email: Kamil Erguler <kerguler@gmail.com>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hoppMCMC"
7
- version = "2.2.0"
7
+ version = "2.2.1"
8
8
  description = "An adaptive basin-hopping Markov-chain Monte Carlo algorithm for Bayesian optimisation"
9
9
  authors = [{ name = "Kamil Erguler", email = "kerguler@gmail.com" }]
10
10
  license = { text = "GPLv3" }
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = hoppMCMC
3
- version = 2.2.0
3
+ version = 2.2.1
4
4
  description = Adaptive basin-hopping MCMC and ABC inference with MPI support
5
5
  author = Kamil Erguler
6
6
  author_email = k.erguler@cyi.ac.cy
@@ -6,7 +6,7 @@ This is the python (v2.7) implementation of the hoppMCMC algorithm aiming to ide
6
6
 
7
7
  """
8
8
 
9
- __version__ = '2.2.0'
9
+ __version__ = '2.2.1'
10
10
 
11
11
  import os
12
12
  import sys
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hoppMCMC
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Summary: An adaptive basin-hopping Markov-chain Monte Carlo algorithm for Bayesian optimisation
5
5
  Author: Kamil Erguler
6
6
  Author-email: Kamil Erguler <kerguler@gmail.com>
@@ -488,6 +488,52 @@ class inferABCModels:
488
488
  # Add small jitter to avoid singular covariance problems.
489
489
  kernel = kernel + numpy.eye(kernel.shape[0]) * self.jitter
490
490
 
491
+ eigvals, eigvecs = numpy.linalg.eigh(kernel)
492
+ if numpy.any(eigvals <= 0):
493
+ raise ValueError(
494
+ f"Kernel is not positive definite for model {model_id} "
495
+ f"({self.model_names[model_id]}), even after jitter. "
496
+ f"Eigenvalues={eigvals}\nKernel:\n{kernel}"
497
+ )
498
+
499
+ condition_number = eigvals[-1] / eigvals[0]
500
+ if condition_number > 1e10 and self.verbose:
501
+ smallest = numpy.argmin(eigvals)
502
+ bad_direction = eigvecs[:, smallest]
503
+ culprit_order = numpy.argsort(numpy.abs(bad_direction))[::-1]
504
+ print(
505
+ f"Warning: near-singular kernel for model {model_id} "
506
+ f"({self.model_names[model_id]}). "
507
+ f"condition_number={condition_number:g}, "
508
+ f"eigenvalues={eigvals}",
509
+ flush=True
510
+ )
511
+ print(" Dominant dimensions in smallest-eigenvalue direction:", flush=True)
512
+ for k in culprit_order:
513
+ print(
514
+ f" kernel dim {k}, parameter index {inferpar[k]}, "
515
+ f"loading={bad_direction[k]:g}, "
516
+ f"variance={kernel[k, k]:g}",
517
+ flush=True
518
+ )
519
+
520
+ sd = numpy.sqrt(numpy.diag(kernel))
521
+ corr = kernel / numpy.outer(sd, sd)
522
+ if self.verbose:
523
+ print(" correlation matrix:", flush=True)
524
+ print(corr, flush=True)
525
+
526
+ high = numpy.where(numpy.abs(corr) > 0.98)
527
+
528
+ for a, b in zip(high[0], high[1]):
529
+ if a < b:
530
+ print(
531
+ f" high correlation: kernel dims {a}-{b}, "
532
+ f"parameter indices {inferpar[a]}-{inferpar[b]}, "
533
+ f"corr={corr[a, b]:g}",
534
+ flush=True
535
+ )
536
+
491
537
  return multivariate_normal.logpdf(x_inf, mean=mean_inf, cov=kernel, allow_singular=False)
492
538
 
493
539
  def calc_weights(self, mat_new, mat_old, kernels):
File without changes
File without changes
File without changes
File without changes
File without changes