bsfit.nodes.models.utils

Useful functions for modeling

Copyright 2022 by Steeve Laquitaine, GNU license

Functions

choose_percept(readout, stim_mean_space, ...)

choose the percepts for measurement m_i caused by stimulus s_i

do_bayes_inference(k_llh, prior_mode, ...)

do bayesian inference

fit_maxlogl(database, init_p, prior_shape, ...)

Fit stimulus feature estimates

flatten(x)

flattens list of list

format_params(database, init_p, prior_shape, ...)

set model and task parameters

get_bayes_lookup(percept_space, stim_mean, ...)

Create a bayes lookup matrix based on Girshick paper

get_combination_set(database)

get the set of row combinations

get_data(database)

extract the data to fit from the database

get_data_stats(data, output)

calculate data statistics

get_fit_variables(fit_p, params, stim_mean, ...)

get the fit intermediate variable

get_learnt_prior(percept_space, prior_mode, ...)

calculate the learnt prior density

get_logl(fit_p, params, stim_mean, data)

calculate the log(likelihood) of the data given the model

get_logl_and_aic(n_fit_params, proba_data)

calculate - log(likelihood) and akaike information criterion

get_percept_likelihood(percept_space, ...)

calculate percept likelihoods.

get_prediction_stats(output)

calculate prediction statistics

get_proba_data(estimate, proba_estimate)

get data probability density

get_proba_estimate(k_m, PupoGivenModel)

get estimate probability density

get_proba_percept(stim_mean, params, k_llh, ...)

get the percept probability density

get_trial_prediction(output, params, n_repeats)

get model-generated stochastic choices

locate_fit_params(params)

find fit parameters in dictionary

predict(fit_p, params, stim_mean, data, ...)

""get model prediction at trial or summary statistics level

simulate(database, sim_p, prior_shape, ...)

simulate estimate data per condition

simulate_dataset(fit_p, params, stim_mean, ...)

""get model predictions

unpack(my_dict)

unpack a dictionary into a flat list