Description Usage Arguments Value Author(s) Examples
Extract function values samples from posterior coefficients samples
1 | getFunctionSamples(x, covName, samples, modelData)
|
x |
the vector of abscissa values (on the original scale!) |
covName |
string with the name of the covariate |
samples |
the samples object (either from
|
modelData |
the corresponding model data object |
the function values 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | ## get some data
attach(longley)
## get model data
md <- modelData(y=Employed,
X=cbind(GNP, Armed.Forces))
## get posterior samples for a specific model configuration
samples <- getSamples(config=c(2, 1),
nSamples=1000L,
modelData=md)
## and then get function samples:
res <- getFunctionSamples(x=
seq(from=min(GNP),
to=max(GNP),
length=100L),
covName="GNP",
samples=samples,
modelData=md)
str(res)
## get model data with cubic splines
md <- modelData(y=Employed,
X=cbind(GNP, Armed.Forces),
nKnots=10L,
splineType="cubic")
## get posterior samples for a specific model configuration
samples <- getSamples(config=c(2, 1),
nSamples=1000L,
modelData=md)
## and then get function samples:
res <- getFunctionSamples(x=
seq(from=min(GNP),
to=max(GNP),
length=100L),
covName="GNP",
samples=samples,
modelData=md)
str(res)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.