sim.dir <- file.path(find.package("bayesLife"), "ex-data", "bayesLife.output")
resid <- compute.residuals(sim.dir, burnin = 30)
lws <- compute.loess(residuals = resid)
# plot residuals and loess
plot(resid$x, resid$y, ylim = c(0, 4))
lines(lws$x, lws$y, col = "red")
Run the code above in your browser using DataLab