fit_practice_models: Fit Models to Simulated Practice Data

Description Usage Arguments Details NLME LMEM GAMM

Description

Fit Models to Simulated Practice Data

Usage

1
2
3
4
5
fit_practice_nlme(dat, start_vals = c(10, 400, 24, 400, -2))

fit_practice_gamm(dat)

fit_practice_lmem(dat)

Arguments

dat

Data frame, the result of sim_practice.

start

Vector of five starting values for nlme, for the values (1) within-effect; (2) asymptote; (3) between-effect; (4) sweep; and (5) learning rate.

Details

fit_practice_nlme fits a Non-Linear Mixed-Effects (NLME) model using nlme; fit_practice_gamm fits a Generalized Additive Mixed-Effects Model (GAMM) using bam with a by-subject factor smooth for trial; fit_practice_lmem fits a Linear Mixed-Effects Model (LMEM) also using bam for comparability to the GAMM, but as it includes no wiggly terms, it is functionally equivalent to a model fit using the lme4 package. For simplicity, all models assume a constant learning rate across subjects.

The exact models are:

NLME

nlme::nlme(y ~ b0 * wij + Asym + sweep * exp(-exp(lrc) * tij), groups = ~ subj_id, dat, fixed = list(b0 ~ 1, Asym ~ bi, sweep ~ 1, lrc ~ 1), random = nlme::pdDiag(b0 + Asym + sweep ~ 1), start = start_vals)

LMEM

mgcv::bam(y ~ wij + bi + s(subj_id, bs = "re") + # random intercept s(wij, subj_id, bs = "re"), # random slope data = dat)

GAMM

mgcv::bam(y ~ wij + bi + s(tij, bs = "tp") + # common smooth s(wij, subj_id, bs = "re") + # random slope s(tij, subj_id, bs = "fs"), # factor smooth (time-varying icept) data = dat)


dalejbarr/autocorr documentation built on March 27, 2021, 3:03 a.m.