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
Given a vector of log-likelihoods, normalise them and exp them without overflow
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
the starting time of the observations
the number of particles to use in the filter
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, State] val pf = filter(resample, 0.0, 100) val data: Source[NotUsed, Data] = // data as an fs2 stream data. through(pf(mod))
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
the resampling scheme
the time to start the filter
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
a vector containing observations
a method of resampling in the particle filter
the number of particles to use in the particle filter
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
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
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
Construct a particle filter to determine the pseudo-marginal likelihood of a POMP model
a sequence of data to determine the likelihood of
the number of particles to use in the particle filter
a value of logLikelihood
Calculate the mean of a state
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 unifomly without replacement
Sample one thing, uniformly, from a collection
Multinomial Resampling, sample from a categorical distribution with probabilities equal to the particle weights
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
Calculate the weighted mean of a particle cloud