Jeremy Sanders
unread,Feb 27, 2009, 5:23:45 AM2/27/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to PyMC
Hi - I tried to load back my chain and it complained about the format
of the text:
File "/home/jss/lib64/python2.5/pymc/database/txt.py", line 154, in
load
db._state_ = eval(file.read())
File "<string>", line 19
0.02595237, 0.02296866, 0.02045975]), 'concentration':
19.336739013585699, 'logPouter':-10.823919082349803}, 'step_methods':
{'Metropolis_r200': {'adaptive_scale_factor': 1.0,
'proposal_distribution': 'Normal', 'accepted': 128.0, 'rejected':
872.0, 'proposal_sd': 1.1210113815992098}, 'Metropolis_concentration':
{'adaptive_scale_factor': 1.0, 'proposal_distribution':'Normal',
'accepted': 354.0, 'rejected': 646.0, 'proposal_sd':
5.9827190743764662}, 'Metropolis_logPouter': {'adaptive_scale_factor':
1.0, 'proposal_distribution': 'Normal', 'accepted': 24.0, 'rejected':
976.0, 'proposal_sd': 10.889470505486667}, 'AdaptiveMetropolis_sb':
{'adaptive_scale_factor': 1.0, 'C': array([[ 0.03189851, 0. ,
0. , ..., 0. ,
^
SyntaxError: invalid syntax
It looks to me that the data are being stored using repr on numpy
arrays and loaded back with eval. Unfortunately it looks like numpy
doesn't store a full string representation of the array with repr, but
a truncated one. Surely this is a numpy bug?
In [35]: repr(numpy.arange(10000))
Out[35]: 'array([ 0, 1, 2, ..., 9997, 9998, 9999])'