Description Usage Arguments Value Author(s) Examples
Extract fit samples on linear predictor scale from posterior coefficients samples
1 | getFitSamples(X, samples, modelData)
|
X |
the numeric matrix with new covariate values on
the original scale, with the same column layout as
originally provided to |
samples |
the samples object (either from
|
modelData |
the corresponding model data object |
the fit samples as a matrix.
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 | ## get some data
attach(longley)
## get model data
X <- cbind(GNP, Armed.Forces)
md <- modelData(y=Employed,
X=X)
## get posterior samples for a specific model configuration
samples <- getSamples(config=c(2, 1),
nSamples=1000L,
modelData=md)
## and then get fit samples at the original X:
res <- getFitSamples(X=X,
samples=samples,
modelData=md)
str(res)
## this must also work for BMA samples:
tab <- exhaustive(modelData=md)$models
samples <- getBmaSamples(config=tab,
logPostProbs=tab$logMargLik,
nSamples=1000L,
modelData=md)
str(samples)
res <- getFitSamples(X=X,
samples=samples,
modelData=md)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.