Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Wiecki twiecki

View GitHub Profile
View ModelBuilder
class ModelBuilder:
@classmethod
def load_default_config(cls):
# return dict of parameters
...
def __init__(self, data: pd.DataFrame, trait: str, config: Dict):
"""
Initialize the model builder.
@twiecki
twiecki / PyMC3 vs PyMC 4.0.ipynb
Last active Jan 6, 2022
PyMC3 vs PyMC 4.0.ipynb
View PyMC3 vs PyMC 4.0.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@twiecki
twiecki / PyMC3 vs PyMC 4.0.ipynb
Created Dec 24, 2021
PyMC3 vs PyMC 4.0.ipynb
View PyMC3 vs PyMC 4.0.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Section4_1-Bayesian_Workflow.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@twiecki
twiecki / probabilistic+pca.ipynb
Created Nov 23, 2021
probabilistic+pca.ipynb
View probabilistic+pca.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:6b13d0880f8307e7613cd174e963b8cd
def z_link_func(x, data=mydata):
stim = (np.asarray(dmatrix('0 + C(s, [[0], [1]])',
{'s': data.stimulus.loc[x.index]}))
)
# Apply z = (1 - x) to flip them along 0.5
z_flip = stim - x
# The above inverts those values we do not want to flip,
# so invert them back
z_flip[stim == 0] *= -1
return z_flip
View LoveLaneAnalysis-Copy1.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@twiecki
twiecki / optimize_normalizing_constant.ipynb
Last active Jan 1, 2021
Skeleton to write graph optimizer
View optimize_normalizing_constant.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@twiecki
twiecki / stochastic_volatility_jax.ipynb
Last active Apr 13, 2021
stochastic_volatility.ipynb
View stochastic_volatility_jax.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@twiecki
twiecki / GLM-hierarchical-jax.ipynb
Last active Mar 6, 2022
notebooks/GLM-hierarchical.ipynb
View GLM-hierarchical-jax.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.