Description Usage Arguments Value Author(s) Examples
Plot function value estimates
1 2 3 4 5 6 7 8 | plotCurveEstimate(covName, samples, modelData,
nGrid = 200L, plevel = 0.95, slevel = plevel,
partialResids = TRUE, hpd = TRUE,
estimate = c("mean", "median"), plot = TRUE, ...,
ylim = NULL, lty = c(1, 2, 2, 2, 2),
col = c("black", "blue", "blue", "green", "green"),
xlab = covName,
ylab = paste("f(", covName, ")", sep = ""))
|
covName |
string with the name of the covariate |
samples |
the samples object (either from
|
modelData |
the corresponding model data object |
nGrid |
number of abscissa values for the grid (default: 200) |
plevel |
credible level for the pointwise credible
intervals (default: 0.95, and |
slevel |
credible level for simultaneous credible
band (defaults to |
partialResids |
add partial residuals to the plot? (default, is only possible for normal models) |
hpd |
use HPD intervals / bands? (default) Otherwise equi-tailed intervals / bands are computed and plotted. |
plot |
produce a plot? (default: yes) Otherwise you could use the returned information to produce the plot yourself |
estimate |
type of the estimated curve |
ylim |
y axis limits (has a sensible default to include all points in the plot) |
lty |
line type for (1) mean curve and (2, 3)
credible interval bounds (default: |
col |
line color(s) (default: black, blue, blue, green, green) |
xlab |
x axis label (default: |
ylab |
y axis label (default: f( |
... |
... additional plotting parameters |
A list with the elements x.grid
and
lineData
, containing the x axis grid and the
different y values for plotting, respectively.
Daniel Sabanes Bove daniel.sabanesbove@ifspm.uzh.ch
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ## get some data
attach(longley)
## get model data
md <- modelData(y=Employed,
X=cbind(GNP, Armed.Forces),
gPrior="hyper-g")
## get posterior samples for a specific model configuration
samples <- getSamples(config=c(2, 1),
nSamples=1000L,
modelData=md)
str(samples)
summary(samples$t)
## and plot resulting curve estimates:
par(mfrow=c(1, 2))
plotCurveEstimate(covName="GNP",
samples=samples,
modelData=md)
plotCurveEstimate(covName="Armed.Forces",
samples=samples,
modelData=md)
plotCurveEstimate(covName="Armed.Forces",
samples=samples,
modelData=md,
hpd=FALSE,
estimate="median")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.