A model augmented with parameter perturbations for iterated filtering.
tfp.experimental.sequential.IteratedFilter(
parameter_prior,
parameterized_initial_state_prior_fn,
parameterized_transition_fn,
parameterized_observation_fn,
parameterized_initial_state_proposal_fn=None,
parameterized_proposal_fn=None,
parameter_constraining_bijector=None,
name=None
)
Args |
parameter_prior
|
prior tfd.Distribution over parameters (may be a joint
distribution).
|
parameterized_initial_state_prior_fn
|
callable with signature
initial_state_prior = parameterized_initial_state_prior_fn(parameters)
where parameters has the form of a sample from parameter_prior ,
and initial_state_prior is a distribution over the initial state.
|
parameterized_transition_fn
|
callable with signature
next_state_dist = parameterized_transition_fn(
step, state, parameters, **kwargs) .
|
parameterized_observation_fn
|
callable with signature
observation_dist = parameterized_observation_fn(
step, state, parameters, **kwargs) .
|
parameterized_initial_state_proposal_fn
|
optional callable with
signature initial_state_proposal =
parameterized_initial_state_proposal_fn(parameters) where parameters
has the form of a sample from parameter_prior , and
initial_state_proposal is a distribution over the initial state.
|
parameterized_proposal_fn
|
optional callable with signature
next_state_dist = parameterized_transition_fn(
step, state, parameters, **kwargs) .
Default value: None .
|
parameter_constraining_bijector
|
optional tfb.Bijector instance
such that parameter_constraining_bijector.forward(x) returns valid
parameters for any real-valued x of the same structure and shape
as parameters . If None , the default bijector of the provided
parameter_prior will be used.
Default value: None .
|
name
|
str name for ops constructed by this object.
Default value: iterated_filter .
|
Attributes |
batch_ndims
|
|
joint_initial_state_prior
|
Initial state prior for the joint (augmented) model.
|
joint_observation_fn
|
Observation function for the joint (augmented) model.
|
joint_proposal_fn
|
Proposal function for the joint (augmented) model.
|
joint_transition_fn
|
Transition function for the joint (augmented) model.
|
name
|
|
parameter_constraining_bijector
|
Bijector mapping unconstrained real values into the parameter space.
|
parameter_prior
|
Prior distribution on parameters passed in at construction.
|
parameterized_initial_state_prior_fn
|
Prior function that was passed in at construction.
|
parameterized_initial_state_proposal_fn
|
Initial proposal function passed in at construction.
|
Methods
estimate_parameters
View source
estimate_parameters(
observations,
num_iterations,
num_particles,
initial_perturbation_scale,
cooling_schedule,
seed=None,
name=None,
**kwargs
)
Runs multiple iterations of filtering following a cooling schedule.
Args |
observations
|
observed Tensor value(s) on which to condition the
parameter estimate.
|
num_iterations
|
int Tensor number of filtering iterations to run.
|
num_particles
|
scalar int Tensor number of particles to use.
|
initial_perturbation_scale
|
scalar float Tensor , or any structure of
float Tensor s broadcasting to the same shape as the (unconstrained)
parameters, specifying the scale (standard deviation) of Gaussian
perturbations to each parameter at the first timestep.
|
cooling_schedule
|
callable with signature
cooling_factor = cooling_schedule(iteration) for iteration in
[0, ..., num_iterations - 1] . The filter is
invoked with perturbations of scale
initial_perturbation_scale * cooling_schedule(iteration) .
|
seed
|
PRNG seed; see tfp.random.sanitize_seed for details.
|
name
|
str name for ops constructed by this method.
|
**kwargs
|
additional keyword arguments passed to
tfp.experimental.mcmc.infer_trajectories .
|
Returns |
final_parameter_particles
|
structure of Tensor s matching
self.parameter_prior , each with batch shape
[num_iterations, num_particles] . These are the populations
of particles representing the parameter estimate after each iteration
of filtering.
|
joint_initial_state_proposal
View source
joint_initial_state_proposal(
initial_unconstrained_parameters=None
)
Proposal to initialize the model with given parameter particles.
one_step
View source
one_step(
observations,
perturbation_scale,
num_particles,
initial_unconstrained_parameters=None,
seed=None,
name=None,
**kwargs
)
Runs one step of filtering to sharpen parameter estimates.
Args |
observations
|
observed Tensor value(s) on which to condition the
parameter estimate.
|
perturbation_scale
|
scalar float Tensor , or any structure of float
Tensor s broadcasting to the same shape as the unconstrained
parameters, specifying the scale (standard deviation) of Gaussian
perturbations to each parameter at each timestep.
|
num_particles
|
scalar int Tensor number of particles to use. Must match
the batch dimension of initial_unconstrained_parameters , if specified.
|
initial_unconstrained_parameters
|
optional structure of Tensor s, of
shape matching
self.joint_initial_state_prior.sample([
num_particles]).unconstrained_parameters ,
used to initialize the filter.
Default value: None .
|
seed
|
PRNG seed; see tfp.random.sanitize_seed for details.
|
name
|
str name for ops constructed by this method.
|
**kwargs
|
additional keyword arguments passed to
tfp.experimental.mcmc.infer_trajectories .
|
Returns |
final_unconstrained_parameters
|
structure of Tensor s matching
initial_unconstrained_parameters , containing samples of
unconstrained parameters at the final timestep, as computed by
self.filter_fn .
|