Return a vector of lag 1 time differences
Return a vector of lag 1 time differences
a list of times
a list of differenced times
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))
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
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 eta, eta intervals and state intervals
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
Produces a histogram output of a vector of Data
Return the value x such that, F(p) = x, where F is the empirical cumulative distribution function over the particles
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
the resampling scheme to use in the particle filter
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
Sample integers from 1 to n with replacement according to their associated probabilities
Sample integers from 1 to n with replacement according to their associated probabilities
a number matching the number of probabilities
a vector of probabilities corresponding to the probability of sampling that integer
a vector containing the samples
Stratified resampling Sample n ORDERED uniform random numbers (one for each particle) using a linear transformation of a U(0,1) RV
Systematic Resampling Sample n ORDERED numbers (one for each particle), reusing the same U(0,1) variable