knitr::opts_chunk$set(echo = TRUE, eval = FALSE)

To eventually be put into a vignette?

Overall steps:

  1. Assemble data (by user)
    • Visualize data
  2. Check user-assembled data
  3. Preprocess data for desired BAM variant
  4. Set priors
    • Use defaults
  5. Selection of settings (n chains, chain length, etc.)
  6. Estimate parameters
bamdat <- bam_data(w, h, s) # Creates an object that Stan can use

plot(bamdat)

bamest <- bam_estimate(data)

mypriors <- bam_priors(cvQc = 0.5)
# mylimits <- bam_limits(Q = c(0, 10000)) # <---- now including these in bam_priors

bamest2 <- bam_estimate(data, priors = mypriors)

plot(bamest$Q)
plot(bamest$loglik)
  1. Diagnose convergence
  2. Plot output
  3. Validate
bam_convergence(bamest) #use bayesplot package to diagnose convergence metrics
bam_validate(bamest, qobs) # returns a list. Or an object with a plot() method.


markwh/bamr documentation built on Aug. 7, 2020, 11:52 p.m.