belief_update: Update beliefs from observations stored in a data frame

Description Usage Arguments Value See Also Examples

View source: R/belief.R

Description

Update beliefs from observations stored in a data frame

Usage

1
belief_update(d, cue, categories, 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.

beliefs

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

Value

The input data frame with parameter values updated after each observation in the beliefs columns

See Also

belief_update_batch for batch belief updating, which is more efficient.

Examples

1
2
3
4
5
d <- data.frame(x = rnorm(100, 3),
                c = sample(c('a', 'b'), 100, replace=TRUE))
belief_update(d, 'x', 'c',
              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.