hddm tutorial

1,165 views
Skip to first unread message

Qiang Shen

unread,
May 5, 2014, 11:14:55 AM5/5/14
to hddm-...@googlegroups.com
Dear Thomas,

     I start to have a try of the hddm package one by one following the tutorial. For the tutorial, I should cd the current directory into the directory where contains the needed files like hddm-develop/hddm/examples, right? Or the code can't automatically find the example files like simple_difficulty.csv,cavanagh_theta_nn.csv (I can't find hddm_demo.csv, where I can download?),right? But I can load the data correctly using hddm.load_csv command once it's in the correct directory.
   
   But when I start to try the following code from the quick-start  model = hddm.HDDM(data, depends_on={'v':'difficulty'})
--------------------------------------------------------------------------------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-52-442fbac9eed4> in <module>()
----> 1 model = hddm.HDDM(data, depends_on={'v':'difficulty'})
TypeError: Argument 'x' has incorrect type (expected numpy.ndarray, got Series)
--------------------------------------------------------------------------------------------------------------------------------------------------
                                                                   or from tutorial:     m = hddm.HDDM(data)
--------------------------------------------------------------------------------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-48-ff1966694241> in <module>()
----> 1 m = hddm.HDDM(data)
TypeError: Argument 'x' has incorrect type (expected numpy.ndarray, got Series)
--------------------------------------------------------------------------------------------------------------------------------------------------
   both are not work properly. 
    I tried help(hddm.HDDM), it seems OK.
  
    I can't plot for RT distribution using the following code from In[4]: as well. 
 
         for i, subj_data in data.groupby('subj_idx'): 
         ax.hist(subj_data.rt, bins=20, histtype='step')

--------------------------------------------------------------------------------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-45-3ff08f9d5cbe> in <module>()
----> 1 for i, subj_data in data.groupby('subj_idx'):
      2     ax.hist(subj_data.rt, bins=20, histtype='step')
      3 
--------------------------------------------------------------------------------------------------------------------------------------------------

Do you know why, that means I didn't install hddm in a correct manner?





best wishes,

Qiang

     


Thomas Wiecki

unread,
May 5, 2014, 11:18:00 AM5/5/14
to hddm-...@googlegroups.com
Hi Qiang,

The traceback is not complete. Can you paste the full error message?

Thomas


--
You received this message because you are subscribed to the Google Groups "hddm-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hddm-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Thomas Wiecki
PhD candidate, Brown University
Quantitative Researcher, Quantopian Inc, Boston

Qiang Shen

unread,
May 5, 2014, 10:28:37 PM5/5/14
to hddm-...@googlegroups.com
Hi Thomas,

   Here it is.
data = hddm.load_csv('simple_difficulty.csv')

model = hddm.HDDM(data, depends_on={'v':'difficulty'})
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-20-442fbac9eed4> in <module>()
----> 1 model = hddm.HDDM(data, depends_on={'v':'difficulty'})

/Applications/anaconda/lib/python2.7/site-packages/hddm/models/hddm_info.pyc in __init__(self, *args, **kwargs)
    111         self.is_informative = kwargs.pop('informative', True)
    112 
--> 113         super(HDDM, self).__init__(*args, **kwargs)
    114 
    115     def _create_stochastic_knodes(self, include):

/Applications/anaconda/lib/python2.7/site-packages/hddm/models/base.pyc in __init__(self, data, bias, include, wiener_params, p_outlier, **kwargs)
    687         self.wfpt_class = hddm.likelihoods.generate_wfpt_stochastic_class(wp, cdf_range=self.cdf_range)
    688 
--> 689         super(HDDMBase, self).__init__(data, **kwargs)
    690 
    691     def __getstate__(self):

/Applications/anaconda/lib/python2.7/site-packages/hddm/models/base.pyc in __init__(self, data, **kwargs)
     38         self.std_depends = kwargs.pop('std_depends', False)
     39 
---> 40         super(AccumulatorModel, self).__init__(data, **kwargs)
     41 
     42 

