diff --git a/previews/PR16/index.html b/previews/PR16/index.html index fd81cf9..d2560c6 100644 --- a/previews/PR16/index.html +++ b/previews/PR16/index.html @@ -25,4 +25,4 @@ particles[i] = transition!!(rng, t, particles[i]) logweights[i] += emission_logdensity(t, particles[i]) end -end

Interface

SSMProblems.AbstractStateSpaceModelType
source
SSMProblems.dimensionMethod
dimension(::Type{AbstractStateSpaceModel})

Returns the dimension of the state space for a given model type

source
SSMProblems.emission_logdensityFunction
emission_logdensity(step, model, particle[, cache])

Compute the log potential of current particle. This effectively "reweight" each particle.

source
SSMProblems.isdoneFunction
isdone(step, model, particle[, cache])

Determine whether we have reached the last time step of the Markov process. Return true if yes, otherwise return false.

source
SSMProblems.transition!!Function
transition!!(rng, step, particle[, cache])

Simulate the particle for the next time step from the forward dynamics.

source
SSMProblems.transition_logdensityFunction
transition_logdensity(step, model, particle, x[, cache])

(Optional) Computes the log-density of the forward transition if the density is available.

source
+end

Interface

SSMProblems.AbstractStateSpaceModelType
source
SSMProblems.emission_logdensityFunction
emission_logdensity(step, model, particle[, cache])

Compute the log potential of current particle. This effectively "reweight" each particle.

source
SSMProblems.isdoneFunction
isdone(step, model, particle[, cache])

Determine whether we have reached the last time step of the Markov process. Return true if yes, otherwise return false.

source
SSMProblems.particleofMethod
particleof(::Type{AbstractStateSpaceModel})
source
SSMProblems.transition!!Function
transition!!(rng, step, model, particle[, cache])

Simulate the particle for the next time step from the forward dynamics.

source
SSMProblems.transition_logdensityFunction
transition_logdensity(step, model, particle, x[, cache])

(Optional) Computes the log-density of the forward transition if the density is available.

source
diff --git a/previews/PR16/search/index.html b/previews/PR16/search/index.html index d58d9d4..a7ae0da 100644 --- a/previews/PR16/search/index.html +++ b/previews/PR16/search/index.html @@ -1,2 +1,2 @@ -Search · SSMProblems

