plot_fitted: Plot the Bayesian trend filtering fitted values

plot_fittedR Documentation

Plot the Bayesian trend filtering fitted values

Description

Plot the BTF posterior means with posterior credible intervals (pointwise and joint), the observed data, and true curves (if known)

Usage

plot_fitted(
  y,
  mu,
  postY,
  y_true = NULL,
  t01 = NULL,
  include_joint_bands = FALSE
)

Arguments

y

the T x 1 vector of time series observations

mu

the T x 1 vector of fitted values, i.e., posterior expectation of the state variables

postY

the nsims x T matrix of posterior draws from which to compute intervals

y_true

the T x 1 vector of points along the true curve

t01

the observation points; if NULL, assume T equally spaced points from 0 to 1

include_joint_bands

logical; if TRUE, compute simultaneous credible bands

Examples

simdata = simUnivariate(signalName = "doppler", T = 128, RSNR = 7, include_plot = FALSE)
y = simdata$y
out = btf(y)
plot_fitted(y, mu = colMeans(out$mu), postY = out$yhat, y_true = simdata$y_true)

drkowal/dsp documentation built on July 19, 2023, 11:42 a.m.