Generic cumulative sum
Calculate the empirical cumulative distribution function for a collection of 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
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
the unnormalised weights
Construct a particle filter to calculate the state of an fs2 Stream of Data
Construct a particle filter to calculate the state of an fs2 Stream of Data
the starting time of the observations
the number of particles to use in the filter
a Reader monad representing the function Model => Pipe[Task, Data, PfState] When given a Model, this can be used to filter an fs2 stream of data eg: val mod: Model val pf = filter(0.0, 100) val data: Stream[Task, Data] = // data as an fs2 stream data. through(pf(mod))
Get the credible intervals of the nth state vector
Get the credible intervals of the nth state vector
a State
a reference to a node of state tree, counting from 0 on the left
the probability interval size
a tuple of doubles, (lower, upper)
Given a distribution over State, calculate credible intervals by repeatedly drawing from the distribution and ordering the samples
Transforms PfState into PfOut, including gamma, gamma intervals and state intervals
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
the state of the particle filter
the model used to predict the observations
the time of the prediction
ForecastOut, a summary containing the mean of the state, gamma and observation
Gets credible intervals for a vector of doubles
Gets credible intervals for a vector of doubles
a vector of samples from a distribution
the upper interval of the required credible interval
order statistics representing the credible interval of the samples vector
Use getCredibleInterval to get all credible intervals of a state
Use getCredibleInterval to get all credible intervals of a state
a vector of states
the interval for the probability interval between [0,1]
a sequence of tuples, (lower, upper) corresponding to each state reading
Produces a histogram output of a vector of Data
Construct a particle filter to determine the pseudo-marginal likelihood of a POMP model This function returns the Reader Monad (Reader[Model, LogLikelihood]) which means the function can be composed with a model: val mod: Reader[Parameters, Model] = // any model here val mll: Reader[Parameters, Likelihood] = likelihood(_, _, _) compose mod To get the function back from inside the Reader monad, simply use mll.run
Construct a particle filter to determine the pseudo-marginal likelihood of a POMP model This function returns the Reader Monad (Reader[Model, LogLikelihood]) which means the function can be composed with a model: val mod: Reader[Parameters, Model] = // any model here val mll: Reader[Parameters, Likelihood] = likelihood(_, _, _) compose mod To get the function back from inside the Reader monad, simply use mll.run
a sequence of data to determine the likelihood of
the number of particles to use in the particle filter
a function from model to logLikelihood
Calculate the mean of a state
Multinomial Resampling, sample from a categorical distribution with probabilities equal to the particle weights
Given a vector of doubles, returns a normalised vector with probabilities summing to one
Given a vector of doubles, returns a normalised vector with probabilities summing to one
a vector of unnormalised probabilities
a vector of normalised probabilities
Residual Resampling Select particles in proportion to their weights, ie particle xi appears ki = n * wi times Resample m (= n - total allocated particles) particles according to w = n * wi - ki using other resampling technique
Stratified resampling Sample n ORDERED uniform random numbers (one for each particle) using a linear transformation of a U(0,1) RV
Generic systematic Resampling
Generic systematic Resampling
Write SBT doctest scalacheck tests
Calculate the weighted mean of a particle cloud