Package

com.github.jonnylaw

model

Permalink

package model

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

Type Members

  1. type BootstrapFilter[G[_]] = Kleisli[G, Parameters, (LogLikelihood, Vector[StateSpace])]

    Permalink
  2. case class Branch[A](left: Tree[A], right: Tree[A]) extends Tree[A] with Product with Serializable

    Permalink
  3. case class BranchParameter(left: Parameters, right: Parameters) extends Parameters with Product with Serializable

    Permalink
  4. case class BrownianParameter(m0: Double, c0: Double, mu: Double, sigma: Double) extends SdeParameter with Product with Serializable

    Permalink
  5. trait Collection[F[_]] extends Serializable

    Permalink

    A typeclass representing a Collection with a few additional features required for implementing the particle filter

  6. case class CredibleInterval(lower: Double, upper: Double) extends Product with Serializable

    Permalink

    Credible intervals from a set of samples in a distribution

    Credible intervals from a set of samples in a distribution

    lower

    the lower interval

    upper

    the upper interval

  7. sealed trait Data extends AnyRef

    Permalink

    A single observation of a time series

  8. case class DataFromFile(file: String) extends DataService[Future[IOResult]] with Product with Serializable

    Permalink

    Read a csv file in, where the first column corresponds to the Time, represented as a Double and the second column represents the observation.

    Read a csv file in, where the first column corresponds to the Time, represented as a Double and the second column represents the observation.

    file

    a java.nio.file.Path to a file

  9. case class DataFromJson(file: String) extends DataService[Future[IOResult]] with DataProtocols with Product with Serializable

    Permalink

    Read a JSON file

  10. trait DataProtocols extends DefaultJsonProtocol

    Permalink

    Marshalling from JSON and to JSON for Simulated Data and MCMC data from the Composed Models Package

  11. trait DataService[F] extends AnyRef

    Permalink
  12. case class DecomposedModel(time: Time, observation: Observation, eta: Eta, gamma: Gamma, state: List[Eta]) extends Product with Serializable

    Permalink
  13. type Eta = Double

    Permalink
  14. case class Filter(mod: Model, resample: Resample[State, Id]) extends ParticleFilter[Id] with Product with Serializable

    Permalink

    A particle filter which can represent particle clouds as a Collection, Collection is a typeclass which can currently has concrete methods for Vector and ParVector

  15. case class FilterAsync(mod: Model, resample: Resample[State, Future])(implicit ec: ExecutionContext) extends ParticleFilter[Future] with Product with Serializable

    Permalink
  16. case class FilterInit(mod: Model, resample: Resample[State, Id], initState: State) extends ParticleFilter[Id] with Product with Serializable

    Permalink
  17. case class FilterLgcp(mod: Model, resample: Resample[State, Id], precision: Int) extends ParticleFilter[Id] with Product with Serializable

    Permalink
  18. case class FilterState(unparamModel: (Parameters) ⇒ Model, resample: Resample[(Parameters, State), Id]) extends Product with Serializable

    Permalink

    A particle filter which takes a sample from the joint-posterior of the parameters and state p(x, theta | y)

  19. case class ForecastOut(t: Time, obs: Observation, obsIntervals: CredibleInterval, eta: Double, etaIntervals: CredibleInterval, state: State, stateIntervals: IndexedSeq[CredibleInterval]) extends Product with Serializable

    Permalink

    Forecast data

    Forecast data

    t

    the time of the observation

    obs

    an observation of the process

    obsIntervals

    the upper and lower credible intervals of the observation

    state

    the untransformed latent state

    stateIntervals

    the intervals of the latent state

  20. type Gamma = Double

    Permalink
  21. case class Leaf[A](value: A) extends Tree[A] with Product with Serializable

    Permalink
  22. case class LeafParameter(scale: Option[Double], sdeParam: SdeParameter) extends Parameters with Product with Serializable

    Permalink
  23. type LogLikelihood = Double

    Permalink
  24. case class MetropState(ll: LogLikelihood, params: Parameters, sde: StateSpace, accepted: Int) extends Serializable with Product

    Permalink

    The state of the metropolis-hastings algorithms

    The state of the metropolis-hastings algorithms

    ll

    the log-likelihood of the observations given the latent state and the current parameters

    params

    the current set of parameters

    accepted

    the total number of accepted moves in the metropolis hastings algorithm

  25. trait MetropolisHastings[G[_]] extends AnyRef

    Permalink
  26. trait Model extends AnyRef

    Permalink
  27. case class MultivariateNormal(mean: DenseVector[Double], covariance: DenseMatrix[Double])(implicit rand: RandBasis = Rand) extends Rand[DenseVector[Double]] with Product with Serializable

    Permalink

    Simulate from a multivariate normal using Eigenvalue decomposition Y = Q * Z + mean, where Q = L^0.5 * M

  28. type Observation = Double

    Permalink
  29. case class ObservationWithState(t: Time, observation: Observation, eta: Eta, gamma: Gamma, sdeState: State) extends Data with Product with Serializable

    Permalink

    A single observation of a time series, containing a realisation of the filtering state

    A single observation of a time series, containing a realisation of the filtering state

    observation

    pi(eta), the observation

    eta

    g(gamma), the latent state transformed by the linking-function

    gamma

    f(x_t), the latent state transformed by the linear transformation

    sdeState

    x_t

  30. case class OrnsteinParameter(m0: DenseVector[Double], c0: DenseVector[Double], theta: DenseVector[Double], alpha: DenseVector[Double], sigma: DenseVector[Double]) extends SdeParameter with Product with Serializable

    Permalink
  31. case class OuParameter(m0: Double, c0: Double, theta: Double, alpha: Double, sigma: Double) extends SdeParameter with Product with Serializable

    Permalink
  32. case class ParamFilterState(t: Time, observation: Option[Observation], ps: Vector[(Parameters, State)], ll: LogLikelihood) extends Product with Serializable

    Permalink

    This class represents the state of a a filter starting with a draw from the joint posterior p(x, theta | y) as the filter is applied, the value of the state changes with time, but the parameters, theta, are static

    This class represents the state of a a filter starting with a draw from the joint posterior p(x, theta | y) as the filter is applied, the value of the state changes with time, but the parameters, theta, are static

    t

    the time of the draw from the joint posterior

    observation

    the measurement taken at time t

    ps

    a tuple containing the parameter and state drawn from the joint posterior

  33. sealed trait Parameters extends AnyRef

    Permalink
  34. case class ParamsState(ll: LogLikelihood, params: Parameters, accepted: Int) extends Serializable with Product

    Permalink

    The state of the metropolis-hastings algorithms

    The state of the metropolis-hastings algorithms

    ll

    the log-likelihood of the observations given the latent state and the current parameters

    params

    the current set of parameters

    accepted

    the total number of accepted moves in the metropolis hastings algorithm

  35. trait ParticleFilter[G[_]] extends AnyRef

    Permalink
  36. case class ParticleMetropolisAsync(logLikelihood: (Parameters) ⇒ Future[LogLikelihood], initialParams: Parameters, proposal: (Parameters) ⇒ Rand[Parameters], prior: (Parameters) ⇒ LogLikelihood)(implicit ec: ExecutionContext) extends MetropolisHastings[Future] with Product with Serializable

    Permalink

    Implementation of the particle metropolis algorithm

    Implementation of the particle metropolis algorithm

    logLikelihood

    a function from parameters to LogLikelihood

    initialParams

    the starting parameters for the metropolis algorithm

    proposal

    a SYMMETRIC proposal distribution for the metropolis algorithm (eg. Gaussian)

  37. case class ParticleMetropolisHastingAsync(logLikelihood: (Parameters) ⇒ Future[LogLikelihood], transitionProb: (Parameters, Parameters) ⇒ LogLikelihood, initialParams: Parameters, proposal: (Parameters) ⇒ Rand[Parameters], prior: (Parameters) ⇒ LogLikelihood)(implicit ec: ExecutionContext) extends MetropolisHastings[Future] with Product with Serializable

    Permalink

    Implementation of the particle metropolis algorithm

    Implementation of the particle metropolis algorithm

    logLikelihood

    a function from parameters to LogLikelihood

    initialParams

    the starting parameters for the metropolis algorithm

  38. case class ParticleMetropolisHastingsSerial(logLikelihood: (Parameters) ⇒ Id[LogLikelihood], transitionProb: (Parameters, Parameters) ⇒ LogLikelihood, proposal: (Parameters) ⇒ Rand[Parameters], initialParams: Parameters, prior: (Parameters) ⇒ LogLikelihood) extends MetropolisHastings[Id] with Product with Serializable

    Permalink

    Implementation of the particle metropolis hastings algorithm specified prior distribution

    Implementation of the particle metropolis hastings algorithm specified prior distribution

    logLikelihood

    a function from parameters to LogLikelihood

    proposal

    a generic proposal distribution for the metropolis algorithm (eg. Gaussian)

    initialParams

    the starting parameters for the metropolis algorithm

  39. case class ParticleMetropolisSerial(logLikelihood: (Parameters) ⇒ Id[LogLikelihood], initialParams: Parameters, proposal: (Parameters) ⇒ Rand[Parameters], prior: (Parameters) ⇒ LogLikelihood) extends MetropolisHastings[Id] with Product with Serializable

    Permalink

    Implementation of the particle metropolis algorithm

    Implementation of the particle metropolis algorithm

    logLikelihood

    a function from parameters to LogLikelihood

    initialParams

    the starting parameters for the metropolis algorithm

    proposal

    a SYMMETRIC proposal distribution for the metropolis algorithm (eg. Gaussian)

  40. case class ParticleMetropolisState(pf: (Parameters) ⇒ Id[(LogLikelihood, Vector[StateSpace])], initialParams: Parameters, proposal: (Parameters) ⇒ Rand[Parameters], prior: (Parameters) ⇒ LogLikelihood) extends MetropolisHastings[Id] with Product with Serializable

    Permalink

    Particle Metropolis hastings which also samples the final value of the state

  41. case class ParticleMetropolisStateAsync(pf: (Parameters) ⇒ Future[(LogLikelihood, Vector[StateSpace])], initialParams: Parameters, proposal: (Parameters) ⇒ Rand[Parameters], prior: (Parameters) ⇒ LogLikelihood)(implicit ec: ExecutionContext) extends MetropolisHastings[Future] with Product with Serializable

    Permalink
  42. case class PfOut(time: Time, observation: Option[Observation], eta: Double, etaIntervals: CredibleInterval, state: State, stateIntervals: IndexedSeq[CredibleInterval]) extends Product with Serializable

    Permalink

    A class representing a return type for the particle filter, containing the state and associated credible intervals

    A class representing a return type for the particle filter, containing the state and associated credible intervals

    time

    the time of the process

    observation

    an optional observation, note discretely observed processes cannot be seen at all time points continuously

    state

    the mean of the empirical filtering distribution at time 'time'

  43. case class PfState(t: Time, observation: Option[Observation], particles: Vector[State], ll: LogLikelihood, ess: Int) extends Product with Serializable

    Permalink

    Representation of the state of the particle filter, where the particles are in a Collection typeclass defined in package.scala

    Representation of the state of the particle filter, where the particles are in a Collection typeclass defined in package.scala

    t

    the time of the current observation

    observation

    the current observation at time t

    particles

    a collection containing an approximate sample from the filtering distribution p(x(t) | y(t0:t))

    ll

    the estimated log-likelihood of the path given the observations so far

    ess

    the effective sample size

  44. type Resample[A, F[_]] = (Vector[A], Vector[LogLikelihood]) ⇒ F[Vector[A]]

    Permalink
  45. trait Sde extends AnyRef

    Permalink
  46. sealed trait SdeParameter extends AnyRef

    Permalink
  47. case class SimulateData(model: Model) extends DataService[NotUsed] with Product with Serializable

    Permalink
  48. type State = Tree[DenseVector[Double]]

    Permalink
  49. case class StateSpace(time: Time, state: State) extends Product with Serializable

    Permalink

    Representing a realisation from a stochastic differential equation

  50. type StepFunction = (SdeParameter) ⇒ (State, TimeIncrement) ⇒ Rand[State]

    Permalink
  51. type Time = Double

    Permalink
  52. type TimeIncrement = Double

    Permalink
  53. case class TimedObservation(t: Time, observation: Observation) extends Data with Product with Serializable

    Permalink

    A single observation of a time series

    A single observation of a time series

    observation

    pi(eta), the observation

  54. case class TimestampObservation(timestamp: nscala_time.time.Imports.DateTime, t: Time, observation: Observation) extends Data with Product with Serializable

    Permalink
  55. sealed trait Tree[A] extends AnyRef

    Permalink

    A binary tree implementation, to be used when combining models Hopefully this simplifies "zooming" into values and changing them

  56. type UnparamModel = Kleisli[Id, Parameters, Model]

    Permalink
  57. type UnparamSde = Kleisli[Id, SdeParameter, Sde]

    Permalink
  58. case class Wishart(n: Double, scale: DenseMatrix[Double])(implicit rand: RandBasis = Rand) extends ContinuousDistr[DenseMatrix[Double]] with Moments[DenseMatrix[Double], DenseMatrix[Double]] with Product with Serializable

    Permalink

