Skip to content

Commit

Permalink
book scripts bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nchopin committed Dec 22, 2020
1 parent d0be592 commit e97fc56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions book/pmcmc/pmmh_lingauss.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
# State-space model
class ReparamLinGauss(kalman.LinearGauss):
def __init__(self, varX=1., varY=1., rho=0.):
sigmaX = np.sqrt(varX)
sigmaY = np.sqrt(varY)
sigmaX = np.sqrt(varX) if varX > 0 else 0.
sigmaY = np.sqrt(varY) if varY > 0 else 0.
sigma0 = sigmaX
# Note: We take X_0 ~ N(0, sigmaX^2) so that Gibbs step is tractable
kalman.LinearGauss.__init__(self, sigmaX=sigmaX, sigmaY=sigmaY, rho=rho,
Expand Down
2 changes: 1 addition & 1 deletion book/smc2/smc2_stochvol_leverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def qtiles(W, x):
fks['smc2_sv'] = ssp.SMC2(**fk_opts)

if __name__ == '__main__':
runs = particles.multiSMC(fk=fks, N=N, collect=[Moments(qtiles)],
runs = particles.multiSMC(fk=fks, N=N, collect=[Moments(mom_func=qtiles)],
verbose=True, nprocs=0, nruns=25)

# plots
Expand Down

0 comments on commit e97fc56

Please sign in to comment.