-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Closed as not planned
Labels
33 - QuestionQuestion about NumPy usage or developmentQuestion about NumPy usage or development
Description
Describe the issue:
Hi, all!
I made a pull-request in statsmodels and my test does not work, where numpy version is --- 2.1.0.dev0. The error occurs in: np.linalg.solve(cm, resid_take)
.
The dimensions are as follows:
cm.shape (200, 5, 5) resid_take.shape (200, 5)
In the error:
ValueError: solve: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (m,m),(m,n)->(m,n) (size 200 is different from 5)
I've read here and other places but can't figure out how I need to change the arrays to make the code work in newer versions?
Reproduce the code example:
https://github.com/statsmodels/statsmodels/pull/9264
Error message:
statsmodels/regression/tests/test_processreg.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
statsmodels/regression/tests/test_processreg.py:160: in run_formula
f = preg.fit()
statsmodels/regression/process_regression.py:730: in fit
f = minimize(
/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/scipy/optimize/_minimize.py:722: in minimize
res = _minimize_powell(fun, x0, args, callback, bounds, **options)
/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/scipy/optimize/_optimize.py:3479: in _minimize_powell
fval = squeeze(func(x))
/opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/scipy/optimize/_optimize.py:526: in function_wrapper
fx = function(np.copy(x), *(wrapper_args + args))
statsmodels/regression/process_regression.py:731: in <lambda>
lambda x: -self.loglike(x),
statsmodels/regression/process_regression.py:563: in loglike
ls = np.linalg.solve(cm, resid_take)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
ValueError: solve: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (m,m),(m,n)->(m,n) (size 200 is different from 5)
Python and NumPy Versions:
Python 3.10.12
NumPy - 2.1.0
Runtime Environment:
No response
Context for the issue:
No response
Metadata
Metadata
Assignees
Labels
33 - QuestionQuestion about NumPy usage or developmentQuestion about NumPy usage or development