alexpiet / licking_behavior

Analysis of mouse licking behavior during visually guided behavior
2 stars 0 forks source link

licking_behavior

Analysis of mouse licking behavior during visually guided behavior. Primarily, this repo develops a time-varying logistic regression model that learns the probability of licking on a flash by flash basis, using weights that vary over time by following random walk priors.

Time Varying Regression Model

The model predicts the probability of the mouse starting a licking bout on each image presentation. Its described as the sum of several time-varying strategies.

Check if the Time Varying Regression model has already been fit to a session

import src/psy_tools as ps
ps.check_session(id)

Fitting the Time Varying Regression model

import src/psy_tools as ps
for ID in IDS:
ps.process_session(ID)
ps.plot_fit(ID)
ps.plot_session_summary(IDS)

Integrating the Time Varying Regression Model clustering with the flash_response_df

import src/psy_tools as ps
import src/psy_sdk_tools as psd
from allensdk.brain_observatory.behavior.swdb import behavior_project_cache as bpc
import allensdk.brain_observatory.behavior.swdb.utilities as tools
cache = bpc.BehaviorProjectCache(cache_json)
fit = ps.load_fit(id)
session = cache.get_session(id)
cdf = psd.get_joint_table(fit,session)

Diagram of information flow

code_diagram