object StochasticVolatility
Simulate and fit a Stochastic volatility model using a mixture model approximation for the non-linear dynamics for either a AR(1) latent-state or OU latent state
Y_t = sigma * exp(a_t / 2), sigma ~ N(0, 1) a_t = phi * a_t + eta, eta ~ N(0, sigma_eta)
- Alphabetic
- By Inheritance
- StochasticVolatility
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
arLikelihood(alphas: Vector[Double], p: SvParameters): Double
Log-Likelihood of the AR(1) process
Log-Likelihood of the AR(1) process
- p
the current value of the parameters
- returns
the log-likelihood
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def initialStateOu(p: SvParameters, ys: Vector[(Double, Option[Double])]): Rand[Vector[SampleState]]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
observation(at: Double): Rand[Double]
The observation function for the stochastic volatility model
-
def
ouLikelihood(p: SvParameters, alphas: Vector[(Double, Double)]): Double
Marginal log likelihood of the OU process used to perform the Metropolis Hastings steps to learn the static parameters
Marginal log likelihood of the OU process used to perform the Metropolis Hastings steps to learn the static parameters
- returns
the log likelihood of the state given the static parameter values
- def sampleBeta(priorPhi: ContinuousDistr[Double], priorMu: Gaussian, priorSigma: InverseGamma, ys: Vector[(Double, Option[Double])]): Process[StochVolState]
-
def
sampleKt(ys: Vector[Option[Double]], alphas: Vector[Double]): Vector[Int]
Sample the indices for the mixture model
Sample the indices for the mixture model
- ys
a collection of observations
- alphas
the latent log-volatility
-
def
sampleMu(prior: Gaussian, p: SvParameters, alphas: Vector[Double]): Rand[Double]
Sample mu from the autoregressive state space, from a Gaussian distribution
Sample mu from the autoregressive state space, from a Gaussian distribution
- prior
a Gaussian prior for the parameter
- returns
a function from the current state of the Markov chain to a new state with a new mu sampled from the Gaussian posterior distribution
-
def
sampleMuOu(prior: ContinuousDistr[Double], delta: Double = 0.05, p: SvParameters, alphas: Vector[(Double, Double)]): (Double) ⇒ Rand[(Double, Int)]
Sample the mean from the OU process using a metropolis step
Sample the mean from the OU process using a metropolis step
- prior
a prior distribution for the mean parameter, mu
- delta
the standard deviation of the (Gaussian) proposal distribution
- def sampleOu(priorPhi: ContinuousDistr[Double], priorMu: ContinuousDistr[Double], priorSigma: InverseGamma, params: SvParameters, ys: Vector[(Double, Option[Double])]): Process[StochVolState]
-
def
samplePhi(prior: ContinuousDistr[Double], p: SvParameters, alpha: Vector[Double], tau: Double, lambda: Double): (Double) ⇒ Rand[Double]
Sample Phi using a Beta proposal distribution
Sample Phi using a Beta proposal distribution
- prior
a prior distribution for the parameter phi
- tau
a small tuning parameter for the beta proposal
- lambda
a tuning parameter for the beta proposal distribution
- returns
a Metropolis Hastings step sampling the value of Phi
-
def
samplePhiOu(prior: ContinuousDistr[Double], p: SvParameters, alphas: Vector[(Double, Double)], lambda: Double = 10.0, tau: Double = 0.05): (Double) ⇒ Rand[(Double, Int)]
Sample the autoregressive parameter (between 0 and 1)
-
def
sampleSigma(prior: InverseGamma, p: SvParameters, alphas: Vector[Double]): Rand[Double]
Sample sigma from the an inverse gamma distribution (sqrt)
Sample sigma from the an inverse gamma distribution (sqrt)
- prior
the prior for the variance of the noise of the latent-state
- p
the current value of the parameters
- alphas
the current value of the latent-state
- returns
a distribution over the system variance
-
def
sampleSigmaMetropOu(prior: ContinuousDistr[Double], delta: Double = 0.05, p: SvParameters, alphas: Vector[(Double, Double)]): (Double) ⇒ Rand[(Double, Int)]
Metropolis step to sample the value of sigma_eta
- def sampleStateAr(ys: Vector[(Double, Option[Double])], params: SvParameters, alphas: Vector[SampleState]): Rand[Vector[SampleState]]
- def sampleStateOu(ys: Vector[(Double, Option[Double])], params: SvParameters, alphas: Vector[SampleState]): Rand[Vector[SampleState]]
- def sampleTau(prior: Gamma, p: SvParameters, alphas: Vector[Double]): Gamma
- def sampleUni(priorPhi: Gaussian, priorMu: Gaussian, priorSigma: InverseGamma, ys: Vector[(Double, Option[Double])]): Process[StochVolState]
-
def
simOu(p: SvParameters, times: Stream[Double]): Stream[(Double, Option[Double], Double)]
Simulate from a Stochastic Volatility model with Ornstein-Uhlenbeck latent State
- def simStep(time: Double, p: SvParameters)(state: Double): Rand[(Double, Option[Double], Double)]
-
def
simulate(p: SvParameters): Process[(Double, Option[Double], Double)]
Simulate regularly from a stochastic volatility model with AR(1) latent-state
- def stepBeta(priorPhi: ContinuousDistr[Double], priorMu: Gaussian, priorSigma: InverseGamma, ys: Vector[(Double, Option[Double])]): (StochVolState) ⇒ Rand[StochVolState]
-
def
stepOu(priorPhi: ContinuousDistr[Double], priorMu: ContinuousDistr[Double], priorSigma: InverseGamma, ys: Vector[(Double, Option[Double])])(s: StochVolState): Rand[StochVolState]
Perform a single step of the MCMC Kernel for the SV with OU latent state Using independent Metropolis-Hastings moves
-
def
stepOu(p: SvParameters, at: Double, dt: Double): ContinuousDistr[Double]
Advance the state of the OU process
- def stepState(p: SvParameters, at: Double): ContinuousDistr[Double]
- def stepUni(priorPhi: Gaussian, priorMu: Gaussian, priorSigma: InverseGamma, ys: Vector[(Double, Option[Double])]): (StochVolState) ⇒ Rand[StochVolState]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )