o

dlm.core.model

FactorSv

object FactorSv

Model a large covariance matrix using a factor structure

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FactorSv
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class State(params: FsvParameters, factors: Vector[(Double, Option[DenseVector[Double]])], volatility: Vector[SamplingState]) extends Product with Serializable

    The state of the Gibbs Sampler

    The state of the Gibbs Sampler

    factors

    the current sample of the time series of factors k x n dimensional

    volatility

    the current sample of the time series of variances, k x n dimensional

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def buildBeta(p: Int, k: Int, prior: ⇒ Double): DenseMatrix[Double]

    Build a beta matrix from a prior distribution

    Build a beta matrix from a prior distribution

    p

    the dimension of the rows of beta

    k

    the dimension of the columns of beta

    prior

    a lazily evaluated prior distribution

    returns

    a beta matrix with ones on the leading diagonal, zeros above and draws from the prior distribution elsewhere

  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  7. def combineStates(s: Vector[Vector[SampleState]]): Vector[SamplingState]
  8. def encodePartiallyMissing(obs: Vector[Data]): Vector[(Double, Option[DenseVector[Double]])]

    Encode partially missing data as totally missing in order to sample the factors

    Encode partially missing data as totally missing in order to sample the factors

    obs

    a vector of observations

  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def extractFactors(fs: Vector[(Double, Option[DenseVector[Double]])], i: Int): Vector[(Double, Option[Double])]

    Extract the ith factor from a multivariate vector of factors

  12. def extractState(vs: Vector[SamplingState], i: Int): Vector[SampleState]

    Extract a single state from a vector of states

    Extract a single state from a vector of states

    vs

    the combined state

    i

    the position of the state to extract

    returns

    the extracted state

  13. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def getithObs(y: Vector[Data], i: Int): Vector[Option[Double]]

    Select the ith observation from a vector of data representing a multivariate time series

    Select the ith observation from a vector of data representing a multivariate time series

    y

    a vector of data

    i

    the index of the observation to select

    returns

    a vector containing the ith observation of a multivariate time series

  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def initialiseFactors(beta: DenseMatrix[Double], observations: Vector[Data], sigmaY: DenseMatrix[Double]): Rand[Vector[(Double, Option[DenseVector[Double]])]]

    Initialise the factors

    Initialise the factors

    beta

    the factor loading matrix

    observations

    a vector containing observations of the process

    sigmaY

    The observation error variance

    returns

    the factors sampled from a multivariate normal distribution

  18. def initialiseStateAr(initP: FsvParameters, observations: Vector[Data], k: Int): State

    Initialise the state for the Factor SV model with AR(1) latent state

  19. def initialiseStateOu(initP: FsvParameters, observations: Vector[Data], k: Int): State

    Initialise the state for the Factor SV model with OU latent state

  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def makeBeta(p: Int, k: Int): DenseMatrix[Double]

    Make an empty beta matrix Make a p x k matrix with 1s on the diagonal and zeros elsewhere

    Make an empty beta matrix Make a p x k matrix with 1s on the diagonal and zeros elsewhere

    p

    the rows of the matrix corresponding to the number of time series to model

    k

    the number of factors

    returns

    a p x k matrix with 1s on leading diagonal

  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. def rnorm(mean: DenseVector[Double], prec: DenseMatrix[Double]): Rand[DenseVector[Double]]

    Generate a random draw from the multivariate normal distribution Using the precision matrix

  26. def sampleAr(priorBeta: Gaussian, priorSigmaEta: InverseGamma, priorMu: Gaussian, priorPhi: Gaussian, priorSigma: InverseGamma, observations: Vector[Data], initP: FsvParameters): Process[State]

    Gibbs sampling for the factor stochastic volatility model with AR(1) latent-state

    Gibbs sampling for the factor stochastic volatility model with AR(1) latent-state

    priorBeta

    the prior for the non-zero elements of the factor loading matrix

    priorSigmaEta

    the prior for the state evolution noise

    priorPhi

    the prior for the mean reverting factor phi

    priorSigma

    the prior for the variance of the measurement noise

    observations

    a vector of time series results

    initP

    the parameters of the Factor model

    returns

    a markov chain

  27. def sampleBeta(prior: Gaussian, ys: Vector[Data], p: Int, k: Int, fs: Vector[(Double, Option[DenseVector[Double]])], v: DenseMatrix[Double]): DenseMatrix[Double]

    Sample a value of beta using the function sampleBetaRow

    Sample a value of beta using the function sampleBetaRow

    prior

    the prior distribution to be used for each element of beta

    p

    the dimension of a single observation vector

    k

    the dimension of the latent-volatilities

  28. def sampleBetaRow(prior: Gaussian, factors: Vector[(Double, Option[DenseVector[Double]])], observations: Vector[Data], sigma: Double, i: Int, k: Int): DenseVector[Double]

    The rows, i = 1,...,p of a k-factor model of Beta can be updated with Gibbs step The prior specification is b_ij ~ N(0, C0) i > j, b_ii = 1, b_ij = 0 for j > i This is a helper function for sampleBeta

    The rows, i = 1,...,p of a k-factor model of Beta can be updated with Gibbs step The prior specification is b_ij ~ N(0, C0) i > j, b_ii = 1, b_ij = 0 for j > i This is a helper function for sampleBeta

    prior

    a multivariate normal prior distribution for each column

    factors

    the current value of latent factors

    sigma

    the variance of the measurement error

    i

    the row number

    k

    the total number of factors in the model

    returns

    the full conditional distribution of the

  29. def sampleFactors(observations: Vector[Data], p: FsvParameters, volatility: Vector[SamplingState]): Rand[Vector[(Double, Option[DenseVector[Double]])]]

    Sample the factors from a multivariate gaussian

    Sample the factors from a multivariate gaussian

    observations

    the observations of the time series

    volatility

    the current value of the volatility

  30. def sampleOu(priorBeta: Gaussian, priorSigmaEta: InverseGamma, priorMu: Gaussian, priorPhi: Beta, priorSigma: InverseGamma, observations: Vector[Data], initP: FsvParameters): Process[State]
  31. def sampleSigmaUni(prior: InverseGamma, ys: Vector[Data], params: FsvParameters, fs: Vector[(Double, Option[DenseVector[Double]])]): Rand[DenseMatrix[Double]]

    Update the value of the variance in the observation model, a diagonal matrix filled with identical values

    Update the value of the variance in the observation model, a diagonal matrix filled with identical values

    prior

    an inverse gamma

    ys

    the observations

    returns

    the sampled value of sigma

  32. def sampleStep(priorBeta: Gaussian, priorSigmaEta: InverseGamma, priorMu: Gaussian, priorPhi: Gaussian, priorSigma: InverseGamma, observations: Vector[Data], p: Int, k: Int)(s: State): Rand[State]

    Gibbs step for the factor stochastic volatility model

  33. def sampleVolatilityAr(p: Int, params: FsvParameters, factors: Vector[(Double, Option[DenseVector[Double]])], volatility: Vector[SamplingState]): Rand[Vector[SamplingState]]

    Sample the log-volatility of a factor model

  34. def sampleVolatilityOu(p: Int, params: FsvParameters, factors: Vector[(Double, Option[DenseVector[Double]])], volatility: Vector[SamplingState]): Vector[SamplingState]

    Sample the log-volatility of a factor model

  35. def sampleVolatilityParamsAr(priorPhi: Gaussian, priorMu: Gaussian, priorSigmaEta: InverseGamma, p: Int)(s: State): Rand[State]

    Sample each of the factor states and parameters in turn

    Sample each of the factor states and parameters in turn

    priorMu

    a Normal prior for the mean of the AR(1) process

    priorSigmaEta

    an inverse Gamma prior for the variance of the AR(1) process

    p

    an integer specifying the dimension of the observations

    s

    the current state of the MCMC algorithm

  36. def sampleVolatilityParamsOu(priorMu: Gaussian, priorSigmaEta: InverseGamma, priorPhi: Beta, p: Int)(s: State): Rand[State]

    Sample each of the factor states and parameters in turn

    Sample each of the factor states and parameters in turn

    priorMu

    a Normal prior for the mean of the OU

    priorSigmaEta

    an inverse Gamma prior for the variance of the OU process

    priorPhi

    a Beta prior on the mean reversion parameter phi

    p

    an integer specifying the dimension of the observations

    s

    the current state of the MCMC algorithm

  37. def simStep(t: Double, params: FsvParameters)(a: Vector[Double]): Rand[(Data, Vector[Double], Vector[Double])]

    A single step for simulating a factor stochastic volatility model

    A single step for simulating a factor stochastic volatility model

    t

    the current time of the realisation

    params

    the parameters of the stochastic volatility model

    a

    the current log volatilities of the factors

  38. def simulate(p: FsvParameters): Process[(Data, Vector[Double], Vector[Double])]
  39. def stepOu(priorBeta: Gaussian, priorSigmaEta: InverseGamma, priorMu: Gaussian, priorPhi: Beta, priorSigma: InverseGamma, observations: Vector[Data], p: Int, k: Int): (State) ⇒ Rand[State]
  40. def sumFactors(factors: Vector[(Double, Option[DenseVector[Double]])]): DenseMatrix[Double]
  41. def sumFactorsObservations(facs: Vector[(Double, Option[DenseVector[Double]])], obs: Vector[Option[Double]]): DenseVector[Double]

    Sum the product of f and y

    Sum the product of f and y

    facs

    the latent factors

    obs

    the observations of the ith time series

    returns

    the squared sum of the product of factors and observations

  42. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  43. def toString(): String
    Definition Classes
    AnyRef → Any
  44. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped