Skip to content

Fixed "Metropolis has no proposal_sd" bug #76

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

Conversation

borisaqua
Copy link
Contributor

In case when proposal_distribution is 'Prior', proposal_sd is never set, leading to the following error:

Warning, unable to save state.
Error message:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pymc/Model.py", line 599, in save_state
self.db.savestate(self.get_state())
File "/usr/local/lib/python2.7/dist-packages/pymc/MCMC.py", line 344, in get_state
state['step_methods'][sm._id] = sm.current_state().copy()
File "/usr/local/lib/python2.7/dist-packages/pymc/StepMethods.py", line 293, in current_state
state[s] = getattr(self, s)
AttributeError: 'Metropolis' object has no attribute 'proposal_sd'

In case when proposal_distribution is 'Prior', proposal_sd was never
set, that would result in the following error:

Warning, unable to save state.
Error message:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pymc/Model.py", line 599, in save_state
    self.db.savestate(self.get_state())
  File "/usr/local/lib/python2.7/dist-packages/pymc/MCMC.py", line 344, in get_state
    state['step_methods'][sm._id] = sm.current_state().copy()
  File "/usr/local/lib/python2.7/dist-packages/pymc/StepMethods.py", line 293, in current_state
    state[s] = getattr(self, s)
AttributeError: 'Metropolis' object has no attribute 'proposal_sd'

Now set proposal_sd = None by default.
@fonnesbeck
Copy link
Member

Thanks very much. Fixed this in 1eaa89c

@fonnesbeck fonnesbeck closed this Dec 22, 2011
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

Successfully merging this pull request may close these issues.

2 participants