/Applications/anaconda/lib/python2.7/site-packages/kabuki/hierarchical.pyc in __init__(self, data, is_group_model, depends_on, trace_subjs, plot_subjs, plot_var, group_only_nodes)
    345         self.db = None
    346 
--> 347         self._setup_model()
    348 
    349     def _setup_model(self):

/Applications/anaconda/lib/python2.7/site-packages/kabuki/hierarchical.pyc in _setup_model(self)
    356 
    357         # constructs pymc nodes etc and connects them appropriately
--> 358         self.create_model()
    359 
    360     def __getstate__(self):

/Applications/anaconda/lib/python2.7/site-packages/kabuki/hierarchical.pyc in create_model(self, max_retries)
    426         for tries in range(max_retries):
    427             try:
--> 428                 _create()
    429             except (pm.ZeroProbability, ValueError):
    430                 continue

/Applications/anaconda/lib/python2.7/site-packages/kabuki/hierarchical.pyc in _create()
    422         def _create():
    423             for knode in self.knodes:
--> 424                 knode.create()
    425 
    426         for tries in range(max_retries):

/Applications/anaconda/lib/python2.7/site-packages/kabuki/hierarchical.pyc in create(self)
    165                 kwargs['doc'] = node_name
    166 
--> 167             node = self.create_node(node_name, kwargs, grouped_data)
    168 
    169             if node is not None:

/Applications/anaconda/lib/python2.7/site-packages/kabuki/hierarchical.pyc in create_node(self, node_name, kwargs, data)
    173     def create_node(self, node_name, kwargs, data):
    174         #actually create the node
--> 175         return self.pymc_node(name=node_name, **kwargs)
    176 
    177     def create_tag_and_subj_idx(self, cols, uniq_elem):

/Applications/anaconda/lib/python2.7/site-packages/pymc/distributions.pyc in __init__(self, *args, **kwds)
    269                 random = debug_wrapper(random)
    270             else:
--> 271                 Stochastic.__init__(self, logp=logp, random=random, logp_partial_gradients = logp_partial_gradients, dtype=dtype, **arg_dict_out)
    272 
    273     new_class.__name__ = name

/Applications/anaconda/lib/python2.7/site-packages/pymc/PyMCObjects.pyc in __init__(self, logp, doc, name, parents, random, trace, value, dtype, rseed, observed, cache_depth, plot, verbose, isdata, check_logp, logp_partial_gradients)
    746                           dtype=dtype,
    747                           plot=plot,
--> 748                           verbose=verbose)
    749 
    750         # self._logp.force_compute()

/Applications/anaconda/lib/python2.7/site-packages/pymc/Node.pyc in __init__(self, doc, name, parents, cache_depth, trace, dtype, plot, verbose)
    214         self.extended_children = set()
    215 
--> 216         Node.__init__(self, doc, name, parents, cache_depth, verbose=verbose)
    217 
    218         if self.dtype is None:

/Applications/anaconda/lib/python2.7/site-packages/pymc/Node.pyc in __init__(self, doc, name, parents, cache_depth, verbose)
    125 
    126         # Initialize
--> 127         self.parents = parents
    128 
    129     def _get_parents(self):

/Applications/anaconda/lib/python2.7/site-packages/pymc/Node.pyc in _set_parents(self, new_parents)
    148 
    149         # Get new lazy function
--> 150         self.gen_lazy_function()
    151 
    152     parents = property(

/Applications/anaconda/lib/python2.7/site-packages/pymc/PyMCObjects.pyc in gen_lazy_function(self)
    795                                   [self]),
    796                                   cache_depth=self._cache_depth)
--> 797         self._logp.force_compute()
    798 
    799         self._logp_partial_gradients = {}

/Applications/anaconda/lib/python2.7/site-packages/pymc/LazyFunction.so in pymc.LazyFunction.LazyFunction.force_compute (pymc/LazyFunction.c:2409)()