Value Members

  1. object Collection extends Serializable

    Permalink
  2. object EmptyParameter extends Parameters with Product with Serializable

    Permalink
  3. object MetropolisHastings

    Permalink
  4. object Model

    Permalink
  5. object Parameters

    Permalink
  6. object ParticleFilter

    Permalink
  7. object Resampling

    Permalink
  8. object Sde

    Permalink
  9. object SdeParameter

    Permalink
  10. object SimulateData extends Serializable

    Permalink
  11. object Streaming

    Permalink
  12. object Tree

    Permalink
  13. object Utilities

    Permalink
  14. implicit def credibleIntervalsShow: Show[CredibleInterval]

    Permalink
  15. implicit def dataShow(implicit S: Show[State]): Show[Data]

    Permalink
  16. implicit def decompShow: Show[DecomposedModel]

    Permalink
  17. implicit def filterOutShow(implicit S: Show[State], C: Show[CredibleInterval]): Show[PfOut]

    Permalink
  18. implicit def filterShow(implicit S: Show[State]): Show[PfState]

    Permalink
  19. implicit def forecastOutShow(implicit S: Show[State]): Show[ForecastOut]

    Permalink
  20. implicit def itersShow(implicit S: Show[Parameters], T: Show[StateSpace]): Show[MetropState]

    Permalink
  21. implicit def numericDenseVector: Numeric[DenseVector[Double]]

    Permalink
  22. implicit def parVectorCollection: Collection[ParVector] { ... /* 2 definitions in type refinement */ }

    Permalink
  23. implicit def paramStateShow(implicit S: Show[Parameters]): Show[ParamsState]

    Permalink
  24. implicit def parameterShow(implicit S: Show[SdeParameter]): Show[Parameters]

    Permalink
  25. implicit def randMonad: Monad[Rand]

    Permalink
  26. implicit def sdeParamShow: Show[SdeParameter]

    Permalink
  27. def setParallelismGlobally(numThreads: Int): Unit

    Permalink

    Set the taskSupport for Parallel collections globally for the session using reflection Source: stackoverflow.com/questions/17865823/how-do-i-set-the-default-number-of-threads-for-scala-2-10-parallel-collections

    Set the taskSupport for Parallel collections globally for the session using reflection Source: stackoverflow.com/questions/17865823/how-do-i-set-the-default-number-of-threads-for-scala-2-10-parallel-collections

    numThreads

    the number of threads to use for a parallel collection

  28. implicit val stateShow: Show[State]

    Permalink
  29. implicit def stateSpaceShow(implicit S: Show[State]): Show[StateSpace]

    Permalink
  30. implicit def vectorCollection: Collection[Vector] { ... /* 2 definitions in type refinement */ }

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped