{"id":25117920,"url":"https://github.com/brody-lab/mixtureagentsmodels","last_synced_at":"2025-04-02T12:29:47.545Z","repository":{"id":225033805,"uuid":"764905517","full_name":"Brody-Lab/MixtureAgentsModels","owner":"Brody-Lab","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-04T01:08:59.000Z","size":37398,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-02-08T03:36:02.096Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-28T23:20:53.000Z","updated_at":"2024-11-26T00:03:32.000Z","dependencies_parsed_at":"2024-05-20T18:02:28.205Z","dependency_job_id":null,"html_url":"https://github.com/Brody-Lab/MixtureAgentsModels","commit_stats":null,"previous_names":["brody-lab/mixtureagentsmodels"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brody-Lab%2FMixtureAgentsModels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brody-Lab%2FMixtureAgentsModels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brody-Lab%2FMixtureAgentsModels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brody-Lab%2FMixtureAgentsModels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Brody-Lab","download_url":"https://codeload.github.com/Brody-Lab/MixtureAgentsModels/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246814961,"owners_count":20838351,"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:35.229Z","updated_at":"2025-04-02T12:29:47.511Z","avatar_url":"https://github.com/Brody-Lab.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MixtureAgentsModels\nFit a Mixture-of-Agents Hidden Markov Model (MoA-HMM) described in the preprint \u003ca href=https://www.biorxiv.org/content/10.1101/2024.02.28.582617v1\u003eDynamic reinforcement learning reveals time-dependent shifts in strategy during reward learning.\u003c/a\u003e\n\nDocumentation is a work in progress\n\nFor questions, email sjvenditto@gmail.com\n\n## Installation\n### Option 1: Clone and setup project folder (i.e. julia environment)\nFrom the terminal/command line, clone the repository in the current directory with:\n```\ngit clone https://github.com/Brody-Lab/MixtureAgentsModels/\n```\nOr \u003ca href=https://github.com/Brody-Lab/MixtureAgentsModels/archive/refs/heads/main.zip\u003edownload ZIP\u003c/a\u003e and extract in desired directory.\n\nAfter cloning, also from the terminal/command line, `cd` into the `MixtureAgentsModels` directory and start julia by specifying the current folder as the project location:\n```\njulia --project=.\n```\nor, if outside of the `MixtureAgentsModels` directory,\n```\njulia --project=PATH/TO/YOUR/MixtureAgentsModels\n```\n\nOnce in julia, enter the package manager by pressing `]` and type the following command to install the package in the project folder:\n```julia\npkg \u003e instantiate\n```\nor, without using the package manager:\n```julia\njulia \u003e using Pkg\njulia \u003e Pkg.instantiate()\n```\nThis will only install the package within the project folder, so to use the package via `using MixtureAgentsModels`, you must first start julia by specifying the project folder as shown above. If you cloned the repository, using the command `git pull` will update the package.\n\n### Option 2: Install as global package\nTo install the package globally, start julia and enter the package manager by pressing `]`. To install, enter the following command:\n```julia\npkg \u003e add https://github.com/Brody-Lab/MixtureAgentsModels/\n```\nor, without using the package manager:\n```julia\njulia \u003e using Pkg\njulia \u003e Pkg.add(PackageSpec(url=\"https://github.com/Brody-Lab/MixtureAgentsModels/\"))\n```\nTo update the package, enter the package manager using `]` and type the command \n```julia\npkg \u003e update\n```\n\n## Getting started\n### Fitting the model\nSee the `example_fit_HMM.jl` script in the \u003ca href=https://github.com/Brody-Lab/MixtureAgentsModels/tree/main/examples\u003eexamples\u003c/a\u003e directory for example model MoA-HMM fits to the two-step task and command descriptions. \n\u003e NOTE: `example_fit_drift.jl` uses an experimental model that combines a MoA with psytrack (https://github.com/nicholas-roy/psytrack) and should not be used in a serious capacity.\n\n### Loading your own task via `GenericData`\nThe task data struct `GenericData` contained in `generic_task.jl` in the \u003ca href=https://github.com/Brody-Lab/MixtureAgentsModels/tree/main/src/tasks\u003etasks\u003c/a\u003e directory contains the minimum features necessary to work with model-free agents. The example script `example_load_data.jl` points to two example files (a `.csv` and `.mat`) that can be used as skeletons for loading in your own data, as well as listing compatible agents with the GenericData struct. Additional fields can be added for compatibility with other agents. You may want to fork the repository first if you want to easily commit changes.\n\n### Adding a new agent or task\nDocumentation for adding your own task or agent/agents is a work in progress. You may want to fork the repository first if you want to easily commit changes.\n\nTo add your own agent, see the documentation of `EXAMPLE_agent.jl` in the \u003ca href=https://github.com/Brody-Lab/MixtureAgentsModels/tree/main/src/agents\u003eagents\u003c/a\u003e directory for requisite struct fields and functions. Save your new agent as its own julia script in the same `agents` directory.\n\nTo add your own task, see the documentation of `generic_task.jl` in the \u003ca href=https://github.com/Brody-Lab/MixtureAgentsModels/tree/main/src/tasks\u003etasks\u003c/a\u003e directory for requisite struct fields and loading examples. Save your new task as its own julia script in the same `tasks` directory.\n\nAny agent or task needs to be exported and its file added to the module definition script `MixtureAgentsModels.jl`. To export a new agent or task, add a line near the existing agents and/or tasks.\n```julia\nexport EXAMPLEAgent # for your agent struct\nexport EXAMPLEData # for your task struct\n```\n\nIf you have a custom loading function for your task struct, similarly export that function:\n```julia\nexport load_example_task # or however you named the function\n```\n\nFinally, add the scripts containing the code for your new agents and/or tasks near the end of module script near existing agents and tasks:\n```julia\ninclude(\"agents/EXAMPLE_agent.jl\")\ninclude(\"tasks/EXAMPLE_task.jl\")\n```\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrody-lab%2Fmixtureagentsmodels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrody-lab%2Fmixtureagentsmodels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrody-lab%2Fmixtureagentsmodels/lists"}