/Applications/anaconda/lib/python2.7/site-packages/pymc/distributions.pyc in wrapper(**kwds)
   2766     def wrapper(**kwds):
   2767         value = kwds.pop('value')
-> 2768         return f(value, **kwds)
   2769 
   2770     if arguments is None:

/Applications/anaconda/lib/python2.7/site-packages/hddm/likelihoods.pyc in wfpt_like(x, v, sv, a, z, sz, t, st, p_outlier)
     50     #create likelihood function
     51     def wfpt_like(x, v, sv, a, z, sz, t, st, p_outlier=0):
---> 52         return hddm.wfpt.wiener_like(x['rt'], v, sv, a, z, sz, t, st, p_outlier=p_outlier, **wp)
     53 
     54 

TypeError: Argument 'x' has incorrect type (expected numpy.ndarray, got Series)

data = hddm.load_csv('simple_difficulty.csv')

model = hddm.HDDM(data, depends_on={'v':'difficulty'})
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-22-442fbac9eed4> in <module>()
----> 1 model = hddm.HDDM(data, depends_on={'v':'difficulty'})

/Applications/anaconda/lib/python2.7/site-packages/hddm/models/hddm_info.pyc in __init__(self, *args, **kwargs)
    111         self.is_informative = kwargs.pop('informative', True)
    112 
--> 113         super(HDDM, self).__init__(*args, **kwargs)
    114 
    115     def _create_stochastic_knodes(self, include):

/Applications/anaconda/lib/python2.7/site-packages/hddm/models/base.pyc in __init__(self, data, bias, include, wiener_params, p_outlier, **kwargs)
    687         self.wfpt_class = hddm.likelihoods.generate_wfpt_stochastic_class(wp, cdf_range=self.cdf_range)
    688 
--> 689         super(HDDMBase, self).__init__(data, **kwargs)
    690 
    691     def __getstate__(self):

/Applications/anaconda/lib/python2.7/site-packages/hddm/models/base.pyc in __init__(self, data, **kwargs)
     38         self.std_depends = kwargs.pop('std_depends', False)
     39 
---> 40         super(AccumulatorModel, self).__init__(data, **kwargs)
     41 
     42 

/Applications/anaconda/lib/python2.7/site-packages/kabuki/hierarchical.pyc in __init__(self, data, is_group_model, depends_on, trace_subjs, plot_subjs, plot_var, group_only_nodes)
    345         self.db = None
    346 
--> 347         self._setup_model()
    348 
    349     def _setup_model(self):

/Applications/anaconda/lib/python2.7/site-packages/kabuki/hierarchical.pyc in _setup_model(self)
    356 
    357         # constructs pymc nodes etc and connects them appropriately
--> 358         self.create_model()
    359 
    360     def __getstate__(self):

/Applications/anaconda/lib/python2.7/site-packages/kabuki/hierarchical.pyc in create_model(self, max_retries)
    426         for tries in range(max_retries):
    427             try:
--> 428                 _create()
    429             except (pm.ZeroProbability, ValueError):
    430                 continue

/Applications/anaconda/lib/python2.7/site-packages/kabuki/hierarchical.pyc in _create()
    422         def _create():
    423             for knode in self.knodes:
--> 424                 knode.create()
    425 
    426         for tries in range(max_retries):

/Applications/anaconda/lib/python2.7/site-packages/kabuki/hierarchical.pyc in create(self)
    165                 kwargs['doc'] = node_name
    166 
--> 167             node = self.create_node(node_name, kwargs, grouped_data)
    168 
    169             if node is not None:

/Applications/anaconda/lib/python2.7/site-packages/kabuki/hierarchical.pyc in create_node(self, node_name, kwargs, data)
    173     def create_node(self, node_name, kwargs, data):
    174         #actually create the node
--> 175         return self.pymc_node(name=node_name, **kwargs)
    176 
    177     def create_tag_and_subj_idx(self, cols, uniq_elem):

