New Classes
The LAN extension (HDDM >= 0.9.0), provides three new classes which are LAN-enabled versions of the respective classes in base HDDM. These new classes are,
The
HDDMnn()
classThe
HDDMnnStimCoding()
classThe
HDDMnnRegressor()
class
The usage mirrors what you are used to from standard HDDM
equivalents.
What changes is that you now use the model
argument to specify one
of the models you find listed in the hddm.model_config.model_config
dictionary (you can also provide a custom model, for which you should
look into the respective section in this documentation).
Moreover, you have to be a little more careful when specifying the
include
argument, since the ability to use new models comes with new
parameters. To help get started here, the
hddm.model_config.model_config
dictionary provides you a
hddm_include
key for every model-specific sub-dictionary. This
let’s you fit all parameters of a given model. To keep some parameters
fixed, remove them respectively from the resulting list.
Short example
import hddm
model = 'angle'
cavanagh_data = hddm.load_csv(hddm.__path__[0] + '/examples/cavanagh_theta_nn.csv')
model_ = hddm.HDDMnn(cavanagh_data,
model = model,
include = hddm.model_config.model_config[model]['hddm_include'],
is_group_model = False)
Using default priors: Uninformative
model_.sample(1000, burn = 200)
[-----------------100%-----------------] 1000 of 1000 complete in 260.3 sec
<pymc.MCMC.MCMC at 0x13e449650>
model_.get_traces()
v | a | z_trans | t | theta | |
---|---|---|---|---|---|
0 | 0.370402 | 1.325747 | 0.023242 | 0.284196 | 0.253870 |
1 | 0.338917 | 1.328545 | 0.062895 | 0.283047 | 0.248485 |
2 | 0.386179 | 1.321476 | 0.054727 | 0.285712 | 0.250671 |
3 | 0.387484 | 1.323711 | -0.019109 | 0.274198 | 0.253445 |
4 | 0.370557 | 1.323342 | 0.015675 | 0.277691 | 0.255681 |
... | ... | ... | ... | ... | ... |
795 | 0.325748 | 1.331846 | 0.113685 | 0.270311 | 0.252461 |
796 | 0.337564 | 1.315446 | 0.111898 | 0.286141 | 0.252236 |
797 | 0.387142 | 1.309284 | 0.036839 | 0.286663 | 0.238878 |
798 | 0.388073 | 1.313791 | -0.013604 | 0.271768 | 0.235831 |
799 | 0.397477 | 1.314008 | -0.007186 | 0.276948 | 0.242729 |
800 rows × 5 columns
model_.gen_stats()
mean | std | 2.5q | 25q | 50q | 75q | 97.5q | mc err | |
---|---|---|---|---|---|---|---|---|
v | 0.369154 | 0.0207375 | 0.329893 | 0.355813 | 0.369495 | 0.382592 | 0.409568 | 0.00111918 |
a | 1.31224 | 0.0212032 | 1.26826 | 1.29879 | 1.31332 | 1.32755 | 1.3514 | 0.00180178 |
z | 0.504951 | 0.00604908 | 0.493251 | 0.500775 | 0.504934 | 0.509041 | 0.517023 | 0.000311986 |
t | 0.283719 | 0.00943542 | 0.265774 | 0.277639 | 0.283707 | 0.290191 | 0.302331 | 0.00070058 |
theta | 0.242432 | 0.0127552 | 0.216824 | 0.234284 | 0.242875 | 0.251645 | 0.265587 | 0.00103379 |