updatesummary {stochvol} | R Documentation |
Updating the Summary of MCMC Draws
Description
Creates or updates a summary of an svdraws
object.
Usage
updatesummary(
x,
quantiles = c(0.05, 0.5, 0.95),
esspara = TRUE,
esslatent = FALSE
)
Arguments
x |
|
quantiles |
numeric vector of posterior quantiles to be computed. The
default is |
esspara |
logical value which indicates whether the effective sample
size (ESS) should be calculated for the parameter draws. This is
achieved by calling |
esslatent |
logical value which indicates whether the effective sample
size (ESS) should be calculated for the latent log-volatility draws.
This is achieved by calling |
Details
updatesummary
will always calculate the posterior mean and the
posterior standard deviation of the raw draws and some common
transformations thereof. Moroever, the posterior quantiles, specified by the
argument quantiles
, are computed. If esspara
and/or
esslatent
are TRUE
, the corresponding effective sample size
(ESS) will also be included.
Value
The value returned is an updated list object of class svdraws
holding
para |
|
latent |
|
latent0 |
|
y |
argument |
runtime |
|
priors |
|
thinning |
|
summary |
|
To display the output, use print
, summary
and plot
. The
print
method simply prints the posterior draws (which is very likely
a lot of output); the summary
method displays the summary statistics
currently stored in the object; the plot
method gives a graphical
overview of the posterior distribution by calling volplot
,
traceplot
and densplot
and displaying the
results on a single page.
Note
updatesummary
does not actually overwrite the object's current
summary, but in fact creates a new object with an updated summary. Thus,
don't forget to overwrite the old object if this is want you intend to do.
See the examples below for more details.
See Also
Examples
## Here is a baby-example to illustrate the idea.
## Simulate an SV time series of length 51 with default parameters:
sim <- svsim(51)
## Draw from the posterior:
res <- svsample(sim$y, draws = 2000, priorphi = c(10, 1.5))
## Check out the results:
summary(res)
plot(res)
## Look at other quantiles and calculate ESS of latents:
newquants <- c(0.01, 0.05, 0.25, 0.5, 0.75, 0.95, 0.99)
res <- updatesummary(res, quantiles = newquants, esslatent = TRUE)
## See the difference?
summary(res)
plot(res)