Skip to content

Commit

Permalink
check prior against non-transformed lprob
Browse files Browse the repository at this point in the history
  • Loading branch information
gboehl committed Jun 17, 2024
1 parent 497a449 commit 80b0a56
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions pydsge/estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,15 @@ def llike(parameters, par_fix, linear, verbose, seed):
linear_pa = linear

def lprob(
par, par_fix=par_fix, linear=None, verbose=verbose > 1, temp=1):
par, par_fix=par_fix, linear=None, verbose=verbose > 1, temp=1, use_prior_transform=use_prior_transform):

if use_prior_transform:
par = bptrans(par)
with warnings.catch_warnings(record=True):
warnings.filterwarnings("error")
try:
if use_prior_transform:
par = bptrans(par)
except Exception as err:
return -np.inf

lp = lprior(par)

Expand Down
2 changes: 1 addition & 1 deletion pydsge/mpile.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def prior_sampler(
if check_likelihood:
lprob_raw = serializer(self.lprob)
def check_func(p): return lprob_raw(
p, linear=None, verbose=verbose > 1)
p, linear=None, verbose=verbose > 1, use_prior_transform=False)
elif try_parameter:
check_func = serializer(self.set_par)

Expand Down

0 comments on commit 80b0a56

Please sign in to comment.