Loading search...

    +Search · SSMProblems

    Loading search...

      diff --git a/previews/PR16/search_index.js b/previews/PR16/search_index.js index ea714e5..7465d45 100644 --- a/previews/PR16/search_index.js +++ b/previews/PR16/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"#SSMProblems","page":"Home","title":"SSMProblems","text":"","category":"section"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"In the julia REPL:","category":"page"},{"location":"","page":"Home","title":"Home","text":"]add SSMProblems","category":"page"},{"location":"#Documentation","page":"Home","title":"Documentation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The package defines a generic interface to work with State Space Problems (SSM). The main objective is to provide a consistent interface to work with SSMs and their logdensities.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Consider a markovian model from[Murray]: (Image: state space model)","category":"page"},{"location":"","page":"Home","title":"Home","text":"[Murray]: Murray, Lawrence & Lee, Anthony & Jacob, Pierre. (2013). Rethinking resampling in the particle filter on graphics processing","category":"page"},{"location":"","page":"Home","title":"Home","text":"units. ","category":"page"},{"location":"","page":"Home","title":"Home","text":"The model is fully specified by the following densities:","category":"page"},{"location":"","page":"Home","title":"Home","text":"Initialisation: f_0(x)\nTransition: f(x)\nEmission: g(x)","category":"page"},{"location":"","page":"Home","title":"Home","text":"And the dynamics of the model reduces to:","category":"page"},{"location":"","page":"Home","title":"Home","text":"x_t x_t-1 sim f(x_t x_t-1)","category":"page"},{"location":"","page":"Home","title":"Home","text":"y_t x_t sim g(y_t x_t)","category":"page"},{"location":"","page":"Home","title":"Home","text":"assuming x_0 sim f_0(x). The joint law is then fully described:","category":"page"},{"location":"","page":"Home","title":"Home","text":"p(x_0T y_0T) = f_0x_0 prod_t g(y_t x_t) f(x_t x_t-1)","category":"page"},{"location":"","page":"Home","title":"Home","text":"Model users can define their SSM using the following interface:","category":"page"},{"location":"","page":"Home","title":"Home","text":"\nstruct Model <: AbstractParticle end\n\nfunction transition!!(rng, step, model::Model) \n if step == 1\n ... # Sample from the initial density\n end\n ... # Sample from the transition density\nend\n\nfunction emission_logdensity(step, model::Model) \n ... # Return log density of the model at\nend\n\nisdone(step, model::Model) = ... # Define the stopping criterion\n\n# Optionally, if the transition density is known, the model can also specify it\nfunction transition_logdensity(step, particle, x)\n ... # Scores the forward transition at `x`\nend","category":"page"},{"location":"","page":"Home","title":"Home","text":"Package users can then consume the model logdensity through calls to emission_logdensity. ","category":"page"},{"location":"","page":"Home","title":"Home","text":"For example, a bootstrap filter targeting the filtering distribution p(x_t y_0t) using N particles would read:","category":"page"},{"location":"","page":"Home","title":"Home","text":"while !isdone(t, model)\n ancestors = resample(rng, logweigths)\n particles = particles[ancestors]\n for i in 1:N\n particles[i] = transition!!(rng, t, particles[i])\n logweights[i] += emission_logdensity(t, particles[i])\n end\nend","category":"page"},{"location":"#Interface","page":"Home","title":"Interface","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Modules = [SSMProblems]\nOrder = [:type, :function]","category":"page"},{"location":"#SSMProblems.AbstractStateSpaceModel","page":"Home","title":"SSMProblems.AbstractStateSpaceModel","text":"\n\n\n\n","category":"type"},{"location":"#SSMProblems.dimension-Tuple{Type{<:AbstractStateSpaceModel}}","page":"Home","title":"SSMProblems.dimension","text":"dimension(::Type{AbstractStateSpaceModel})\n\nReturns the dimension of the state space for a given model type\n\n\n\n\n\n","category":"method"},{"location":"#SSMProblems.emission_logdensity","page":"Home","title":"SSMProblems.emission_logdensity","text":"emission_logdensity(step, model, particle[, cache])\n\nCompute the log potential of current particle. This effectively \"reweight\" each particle.\n\n\n\n\n\n","category":"function"},{"location":"#SSMProblems.isdone","page":"Home","title":"SSMProblems.isdone","text":"isdone(step, model, particle[, cache])\n\nDetermine whether we have reached the last time step of the Markov process. Return true if yes, otherwise return false.\n\n\n\n\n\n","category":"function"},{"location":"#SSMProblems.transition!!","page":"Home","title":"SSMProblems.transition!!","text":"transition!!(rng, step, particle[, cache])\n\nSimulate the particle for the next time step from the forward dynamics.\n\n\n\n\n\n","category":"function"},{"location":"#SSMProblems.transition_logdensity","page":"Home","title":"SSMProblems.transition_logdensity","text":"transition_logdensity(step, model, particle, x[, cache])\n\n(Optional) Computes the log-density of the forward transition if the density is available.\n\n\n\n\n\n","category":"function"}] +[{"location":"#SSMProblems","page":"Home","title":"SSMProblems","text":"","category":"section"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"In the julia REPL:","category":"page"},{"location":"","page":"Home","title":"Home","text":"]add SSMProblems","category":"page"},{"location":"#Documentation","page":"Home","title":"Documentation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"The package defines a generic interface to work with State Space Problems (SSM). The main objective is to provide a consistent interface to work with SSMs and their logdensities.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Consider a markovian model from[Murray]: (Image: state space model)","category":"page"},{"location":"","page":"Home","title":"Home","text":"[Murray]: Murray, Lawrence & Lee, Anthony & Jacob, Pierre. (2013). Rethinking resampling in the particle filter on graphics processing","category":"page"},{"location":"","page":"Home","title":"Home","text":"units. ","category":"page"},{"location":"","page":"Home","title":"Home","text":"The model is fully specified by the following densities:","category":"page"},{"location":"","page":"Home","title":"Home","text":"Initialisation: f_0(x)\nTransition: f(x)\nEmission: g(x)","category":"page"},{"location":"","page":"Home","title":"Home","text":"And the dynamics of the model reduces to:","category":"page"},{"location":"","page":"Home","title":"Home","text":"x_t x_t-1 sim f(x_t x_t-1)","category":"page"},{"location":"","page":"Home","title":"Home","text":"y_t x_t sim g(y_t x_t)","category":"page"},{"location":"","page":"Home","title":"Home","text":"assuming x_0 sim f_0(x). The joint law is then fully described:","category":"page"},{"location":"","page":"Home","title":"Home","text":"p(x_0T y_0T) = f_0x_0 prod_t g(y_t x_t) f(x_t x_t-1)","category":"page"},{"location":"","page":"Home","title":"Home","text":"Model users can define their SSM using the following interface:","category":"page"},{"location":"","page":"Home","title":"Home","text":"\nstruct Model <: AbstractParticle end\n\nfunction transition!!(rng, step, model::Model) \n if step == 1\n ... # Sample from the initial density\n end\n ... # Sample from the transition density\nend\n\nfunction emission_logdensity(step, model::Model) \n ... # Return log density of the model at\nend\n\nisdone(step, model::Model) = ... # Define the stopping criterion\n\n# Optionally, if the transition density is known, the model can also specify it\nfunction transition_logdensity(step, particle, x)\n ... # Scores the forward transition at `x`\nend","category":"page"},{"location":"","page":"Home","title":"Home","text":"Package users can then consume the model logdensity through calls to emission_logdensity. ","category":"page"},{"location":"","page":"Home","title":"Home","text":"For example, a bootstrap filter targeting the filtering distribution p(x_t y_0t) using N particles would read:","category":"page"},{"location":"","page":"Home","title":"Home","text":"while !isdone(t, model)\n ancestors = resample(rng, logweigths)\n particles = particles[ancestors]\n for i in 1:N\n particles[i] = transition!!(rng, t, particles[i])\n logweights[i] += emission_logdensity(t, particles[i])\n end\nend","category":"page"},{"location":"#Interface","page":"Home","title":"Interface","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"Modules = [SSMProblems]\nOrder = [:type, :function]","category":"page"},{"location":"#SSMProblems.AbstractStateSpaceModel","page":"Home","title":"SSMProblems.AbstractStateSpaceModel","text":"\n\n\n\n","category":"type"},{"location":"#SSMProblems.emission_logdensity","page":"Home","title":"SSMProblems.emission_logdensity","text":"emission_logdensity(step, model, particle[, cache])\n\nCompute the log potential of current particle. This effectively \"reweight\" each particle.\n\n\n\n\n\n","category":"function"},{"location":"#SSMProblems.isdone","page":"Home","title":"SSMProblems.isdone","text":"isdone(step, model, particle[, cache])\n\nDetermine whether we have reached the last time step of the Markov process. Return true if yes, otherwise return false.\n\n\n\n\n\n","category":"function"},{"location":"#SSMProblems.particleof-Tuple{Type{AbstractStateSpaceModel}}","page":"Home","title":"SSMProblems.particleof","text":"particleof(::Type{AbstractStateSpaceModel})\n\n\n\n\n\n","category":"method"},{"location":"#SSMProblems.transition!!","page":"Home","title":"SSMProblems.transition!!","text":"transition!!(rng, step, model, particle[, cache])\n\nSimulate the particle for the next time step from the forward dynamics.\n\n\n\n\n\n","category":"function"},{"location":"#SSMProblems.transition_logdensity","page":"Home","title":"SSMProblems.transition_logdensity","text":"transition_logdensity(step, model, particle, x[, cache])\n\n(Optional) Computes the log-density of the forward transition if the density is available.\n\n\n\n\n\n","category":"function"}] }