Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expected breaks on functions that involve manipulation of arrays #1488

Open
sbenthall opened this issue Aug 16, 2024 · 0 comments
Open

expected breaks on functions that involve manipulation of arrays #1488

sbenthall opened this issue Aug 16, 2024 · 0 comments
Assignees

Comments

@sbenthall
Copy link
Contributor

from HARK.distribution import expected, Normal, DiscreteDistributionLabeled
import numpy as np

gamma = DiscreteDistributionLabeled.from_unlabeled(
    Normal(mu= 0, sigma = 1).discretize(**{"N" : 7}), var_names=["gamma"]
)

expected(func=lambda x: x['gamma'] * np.array([1,2]), dist=gamma)

gets this error:

ValueError: operands could not be broadcast together with shapes (7,) (2,) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants