Free time & chunking modeling
  • Versions
    • Latest
    • v0.1
  • Source Code
  • Report a Bug
  1. Function reference
  2. Calculate the deviance of a model
  • Version 0.1
  •  
  • About
  • Development notes
    • Notes
    • 2024-05-16 Meeting Notes
    • Extra primacy parameter
  • Notebooks
    • Data
      • View the data structure
      • Exploratory data analysis
      • Subject-level data
    • Model 1: Original model
      • Main results
      • Parameter identifiability
      • Sensitivity to tau
      • Experiment 3
      • Exploring model predictions
    • Model 2: Include encoding time
      • Main results
    • Model 3: Non-linear recovery
      • Explore model predictions
      • Basic fits
      • Bootstrapping data and fits for parameter uncertainty estimation
      • Extra primacy parameter
      • Linear recovery as a random variable
  • Function reference
    • Aggregate Data
    • Perform bootstrapped estimation
    • Calculate the deviance of a model
    • Get data object from a file
    • Generate a bootstrapped dataset
    • get_data function
    • Inverse Logit Transformation
    • Logit Transformation
    • Calculate the overall deviance
    • Plot Bootstrap Results
    • Plot Linear RV Recovery
    • Preprocesses the data
    • Execute an expression and save the result to a file or load the result from a file if it already exists.
    • Serial Recall Model

On this page

  • Calculate the deviance of a model
    • Description
    • Usage
    • Arguments
    • Value
    • Examples

Calculate the deviance of a model

Description

This function calculates the deviance of a serial_recall model given a set of parameters and data. The deviance is a measure of how well the model fits the data.

Usage

calcdev(params, dat, exclude_sp1 = FALSE, ...)

Arguments

  • params: A named vector of model parameters
  • dat: A data frame containing the data
  • exclude_sp1: A logical indicating whether to exclude the first item from the likelihood calculation

Value

The deviance of the model

Examples

params <- c(prop = 0.5, prop_ltm = 0.3, tau = 0.2, gain = 1, rate = 0.4)
data <- data.frame(
  ISI = c(100, 200, 300), item_in_ltm = c(TRUE, FALSE, TRUE),
  n_correct = c(10, 15, 20), n_total = c(20, 20, 20)
)
calcdev(params, data)
Back to top
Perform bootstrapped estimation
Get data object from a file