belief_update_batch: Update beliefs in a data frame in batches

Description Usage Arguments Value See Also Examples

View source: R/belief.R

Description

Update beliefs in a data frame in batches

Usage

1
belief_update_batch(d, cue, categories, trials, at, beliefs)

Arguments

d

Data frame with cue values and categories

cue

Quoted name of column of data frame with cue values

categories

Quoted name of column with known category labels.

trials

Quoted name of column with trial numbers to define batches

at

Trial numbers to get updated beliefs

beliefs

Named list of starting belief NIX^2 parameters. Names must match unique values of d[[categories]]

Value

A data_frame with updated NIX2 parameters in beliefs for the values of d[[trials]] from at. d$beliefs is a list column where each element is a named list of category belief parameters

See Also

belief_update for fully incremental, observation-by-observation belief updating.

Examples

1
2
3
4
5
6
d <- data.frame(x = rnorm(100, 3),
                c = sample(c('a', 'b'), 100, replace=TRUE),
                trial = 1:100)
belief_update_batch(d, 'x', 'c', 'trial', seq(10, 100, by=10),
                    list(a = nix2_params(0, 0, 10, 10),
                         b = nix2_params(0, 0, 10, 10)))

kleinschmidt/beliefupdatr documentation built on May 24, 2020, 8:26 p.m.