Learn R Programming

stochvol (version 1.1.3)

svsample2: Minimal overhead version of svsample.

Description

svsample2 is a minimal overhead version of svsample with slightly different default arguments and a simplified return value structure. It is intended to be used mainly for one-step updates where speed is an issue, e.g., as a plug-in into other MCMC samplers. Note that absolutely no input checking is performed, thus this function is to be used with proper care!

Usage

svsample2(y, draws = 1, burnin = 0, priormu = c(0, 100),
	  priorphi = c(5, 1.5), priorsigma = 1, priornu = NA,
	  thinpara = 1, thinlatent = 1, thintime = 1,
	  quiet = TRUE, startpara, startlatent)

Arguments

y
numeric vector containing the data (usually log-returns), which must not contain zeroes.
draws
single number greater or equal to 1, indicating the number of draws after burn-in (see below). Will be automatically coerced to integer. The defaults value is 1.
burnin
single number greater or equal to 0, indicating the number of draws discarded as burn-in. Will be automatically coerced to integer. The default value is 0.
priormu
numeric vector of length 2, indicating mean and standard deviation for the Gaussian prior distribution of the parameter mu, the level of the log-volatility. The default value is c(0, 100), which constitutes a practically uninform
priorphi
numeric vector of length 2, indicating the shape parameters for the Beta prior distribution of the transformed parameter (phi+1)/2, where phi denotes the persistence of the log-volatility. The default value is c(5, 1.5)
priorsigma
single positive real number, which stands for the scaling of the transformed parameter sigma^2, where sigma denotes the volatility of log-volatility. More precisely, sigma^2 ~ priorsigma * chisq(df = 1). The default
priornu
numeric vector of length 2 (or NA), indicating the lower and upper bounds for the uniform prior distribution of the parameter nu, the degrees-of-freedom parameter of the conditional innovations t-distribution. The default value i
thinpara
single number greater or equal to 1, coercible to integer. Every thinparath parameter draw is kept and returned. The default value is 1, corresponding to no thinning of the parameter draws -- every draw is stored.
thinlatent
single number greater or equal to 1, coercible to integer. Every thinlatentth latent variable draw is kept and returned. The default value is 1, corresponding to no thinning of the latent variable draws, i.e. every draw is kept.
thintime
single number greater or equal to 1, coercible to integer. If thintime is different from 1, only every thintimeth latent log-volatility is being monitored. If, e.g., thintime = 3, the latent log-volatilities h_
quiet
logical value indicating whether the progress bar and other informative output during sampling should be omitted. The default value is TRUE, implying non-verbose output.
startpara
compulsory named list, containing the starting values for the parameter draws. startpara must contain three elements named mu, phi, and sigma, where mu is an arbitrary numerical val
startlatent
compulsory vector of length length(x$y), containing the starting values for the latent log-volatility draws.

Value

  • A list with three components:
  • para3 times draws matrix containing the parameter draws. If priornu is not NA, this is a 4 times draws matrix.
  • latentlength(y) times draws matrix containing draws of the latent variables h_1, ..., h_n.
  • latent0Vector of length draws containing the draw(s) of the initial latent variable h_0.

encoding

UTF-8

Warning

Expert use only! For most applications, the use of svsample is recommended.

Details

As opposed to the ordinary svsample, the default values differ for draws, burnin, and quiet. Note that currently neither expert nor ... arguments are provided.

See Also

svsample