ActionModels.jl

A Julia package for behavioural modeling
Author ilabcode
Popularity
2 Stars
Updated Last
1 Year Ago
Started In
August 2022

ActionModels

Stable Build Status Coverage License: MIT License: GNU

Welcome to the ActionModels.jl package!

ActionModels.jl is a powerfull and novel package for computational modelling of behavior and cognition. The package is developed with a intention to make computaitonal modelling intuitive, fast and easily adaptive to your experimental and simulation needs.

With ActionModels.jl you can define a fully customizable behavioral model and easily fit them to experimental data and used for computational modelling.

we provide a consice introduction to this framework for computational modelling of behvior and cognition and its accompanying terminology.

After this introduction, you will be presented with a detailed step-by-step guide on how to use ActionModels.jl to make your computational model runway-ready.

Getting started

Defning a premade agent

using ActionModels

Find premade agent, and define agent with default parameters

premade_agent("help")

agent = premade_agent("premade_binary_rw_softmax")

Set inputs and give inputs to agent

inputs = [1,0,0,0,1,1,1,1,0,1,0,1,0,1,1]
actions = give_inputs!(agent,inputs)

using StatsPlots
plot_trajectory(agent, "action_probability")

Fit learning rate. Start by setting prior

using Distributions
priors = Dict("learning_rate" => Normal(0.5, 0.5))

Run model

chains = fit_model(agent, priors, inputs, actions, n_chains = 1, n_iterations = 10)

Plot prior and posterior

plot_parameter_distribution(chains,priors)

Get posteriors from chains

get_posteriors(chains)