/Applications/anaconda/lib/python2.7/site-packages/pymc/distributions.pyc in __init__(self, *args, **kwds)
    269                 random = debug_wrapper(random)
    270             else:
--> 271                 Stochastic.__init__(self, logp=logp, random=random, logp_partial_gradients = logp_partial_gradients, dtype=dtype, **arg_dict_out)
    272 
    273     new_class.__name__ = name

/Applications/anaconda/lib/python2.7/site-packages/pymc/PyMCObjects.pyc in __init__(self, logp, doc, name, parents, random, trace, value, dtype, rseed, observed, cache_depth, plot, verbose, isdata, check_logp, logp_partial_gradients)
    746                           dtype=dtype,
    747                           plot=plot,
--> 748                           verbose=verbose)
    749 
    750         # self._logp.force_compute()

/Applications/anaconda/lib/python2.7/site-packages/pymc/Node.pyc in __init__(self, doc, name, parents, cache_depth, trace, dtype, plot, verbose)
    214         self.extended_children = set()
    215 
--> 216         Node.__init__(self, doc, name, parents, cache_depth, verbose=verbose)
    217 
    218         if self.dtype is None:

/Applications/anaconda/lib/python2.7/site-packages/pymc/Node.pyc in __init__(self, doc, name, parents, cache_depth, verbose)
    125 
    126         # Initialize
--> 127         self.parents = parents
    128 
    129     def _get_parents(self):

/Applications/anaconda/lib/python2.7/site-packages/pymc/Node.pyc in _set_parents(self, new_parents)
    148 
    149         # Get new lazy function
--> 150         self.gen_lazy_function()
    151 
    152     parents = property(

/Applications/anaconda/lib/python2.7/site-packages/pymc/PyMCObjects.pyc in gen_lazy_function(self)
    795                                   [self]),
    796                                   cache_depth=self._cache_depth)
--> 797         self._logp.force_compute()
    798 
    799         self._logp_partial_gradients = {}

/Applications/anaconda/lib/python2.7/site-packages/pymc/LazyFunction.so in pymc.LazyFunction.LazyFunction.force_compute (pymc/LazyFunction.c:2409)()

/Applications/anaconda/lib/python2.7/site-packages/pymc/distributions.pyc in wrapper(**kwds)
   2766     def wrapper(**kwds):
   2767         value = kwds.pop('value')
-> 2768         return f(value, **kwds)
   2769 
   2770     if arguments is None:

/Applications/anaconda/lib/python2.7/site-packages/hddm/likelihoods.pyc in wfpt_like(x, v, sv, a, z, sz, t, st, p_outlier)
     50     #create likelihood function
     51     def wfpt_like(x, v, sv, a, z, sz, t, st, p_outlier=0):
---> 52         return hddm.wfpt.wiener_like(x['rt'], v, sv, a, z, sz, t, st, p_outlier=p_outlier, **wp)
     53 
     54 

TypeError: Argument 'x' has incorrect type (expected numpy.ndarray, got Series)

Qiang Shen

unread,
May 6, 2014, 8:25:50 AM5/6/14
to hddm-...@googlegroups.com
Hi Thomas,

     I have figured out the error after "model = hddm.HDDM(data, depends_on={'v':'difficulty'})". I just updated the software using the command you mentioned in the mailing list, then it's solved! 
         pip install -U pymc
         pip install -U kabuki
         pip install -U hddm.


      Below are the steps I tried for the HDDM instalment on Mac.
       1. install anaconda
       2. Following instruction, I typed in the terminal the following command.
          conda install -c pymc pymc   
          conda install -c twiecki hddm    
      After this, the Numpy version is 1.7.1, so I tried "conda install -c pymc pymc" again to link the Numpy to version 1.8.
       3. Then I typed
           pip install -U pymc
           pip install -U kabuki
           pip install -U hddm

Thomas Wiecki

unread,
May 6, 2014, 8:32:02 AM5/6/14
to hddm-...@googlegroups.com
Hi Qiang,

