Object/Trait

com.github.jonnylaw.model

ParticleFilter

Related Docs: trait ParticleFilter | package model

Permalink

object ParticleFilter

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

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def effectiveSampleSize[F[_]](weights: F[Double])(implicit arg0: Collection[F]): Int

    Permalink

    Calculate the effective sample size of a particle cloud, from the un-normalised weights by first normalising the weights, then calculating the reciprocal of the sum of the squared weights

    Calculate the effective sample size of a particle cloud, from the un-normalised weights by first normalising the weights, then calculating the reciprocal of the sum of the squared weights

    weights

    the unnormalised weights

  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def filter(resample: Resample[State, Id], t0: Time, n: Int): (Model) ⇒ Flow[Data, PfState, NotUsed]

    Permalink

    Construct a particle filter to calculate the state of an Akka Stream of Data

    Construct a particle filter to calculate the state of an Akka Stream of Data

    t0

    the starting time of the observations

    n

    the number of particles to use in the filter

    returns

    a Reader monad representing the function Model => Flow[Task, Data, PfState] When given a Model, this can be used to filter an fs2 stream of data eg: val mod: Model val resample: Resample[F, G, State] val pf = filter(resample, 0.0, 100) val data: Source[NotUsed, Data] = // data as an fs2 stream data. through(pf(mod))

  10. def filterAsync(resample: Resample[State, Future], t0: Time, n: Int)(implicit ec: ExecutionContext): (Model) ⇒ Flow[Data, PfState, NotUsed]

    Permalink
  11. def filterFromPosterior(resample: Resample[(Parameters, State), Id], init: Rand[(Parameters, State)], particles: Int, t: Time)(unparamModel: (Parameters) ⇒ Model)(implicit ec: ExecutionContext): Flow[Data, ParamFilterState, NotUsed]

    Permalink

    Construct a particle filter which starts at time t with a draw from the joint posterior p(x, theta | y) at time t

    Construct a particle filter which starts at time t with a draw from the joint posterior p(x, theta | y) at time t

    resample

    the resampling scheme

    t

    the time to start the filter

  12. def filterFromPosteriorSeq(data: Seq[Data], resample: Resample[(Parameters, State), Id], init: Rand[(Parameters, State)], particles: Int, t: Time)(unparamModel: (Parameters) ⇒ Model)(implicit ec: ExecutionContext): Seq[ParamFilterState]

    Permalink

    Construct a particle filter which starts at time t with a draw from the joint posterior p(x, theta | y) at time t

    Construct a particle filter which starts at time t with a draw from the joint posterior p(x, theta | y) at time t

    resample

    the resampling scheme

    t

    the time to start the filter

  13. def filterInit(resample: Resample[State, Id], t0: Time, n: Int, initState: State): (Model) ⇒ Flow[Data, PfState, NotUsed]

    Permalink

    Filter from a value of the state

  14. def filterLlState(data: Vector[Data], resample: Resample[State, Id], n: Int): (Model) ⇒ Id[(LogLikelihood, Vector[StateSpace])]

    Permalink

    Return the likelihood and a sample from the state path as a tuple

    Return the likelihood and a sample from the state path as a tuple

    data

    a vector containing observations

    resample

    a method of resampling in the particle filter

    n

    the number of particles to use in the particle filter

  15. def filterLlStateAsync(data: Vector[Data], resample: Resample[State, Future], n: Int)(mod: Model)(implicit ec: ExecutionContext): Future[(LogLikelihood, Vector[StateSpace])]

    Permalink

    Return the likelihood and a sample from the state path as a tuple, with parallel implementation of the particle filter

    Return the likelihood and a sample from the state path as a tuple, with parallel implementation of the particle filter

    data

    a vector containing observations

    resample

    a method of resampling in the particle filter

    n

    the number of particles to use in the particle filter

  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  18. def getCredibleInterval(s: Vector[State], n: Int, interval: Double): IndexedSeq[CredibleInterval]

    Permalink

    Get the credible intervals of the nth state vector

    Get the credible intervals of the nth state vector

    s

    a State

    n

    a reference to a node of state tree, counting from 0 on the left

    interval

    the probability interval size

    returns

    a tuple of doubles, (lower, upper)

  19. def getCredibleIntervals(x0: Rand[State], interval: Double): IndexedSeq[CredibleInterval]

    Permalink

    Given a distribution over State, calculate credible intervals by repeatedly drawing from the distribution and ordering the samples

  20. def getForecast(s: PfState, mod: Model, t: Time): Vector[ObservationWithState]

    Permalink

    Given an initial set of particles, representing an approximation of the posterior distribution of the filtering state at time t0, simulate the particles forward calculating the predicted observation distribution and intervals

  21. def getIntervals(mod: Model): (PfState) ⇒ PfOut

    Permalink

    Transforms PfState into PfOut, including gamma, gamma intervals and state intervals

  22. def getMeanForecast(s: PfState, mod: Model, t: Time, interval: Double): ForecastOut

    Permalink

    Given a state of the particle filter, advance the state and calculate the mean of the state, gamma and forecast observation

    Given a state of the particle filter, advance the state and calculate the mean of the state, gamma and forecast observation

    s

    the state of the particle filter

    mod

    the model used to predict the observations

    t

    the time of the prediction

    returns

    ForecastOut, a summary containing the mean of the state, gamma and observation

  23. def getOrderStatistic(samples: Vector[Double], interval: Double): CredibleInterval

    Permalink

    Gets credible intervals for a vector of doubles

    Gets credible intervals for a vector of doubles

    samples

    a vector of samples from a distribution

    interval

    the upper interval of the required credible interval

    returns

    order statistics representing the credible interval of the samples vector

  24. def getallCredibleIntervals(s: Vector[State], interval: Double): IndexedSeq[CredibleInterval]

    Permalink

    Use getCredibleInterval to get all credible intervals of a state

    Use getCredibleInterval to get all credible intervals of a state

    s

    a vector of states

    interval

    the interval for the probability interval between [0,1]

    returns

    a sequence of tuples, (lower, upper) corresponding to each state reading

  25. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  26. def hist(x: Vector[Int]): Unit

    Permalink

    Produces a histogram output of a vector of Data

  27. def indentity[A](samples: Vector[A], weights: Vector[Double]): Vector[A]

    Permalink
  28. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  29. def likelihood(data: Vector[Data], resample: Resample[State, Id], n: Int): (Model) ⇒ Id[LogLikelihood]

    Permalink

    Construct a particle filter to determine the pseudo-marginal likelihood of a POMP model

    Construct a particle filter to determine the pseudo-marginal likelihood of a POMP model

    data

    a sequence of data to determine the likelihood of

    n

    the number of particles to use in the particle filter

    returns

    a value of logLikelihood

  30. def likelihoodAsync(data: Vector[Data], resample: Resample[State, Future], particles: Int)(model: Model)(implicit ec: ExecutionContext): Future[LogLikelihood]

    Permalink

    Calculate the likelihood in parallel

    Calculate the likelihood in parallel

    data

    an ordered Vector of observations

    resample

    an asynchronous resampling vector

    particles

    the total number of particles in the filter

    ec

    an execution context for the asynchronous computations using Future

    returns

    a function from Model => Loglikelihood

  31. def llStateReader(data: Vector[Data], resample: Resample[State, Id], n: Int): Kleisli[Id, Model, (LogLikelihood, Vector[StateSpace])]

    Permalink
  32. def mean[F[_], A](s: F[A])(implicit f: Collection[F], N: Fractional[A]): A

    Permalink
  33. def meanState(x: Vector[State]): State

    Permalink

    Calculate the mean of a state

  34. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  35. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  36. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  37. def sum[F[_], A](l: F[A])(implicit F: Collection[F], N: Numeric[A]): A

    Permalink
  38. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  39. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  40. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. def weightedMean(x: Vector[State], w: Vector[Double]): State

    Permalink

    Calculate the weighted mean of a particle cloud

Inherited from AnyRef

Inherited from Any

Ungrouped