View source: R/diagnostics_sim.R
| check_model | R Documentation |
Produces a 2x2 or 1x3 panel of diagnostic plots:
QQ plot of PIT residuals vs Uniform (with KS p-value)
Residuals vs fitted (with lowess smoother)
Dispersion histogram (observed variance vs simulated)
Spatial correlogram via Moran's I (if coords provided)
check_model(object, ...)
## Default S3 method:
check_model(object, coords = NULL, nsim = 250L, seed = 123L, ...)
object |
A fitted model with |
... |
Passed to methods. |
coords |
Optional N x 2 coordinate matrix for spatial panel |
nsim |
Number of simulations (default 250) |
seed |
Random seed (default 123) |
Invisible list with ks_p, disp_ratio, moran (if spatial)
set.seed(1)
d <- data.frame(x = rnorm(80))
d$y <- rpois(80, exp(0.3 + 0.5 * d$x))
fit <- tulpa(y ~ x, data = d, family = "poisson", mode = "laplace")
check_model(fit, nsim = 50)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.