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

Calling prior in sampling with fixed parameters does not work #1378

Merged
merged 9 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pypesto/problem/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,15 @@ def normalize(self) -> None:
x_fixed_vals=self.x_fixed_vals,
)

# make prior aware of fixed parameters (for sampling etc.)
if self.x_priors is not None:
self.x_priors.update_from_problem(
dim_full=self.dim_full,
x_free_indices=self.x_free_indices,
x_fixed_indices=self.x_fixed_indices,
x_fixed_vals=self.x_fixed_vals,
)

# sanity checks
if len(self.x_scales) != self.dim_full:
raise AssertionError("x_scales dimension invalid.")
Expand Down
2 changes: 1 addition & 1 deletion pypesto/sample/emcee.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def initialize(
lb = self.problem.lb
ub = self.problem.ub

# parameter dimenstion
# parameter dimension
ndim = len(self.problem.x_free_indices)

def log_prob(x):
Expand Down
Loading