Could not generate output statistics

205 views
Skip to first unread message

Mahsa Shalchy

unread,
Dec 26, 2019, 12:02:19 AM12/26/19
to hddm-users
Dear hddm community,

I was able to install the hddm package following the steps here:
https://gist.github.com/birkin/3b17a11ccbfa512a59565296ce4c7ff4

Now I have Python 3.7.4 on mac 10.14.4 and I am using my mac terminal to access either Jupyter notebook or Spyder.was trying to run the demo, however after running the following commands:
m = hddm.HDDM(data)
m.find_starting_values()
m.sample(200, burn=20)

 I am getting the following error:

[-----------------100%-----------------] 200 of 200 complete in 16.1 secCould not generate output statistics for a_subj.7
Could not generate output statistics for t_subj.5
Could not generate output statistics for a_subj.0
Could not generate output statistics for t_subj.10
Could not generate output statistics for v_subj.2
Could not generate output statistics for a_subj.3
Could not generate output statistics for v_subj.13
Could not generate output statistics for t_subj.6
Could not generate output statistics for a_subj.12
Could not generate output statistics for t_subj.8
Could not generate output statistics for v_subj.7
Could not generate output statistics for a_subj.8
Could not generate output statistics for t_subj.2
Could not generate output statistics for v_subj.5
Could not generate output statistics for a_subj.10
Could not generate output statistics for a_subj.13
Could not generate output statistics for v_subj.8
Could not generate output statistics for t_subj.11
Could not generate output statistics for a_std
Could not generate output statistics for v_subj.10
Could not generate output statistics for v_subj.12
Could not generate output statistics for t_subj.9
Could not generate output statistics for a
Could not generate output statistics for t_subj.4
Could not generate output statistics for a_subj.4
Could not generate output statistics for a_subj.1
Could not generate output statistics for t_subj.12
Could not generate output statistics for v_subj.4
Could not generate output statistics for v_subj.9
Could not generate output statistics for a_subj.5
Could not generate output statistics for t_subj.1
Could not generate output statistics for v_subj.1
Could not generate output statistics for t_subj.13
Could not generate output statistics for t_std
Could not generate output statistics for t_subj.0
Could not generate output statistics for v
Could not generate output statistics for v_subj.3
Could not generate output statistics for a_subj.2
Could not generate output statistics for v_subj.6
Could not generate output statistics for a_subj.6
Could not generate output statistics for a_subj.11
Could not generate output statistics for t_subj.3
Could not generate output statistics for a_subj.9
Could not generate output statistics for v_subj.0
Could not generate output statistics for t
Could not generate output statistics for t_subj.7
Could not generate output statistics for v_std
Could not generate output statistics for v_subj.11
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-29-206bcfdb7f66> in <module>
      1 m = hddm.HDDM(data)
      2 m.find_starting_values()
----> 3 m.sample(200, burn=20)

/opt/anaconda3/lib/python3.7/site-packages/kabuki/hierarchical.py in sample(self, *args, **kwargs)
    653         self.sampled = True
    654 
--> 655         self.gen_stats()
    656         return self.mc
    657 

/opt/anaconda3/lib/python3.7/site-packages/kabuki/hierarchical.py in gen_stats(self, fname, print_hidden, **kwargs)
    730             print_hidden <bool>  - print statistics of hidden nodes
    731         """
--> 732         self.append_stats_to_nodes_db()
    733 
    734         sliced_db = self.nodes_db.copy()

/opt/anaconda3/lib/python3.7/site-packages/kabuki/hierarchical.py in append_stats_to_nodes_db(self, *args, **kwargs)
    782             if self.nodes_db.loc[name, 'hidden']:
    783                 continue
--> 784             self.nodes_db.loc[name, 'mean']   = i_stats['mean']
    785             self.nodes_db.loc[name, 'std']    = i_stats['standard deviation']
    786             self.nodes_db.loc[name, '2.5q']   = i_stats['quantiles'][2.5]

TypeError: 'NoneType' object is not subscriptable



Can you help me to find a solution to this?

Many thanks,
Mahsa

Thomas Wiecki

unread,
Dec 26, 2019, 10:36:31 AM12/26/19
to hddm-...@googlegroups.com
Can you try running more samples? like 5000?

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/hddm-users/2903e542-2e61-48fc-96b6-5562cfcdf252%40googlegroups.com.

Mahsa Alizadeh Shalchy

unread,
Dec 26, 2019, 11:02:47 AM12/26/19
to hddm-...@googlegroups.com
Thank you for your response, Thomas.
The problem persists with higher samples .i.e. 2000, 5000 or even more.










--

***************************************
Mahsa Alizadeh Shalchy
Doctoral Researcher
Department of Psychology
University of California - Riverside
900 University Avenue 
Riverside California 92521
***************************************

Zhenna LU

unread,
Dec 29, 2019, 11:41:22 PM12/29/19
to hddm-users
Hi Mahsa,

I have encountered the same problem running in python 3. It works when running in python 2.
To unsubscribe from this group and stop receiving emails from it, send an email to hddm-...@googlegroups.com.

--
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-...@googlegroups.com.

Thomas Wiecki

unread,
Dec 30, 2019, 12:55:07 AM12/30/19
to hddm-...@googlegroups.com
Yeah, this is such a weird bug that I haven't able to figure out. It seems to have to do with certain numpy versions, so either up or downgrading that might help (and Python 2.7 might trigger a different numpy version to get installed). 

To unsubscribe from this group and stop receiving emails from it, send an email to hddm-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hddm-users/68833f91-e729-4114-a02c-32934f0e0200%40googlegroups.com.

Mahsa Alizadeh Shalchy

unread,
Dec 30, 2019, 12:31:30 PM12/30/19
to hddm-...@googlegroups.com
Thank you, Zhenna. Using Python 2.7 fixed the problem.




To unsubscribe from this group and stop receiving emails from it, send an email to hddm-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hddm-users/68833f91-e729-4114-a02c-32934f0e0200%40googlegroups.com.

Nathan Tardiff

unread,
Feb 6, 2020, 10:39:59 AM2/6/20
to hddm-users
Hello,

I just wanted to post another experience. I successfully installed and ran hddm in Python 3.6 following the instructions here: https://groups.google.com/forum/#!topic/hddm-users/bdQXewfUzLs (Mac OS 10.12.6). Though I could fit models, I couldn't run any of the diagnostics. It turned out that the version of pymc in my environment was deficient and didn't have important functions like Matplot and geweke. I then tried to install pymc from easy_install, which involves some compiling. This install was still deficient, and after this I started getting the "could not generate output statistics" error on an already saved model when I tried to load it.  I tried playing around w/ various versions of numpy to no avail. 

I'm now running in a Python 2.7 environment and everything seems to be working.

Esin Turkakin

unread,
Feb 17, 2020, 11:31:49 AM2/17/20
to hddm-users
Hi Nathan,

I hadn't tried running diagnostics before seeing your message, and the instructions in the link indeed need an additional installation for the package statsmodels for the geweke diagnostic to work. Thanks for the heads-up. After installing that with conda install statsmodel, I didn't encounter any further issues (saving and loading also seems to work fine) and didn't need to update pymc or any other package (my environment has pymc version 2.3.7 and the updated hddm 0.7.5).

Just sharing in case anyone else has similar problems.

Cheers,
Esin
Reply all
Reply to author
Forward
0 new messages