Glad that it's working and thanks for letting us know.

I think there is a problem with the conda package for OSX which we'll have to fix.

Thomas

Qiang Shen

unread,
May 7, 2014, 4:51:44 AM5/7/14
to hddm-...@googlegroups.com
Hi Thomas,

     Thanks, I proceed to try the HDDM, below are the problem I came across so far, do you know why? Does that mean the software is still not correctly installed on my OSX?
 


1. for i, subj_data in data.groupby('subj_idx'):
    ax.hist(subj_data.rt, bins=20, histtype='step')
    
Traceback (most recent call last):

  File "<ipython-input-3-3ff08f9d5cbe>", line 2, in <module>
    ax.hist(subj_data.rt, bins=20, histtype='step')

  File "/Applications/anaconda/lib/python2.7/site-packages/matplotlib/axes.py", line 8249, in hist
    if isinstance(x, np.ndarray) or not iterable(x[0]):

  File "/Applications/anaconda/lib/python2.7/site-packages/pandas/core/series.py", line 491, in __getitem__
    result = self.index.get_value(self, key)

  File "/Applications/anaconda/lib/python2.7/site-packages/pandas/core/index.py", line 1032, in get_value
    return self._engine.get_value(s, k)

  File "index.pyx", line 97, in pandas.index.IndexEngine.get_value (pandas/index.c:2661)

  File "index.pyx", line 105, in pandas.index.IndexEngine.get_value (pandas/index.c:2476)

  File "index.pyx", line 149, in pandas.index.IndexEngine.get_loc (pandas/index.c:3215)

  File "hashtable.pyx", line 382, in pandas.hashtable.Int64HashTable.get_item (pandas/hashtable.c:6942)

  File "hashtable.pyx", line 388, in pandas.hashtable.Int64HashTable.get_item (pandas/hashtable.c:6883)

KeyError: 0




2.hddm.analyze.plot_posterior_nodes([v_WL, v_LL, v_WW])
<matplotlib.figure.Figure at 0x10ef799d0>
Traceback (most recent call last):

  File "<ipython-input-13-1eee4f977a76>", line 1, in <module>
    hddm.analyze.plot_posterior_nodes([v_WL, v_LL, v_WW])

  File "/Applications/anaconda/lib/python2.7/site-packages/kabuki/analyze.py", line 34, in plot_posterior_nodes
    lb = min([min(node.trace()[:]) for node in nodes])

AttributeError: 'float' object has no attribute 'trace'


3.
m_no_outlier = hddm.HDDMInfo(outlier_data)

m_no_outlier = hddm.HDDMInfo(outlier_data)
Traceback (most recent call last):

  File "<ipython-input-25-59a817d0b4fc>", line 1, in <module>
    m_no_outlier = hddm.HDDMInfo(outlier_data)

AttributeError: 'module' object has no attribute 'HDDMInfo'

Thomas Wiecki

unread,
May 7, 2014, 10:26:21 AM5/7/14
to hddm-...@googlegroups.com
Hi Qiang,

Seems like the notebook needs to be updated. Are you using the ipython notebook directly or the website?

Thomas

Qiang Shen

unread,
May 7, 2014, 11:14:57 PM5/7/14
to hddm-...@googlegroups.com
Dear Thomas,

     Thanks for your reply. The ipython notebook of Anaconda can't be started on my computer and it seem not have a good solution for this.  So I tried both ipython-qtconsole and  spyder of Anaconda to run the analysis,in general it works smoothly but both can't run the commands I mentioned correctly. Below are the information for my current version of the software, ipython is already the most updated version.


Python 2.7.6 |Anaconda 1.9.2 (x86_64)| (default, Jan 10 2014, 11:23:15) 
Type "copyright", "credits" or "license" for more information.

IPython 2.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
%guiref   -> A brief reference about the graphical user interface.




 best wishes,

Qiang 

Qiang Shen

