hbartqqplot: Predictive qqplot for heterbart

Description Usage Arguments Value Examples

View source: R/hbartqqplot.R

Description

Given results from predict.rbart, gets draws from the predictive distribution at each x and then computes the empirical inverse cdf to get draws which would be uniform if the predicitive were the true distribution. Then draws a qqplot against the uniform. In large enough samples, if the model is correct, the qqplot should look like like a straight line with intercept 0 and slope 1. In small samples, we expect the predictive to be more spread out than the true distribution, even if the model is correct.

Usage

1
hbartqqplot(y,rbmod,nunif=10000,linecolor="red",linewd=3,...)

Arguments

y

y values corresponding to x values given to predict.rbart.

rbmod

Output list from predict.rbart.

nunif

Number of uniform(0,1) draws used in constructing the qqplot.

linecolor,linewd

Line color and width for (0,1) line.

...

Arguments passed on to stats::qqplot.

Value

quantiles of y in draws from the predictive (conditional on each x value).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
##################################################
## please see vignette and/or www.rob-mcculloch.org for more realistic examples
##################################################

## get simulated data
data(simdat)

##get rbart run on the simulated data
data(rbartonsimd)

##  Predictive quantile-quantile plot
temp = hbartqqplot(simdat$yp,rbartonsimd,xlab="predictive quantile",ylab="uniform",
                      cex.axis=1.4,cex.lab=1.2)

rbart documentation built on Aug. 1, 2019, 5:04 p.m.

Related to hbartqqplot in rbart...