Skip to content

Commit

Permalink
V0.2.1 (#74)
Browse files Browse the repository at this point in the history
* Switch eig cals to eigh calls so we don't have issues with complex eigenvalues. Covariance is wrong right now anyways though I think

* fix the versioin of jax

* fix version of xspline

* change version to 0.2.1

---------

Co-authored-by: Alexander Hsu <owlx@uw.edu>
  • Loading branch information
zhengp0 and AHsu98 committed Jan 18, 2024
1 parent 7fd61b3 commit c24af43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "regmod"
version = "0.2.0"
version = "0.2.1"
description = "General regression models"
readme = "README.rst"
requires-python = ">=3.10"
Expand All @@ -16,10 +16,10 @@ dependencies = [
"numpy",
"scipy",
"pandas",
"xspline",
"xspline==0.0.7",
"msca",
"jaxlib",
"jax[cpu]",
"jax[cpu]==0.4.5",
"jaxlib==0.4.4",
]

[project.optional-dependencies]
Expand Down
5 changes: 3 additions & 2 deletions src/regmod/models/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ def get_vcov(self, coefs: ndarray) -> ndarray:
hessian = self.hessian(coefs)
if isinstance(hessian, Matrix):
hessian = hessian.to_numpy()
eig_vals, eig_vecs = np.linalg.eig(hessian)
#We probably don't want to be eigendecomposing
eig_vals, eig_vecs = np.linalg.eigh(hessian)
if np.isclose(eig_vals, 0.0).any():
raise ValueError("singular Hessian matrix, please add priors or "
"reduce number of variables")
Expand All @@ -136,7 +137,7 @@ def get_vcov(self, coefs: ndarray) -> ndarray:
jacobian2 = self.jacobian2(coefs)
if isinstance(jacobian2, Matrix):
jacobian2 = jacobian2.to_numpy()
eig_vals = np.linalg.eigvals(jacobian2)
eig_vals = np.linalg.eigvalsh(jacobian2)
if np.isclose(eig_vals, 0.0).any():
raise ValueError("singular Jacobian matrix, please add priors or "
"reduce number of variables")
Expand Down

0 comments on commit c24af43

Please sign in to comment.