unread,
May 10, 2014, 5:31:33 AM5/10/14
to hddm-...@googlegroups.com
Dear Thomas,

 Do you have any suggestions for the error I mentioned? or it might be better to use Windows for this analysis? Thanks.

best wishes,

Qiang
...

Thomas Wiecki

unread,
May 11, 2014, 8:58:15 AM5/11/14
to hddm-...@googlegroups.com
Hi Qiang,

Windows should make not difference.

Still not sure you have the right versions, can you do:

print pymc.__version__
print kabuki.__version__
print hddm.__version__

After imporiting each module?


--
You received this message because you are subscribed to the Google Groups "hddm-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hddm-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Qiang Shen

unread,
May 12, 2014, 12:05:00 AM5/12/14
to hddm-...@googlegroups.com
Hi Thomas,

 Thanks for your reply, initially I haven't import kabuki because it's not mentioned in the tutorial, but after import of kabuki,it's still not work for
for i, subj_data in data.groupby('subj_idx'):
    ax.hist(subj_data.rt, bins=20, histtype='step')

Here is the information.

print pymc.__version__
print kabuki.__version__
print hddm.__version__

2.3.2
0.5.4
0.5.3

Traceback (most recent call last):

  File "<ipython-input-14-c2c318cf1f63>", line 4, in <module>
    ax.hist(subj_data.rt, bins=20, histtype='step')

  File "/Applications/anaconda/lib/python2.7/site-packages/matplotlib/axes.py", line 8249, in hist
    if isinstance(x, np.ndarray) or not iterable(x[0]):

  File "/Applications/anaconda/lib/python2.7/site-packages/pandas/core/series.py", line 491, in __getitem__
    result = self.index.get_value(self, key)

  File "/Applications/anaconda/lib/python2.7/site-packages/pandas/core/index.py", line 1032, in get_value
    return self._engine.get_value(s, k)

  File "index.pyx", line 97, in pandas.index.IndexEngine.get_value (pandas/index.c:2661)

  File "index.pyx", line 105, in pandas.index.IndexEngine.get_value (pandas/index.c:2476)

  File "index.pyx", line 149, in pandas.index.IndexEngine.get_loc (pandas/index.c:3215)

  File "hashtable.pyx", line 382, in pandas.hashtable.Int64HashTable.get_item (pandas/hashtable.c:6942)

  File "hashtable.pyx", line 388, in pandas.hashtable.Int64HashTable.get_item (pandas/hashtable.c:6883)

KeyError: 0


In [15]:

Thomas Wiecki

unread,
May 12, 2014, 1:07:33 PM5/12/14
to hddm-...@googlegroups.com
Or were you using hddm_demo.ipynb from the examples directory?

Let me know if that fixes your problems.

Thomas

Qiang Shen

unread,
May 13, 2014, 9:45:56 PM5/13/14
to hddm-...@googlegroups.com
Dear Thomas,

    It's so excited that now it works for the following code and I have successfully plotted the attached graph, I'll check whether the following scripts also work on my side. Thanks a lot!
for i, subj_data in data.groupby('subj_idx'):
    subj_data.rt.hist(bins=20, histtype='step', ax=ax)

best,

Qiang 
<ipython-input-48-ff1966694241&
...
hddm_demo_fig_00.pdf

Qiang Shen

unread,
May 14, 2014, 12:45:13 AM5/14/14
to hddm-...@googlegroups.com
Dear Thomas,

I proceed to test the scripts and came across the 2nd error I mentioned to you last time again,  see below for details. For the rest of content in the link you sent me, it all works!

hddm.analyze.plot_posterior_nodes([v_WL, v_LL, v_WW])


hddm.analyze.plot_posterior_nodes([v_WL, v_LL, v_WW])
<matplotlib.figure.Figure at 0x10e598590>
Traceback (most recent call last):

  File "<ipython-input-58-1eee4f977a76>", line 1, in <module>
...

Thomas Wiecki

unread,
May 15, 2014, 7:36:37 PM5/15/14
to hddm-...@googlegroups.com
Sorry about that, should be fixed now. Let me know if there are any other problems.

