Skip to content

expected breaks on functions that involve manipulation of arrays #1488

Open
@sbenthall

Description

@sbenthall
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,) 

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Not started

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions