{"id":25117908,"url":"https://github.com/brody-lab/venditto_glm-hmm","last_synced_at":"2025-04-02T12:29:40.251Z","repository":{"id":45424347,"uuid":"431617659","full_name":"Brody-Lab/venditto_glm-hmm","owner":"Brody-Lab","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-18T20:22:03.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-02-08T03:36:07.353Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Brody-Lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-24T20:20:19.000Z","updated_at":"2024-05-23T06:04:09.000Z","dependencies_parsed_at":"2022-09-10T11:42:10.908Z","dependency_job_id":null,"html_url":"https://github.com/Brody-Lab/venditto_glm-hmm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brody-Lab%2Fvenditto_glm-hmm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brody-Lab%2Fvenditto_glm-hmm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brody-Lab%2Fvenditto_glm-hmm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brody-Lab%2Fvenditto_glm-hmm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Brody-Lab","download_url":"https://codeload.github.com/Brody-Lab/venditto_glm-hmm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246814929,"owners_count":20838350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-08T03:36:17.238Z","updated_at":"2025-04-02T12:29:40.229Z","avatar_url":"https://github.com/Brody-Lab.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GLM-HMM for binary observations\nMATLAB functions for fitting a GLM-HMM on behavioral data  in tasks with a binary choice. Implementation based on Bishop's \"Pattern Recognition and Machine Learning\" and Escola et al. (2011), *Neural Computation*. To use, include both `fitGlmHmm.m` and `runBaumWelch.m` need to be in your MATLAB path.\n\n## Model description\nComing soon\n\n## Included functions\nSee function description and additional parameter descriptions by inputting `help fitGlmHmm` or `help runBaumWelch` into MATLAB command window.\n\n### `fitGlmHmm`: Fitting the model\n```\n[model, ll] = fitGlmHmm(y,x,w0)\n```\nRequired inputs:\n- `y`: (1 x NTrials) binary observation data\n- `x`: (NFeatures x NTrials) design matrix; behavioral features used to predict observation data\n- `w0`: (NFeatures x NStates) initial latent state GLM weights. Desired number of latent states is taken implicitly from the second dimension\n\nOutputs:\n- `model`: struct containing fit parameters\n  - `w`: (NFeatures x NStates) latent state GLM weights\n  - `pi`: (NStates x 1) initial latent state probability\n  - `A`: (NStates x Nstates) \n- `ll`: (1 x NIter) log-likelihood of model fit at each iteration\n\n\n\n### `runBaumWelch`: Computing latent state probabilities or fit likelihood on some data set\n```\n[gammas,xis,ll] = runBaumWelch(y,x,model)\n```\nRequired inputs:\n- `y` and `x` as described above\n- `model`: output of `runGlmHmm.m`\n\nOutputs:\n- `gammas`: probability of latent state given model parameters for each trial\n- `xis`: joint posterior distribution (summed across trials). can be used to calculate the estimated transition matrix\n- `ll`: log-likelihood of the model\n\n## Example \nThe MATLAB script `example_glmhmm_fit.m` details the process of fitting a GLM-HMM on an evidence accumulation ('accumulating towers') task data. This script:\n1. Simulates a GLM-HMM model to generate behavioral data\n2. Initializes necessary input and fits a GLM-HMM model to generated data (i.e. recovers GLM-HMM used to generate data)\n3. Compares recovered fit to simulated model\n\n## Credit\nWritten by Sarah Jo Venditto. Please cite this repository\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrody-lab%2Fvenditto_glm-hmm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrody-lab%2Fvenditto_glm-hmm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrody-lab%2Fvenditto_glm-hmm/lists"}