Thomas


--
You received this message because you are subscribed to the Google Groups "hddm-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hddm-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Qiang Shen

unread,
May 17, 2014, 4:03:36 AM5/17/14
to hddm-...@googlegroups.com
Thanks! Thomas.

Qiang Shen

unread,
May 21, 2014, 3:37:25 AM5/21/14
to hddm-...@googlegroups.com
Hi Thomas,

    In the tutorial, "a_var" should be "a_std",that’s the reasons why it was not listed in the table which should be 4 rows * 8 columns. and also for the posterior plot. In addition, all the plots seem not correctly presented in current version of the tutorial. 

     For the outlier removal, it is possible to apply it in the with-subject situation? I tested, it seems not work for hddm.HDDMRegressor function. Then how we can make it work in such situation, we have to remove the outliers in advance?

best wishes,

Qiang 

...

Thomas Wiecki

unread,
Jun 1, 2014, 8:05:37 AM6/1/14
to hddm-...@googlegroups.com
Hi Qiang,

Thanks, I fixed the issues in the tutorial you mentioned.

HDDMRegression should accept a p_outlier keyword argument (e.g. HDDMRegression(data, 'v~x', p_outlier=.05). Does it not?

Thomas


--
You received this message because you are subscribed to the Google Groups "hddm-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hddm-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Qiang Shen

unread,
Jun 7, 2014, 9:00:51 AM6/7/14
to hddm-...@googlegroups.com
Thanks, Thomas.

Qiang Shen

unread,
Jun 7, 2014, 11:07:12 AM6/7/14
to hddm-...@googlegroups.com
Hi Thomas, 

     Recently I moved to a new place and need to install the HDDM again on Mac. But I failed to install it correctly. I have tried Anaconda 1.9.2 and Anaconda 2.0.0. Below are the error information. 


1.pip install -U pymc

Command /Applications/anaconda/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/vf/zy_t4gd13831lkzwvkq1qk6m0000gn/T/pip_build_qiangshen/pymc/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/vf/zy_t4gd13831lkzwvkq1qk6m0000gn/T/pip-HYXzxx-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/vf/zy_t4gd13831lkzwvkq1qk6m0000gn/T/pip_build_qiangshen/pymc
Storing debug log for failure in /Users/qiangshen/.pip/pip.log

2. pip install -U kabuki

Command python setup.py egg_info failed with error code 1 in /private/var/folders/vf/zy_t4gd13831lkzwvkq1qk6m0000gn/T/pip_build_qiangshen/kabuki
Storing debug log for failure in /Users/qiangshen/.pip/pip.log



3. pip install -U hddm 

Command python setup.py egg_info failed with error code 1 in /private/var/folders/vf/zy_t4gd13831lkzwvkq1qk6m0000gn/T/pip_build_qiangshen/hddm
Storing debug log for failure in /Users/qiangshen/.pip/pip.log

Qiang Shen

unread,
Jun 7, 2014, 11:13:19 AM6/7/14
to hddm-...@googlegroups.com
Do you know how to fix this? Thanks.
...

Thomas Wiecki

unread,
Jun 7, 2014, 11:19:37 AM6/7/14
to hddm-...@googlegroups.com
Can you paste the full error log?


--
You received this message because you are subscribed to the Google Groups "hddm-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hddm-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Qiang Shen

unread,
Jun 7, 2014, 9:39:21 PM6/7/14
to hddm-...@googlegroups.com
Hi Thomas,

      I figured it out, it needs a Fortran compiler which is not available in the original OSX. Thank you all the same.

best wishes,

Qiang
Message has been deleted

stein...@gmail.com

unread,
Jun 11, 2014, 6:31:02 AM6/11/14
to hddm-...@googlegroups.com
Hi Quiang,

did you find a solution? I'm stuck precisely where you have been. Any hints on where to get the right compiler or how to work around the Fortran compiler problem?

Thanks a lot,
Benjamin
...

Thomas Wiecki

unread,
Jun 11, 2014, 6:51:25 AM6/11/14
to hddm-...@googlegroups.com
Hi Benjamin,

A user posted windows build instructions in another thread:
"
I wanted to install HDDM on a windows machine but was riddled with either DLL or MS visual studio errors, especially with PyMC. I tried clean python install and also Anaconda with no luck. Here is a procedure that worked for me so thought maybe I will post it here in case people are still looking for a solution. As the procedure depends on MinGW32 please make sure that you install everything 32 bit even though your Windows is 64 bit.

You need admin rights to do many of the following.

1. Install Python 2.7.6 32 bit. Lets call the install directory path_to_Python27.
2. Get Numpy and Scipy 2.7 32 bit installers from their websites and install.
3. Install setuptools and pip (32 bit) from http://www.lfd.uci.edu/~gohlke/pythonlibs/
4. Install MinGW32 and append the corresponding bin folder to your environments PATH variable. You can get MinGW32 here http://sourceforge.net/projects/mingw/files/
5. Create file: path_to_Python27\Lib\
distutils\distutils.cfg and put following two lines in there:

[build]
compiler=mingw32

6. Start "cmd" and run following commands in the path_to_Python27\scripts directory (make sure that you dont have any python instances running)

pip install matplotlib
pip install pymc
pip install pandas
pip install kabuki
pip install hddm
"

See if that helps. Otherwise I should update the conda windows packages soon.

Thomas



--
You received this message because you are subscribed to the Google Groups "hddm-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hddm-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

stein...@gmail.com

unread,
Jun 11, 2014, 7:54:14 AM6/11/14
to hddm-...@googlegroups.com
Hi Thomas, 
thanks for the quick reply. There is a little misunderstanding though: I'm trying to get hddm working on OSX mountain lion (10.8.5) for which there is no 32 bit version.
It's these error messages, that I was referring to:

""""""""
1.pip install -U pymc

Command /Applications/anaconda/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/vf/zy_t4gd13831lkzwvkq1qk6m0000gn/T/pip_build_qiangshen/pymc/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/vf/zy_t4gd13831lkzwvkq1qk6m0000gn/T/pip-HYXzxx-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/vf/zy_t4gd13831lkzwvkq1qk6m0000gn/T/pip_build_qiangshen/pymc
Storing debug log for failure in /Users/qiangshen/.pip/pip.log

2. pip install -U kabuki

Command python setup.py egg_info failed with error code 1 in /private/var/folders/vf/zy_t4gd13831lkzwvkq1qk6m0000gn/T/pip_build_qiangshen/kabuki
Storing debug log for failure in /Users/qiangshen/.pip/pip.log

3. pip install -U hddm 

Command python setup.py egg_info failed with error code 1 in /private/var/folders/vf/zy_t4gd13831lkzwvkq1qk6m0000gn/T/pip_build_qiangshen/hddm
Storing debug log for failure in /Users/qiangshen/.pip/pip.log

""""""

So I suppose I need to install a Fortran compiler now? 

Cheers,
Benjamin
...

Thomas Wiecki

unread,
Jun 13, 2014, 3:11:56 AM6/13/14
to hddm-...@googlegroups.com
But you are running OSX 64-bit with anaconda 64-bit, right?


--
You received this message because you are subscribed to the Google Groups "hddm-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hddm-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

stein...@gmail.com

unread,
May 14, 2015, 3:46:51 AM5/14/15
to hddm-...@googlegroups.com
yes, correct. 64 bit Mountain Lion with 64 bit Anaconda.
...

Thomas Wiecki

unread,
May 15, 2015, 3:41:42 AM5/15/15
to hddm-...@googlegroups.com
I'll try to find someone with OSX who can build new packages.

--
You received this message because you are subscribed to the Google Groups "hddm-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hddm-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Thomas Wiecki, PhD
Data Science Lead, Quantopian Inc, Boston
Reply all
Reply to author
Forward
0 new messages