This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Contains functions for generating and using equal-loudness contours for | |
side-presented steady pure tones according to the ISO/IEC 226 standard. | |
""" | |
__author__ = 'Sam Mathias' | |
__version__ = 1.0 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""This is the docstring for the example.py module. Modules names should | |
have short, all-lowercase names. The module name may have underscores if | |
this improves readability. | |
Every module should have a docstring at the very top of the file. The | |
module's docstring may extend over multiple lines. If your docstring does | |
extend over multiple lines, the closing three quotation marks must be on | |
a line by itself, preferably preceeded by a blank line. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue Dec 10 17:41:11 2013 | |
@author: smathias | |
""" | |
import matplotlib.pyplot as plt | |
import numpy as np | |
class Kaernbach1991: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Nov 20 15:22:22 2013 | |
@author: smathias | |
""" | |
import brian | |
import brian.hears as b | |
import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Bayesian hierarchical generalised linear signal detection models for | |
yes-no experiments. | |
""" | |
import numpy as np | |
import pandas as pd | |
import patsy | |
import pymc3 as pm | |
import theano | |
import theano.tensor as T |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Model of working-memory capacity for change-detection tasks. | |
This script implements a "slots-based" model of working memory capacity based | |
on the Cowan formula, modified to allow lapses and formalized in a Bayesian | |
framework. | |
Data are organised into a pandas data frame in which each row represents a | |
subject, and columns contain covariates or observations. "Covariates" can be | |
categorical or continuous. "Observations" are counts of trials and are named | |
`{x}_{y}` where `{x}` is a single uppercase letter indicating the count type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Simple fully contained script to fit a Bayesian hierarchical logistic | |
regression model using PyMC3. | |
""" | |
import theano | |
import matplotlib | |
matplotlib.use('Agg') # seems to be necessary on Unix | |
import numpy as np | |
import pandas as pd | |
import pymc3 as pm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import brian | |
import brian.hears as hears | |
def irn(dur, f, g, n, method='s'): | |
"""Generate IRN with a duration dur in seconds, a pitch at f (either a | |
single value for a flat pitch, or an iterable for a contour) in Hz, a gain | |
of g (-1 <= g <= 1) and n iterations. Since this is done in the time | |
domain, processing time gets longer with larger n.""" | |
x = hears.whitenoise(dur * brian.second) #input signal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from warnings import warn | |
import numpy as np | |
from scipy.signal import butter, lfilter | |
from scipy.stats import norm, uniform | |
import matplotlib.pyplot as plt | |
import brian | |
import brian.hears as hears |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hddm | |
import numpy as np | |
from scipy.stats import norm | |
import matplotlib.pyplot as plt | |
from matplotlib.gridspec import GridSpec | |
from tqdm import tqdm | |
def setupfig(): | |
"""Tweak for the target journal. |
OlderNewer