Open bielim opened 3 years ago
I agree with these points.
Perhaps a good way to think about these changes, is let's say we have a new method called Unperfumed
. What must we create for such an object to be used in the tool:
Unperfumed
process, dependent on the Prior
and other algorithmic parametersconstruct_initial_ensemble(process::Unperfumed)
update_ensemble(EnsembleKalmanProcess{...,Unperfumed}, ...)
get_solution(EnsembleKalmanProcess{...,Unperfumed})
As you say, currently we don't have a process dependent initial ensemble creation, nor a process dependent way of obtaining the solution.These Kalman methods will always return a mean and covariance, it may be worth always returning both so long as in the docs we state clearly that the EKI covariance does not have a statistical meaning (though people still may wish to obtain it) .
EnsembleKalmanProcesses.jl
currently contains three Ensemble Kalman methods: Ensemble Kalman Inversion (EKI), Ensemble Kalman Sampling (EKS), and Unscented Kalman Inversion (UKI). Ideally, these three methods can be used through a common interface, which highlights their conceptual similarities while abstracting away their differences to the extent possible.Goal: The general idea is that an
EnsembleKalmanProcess
should be constructed from the observational mean, the covariance of the observational noise, and aProcess
struct (Inversion
,Sampler
, orUnscented
), which contains the additional information that is needed for the particular process type. The construction of anEnsembleKalmanProcess
should also include the generation of the initial ensemble of particles.The signature of all
EnsembleKalmanProcess
outer constructors should thus look as follows:EnsembleKalmanProcess(obs_mean::Array{Float64, 1}, obs_cov::Array{Float64, 2}, process::Process)
Current status: At the moment, there are two
EnsembleKalmanProcess
outer constructors: a constructor forInversion
andSampler
processes, and a constructor forUnscented
processes. In EKI and EKS, the ensemble of initial particles is generated prior to the construction of anEnsembleKalmanProcess
, and the initial ensemble is then passed as an argument to the constructor, whereas in UKI the initial ensemble is generated as part of the construction. Both constructors take a time step argument\Delta t
, which actually remains unused in UKI (see issue #16).To do: The unified interface outlined above requires the following changes:
[ ] Move the construction of the initial ensemble (done by
construct_initial_ensemble
) into theEnsembleKalmanProcess
constructor for EKI and EKS[ ]
construct_initial_ensemble
takes the prior (aParameterDistribution
object) and the desired ensemble sizeN_ens
as inputs, so these two pieces of information have to be added to theInversion
andSampler
structs.[ ] The prior mean and covariance currently stored in the
Sampler
struct can be removed, as this information can be derived from the prior distribution[ ] Remove the time step \Delta t from the
EnsembleKalmanProcess
constructors and add it to theInversion
andSampler
structs instead (theUnscented
struct doesn't need a \Delta t)[ ] A nice additional feature to have would be a function
get_solution(ekp::EnsembleKalmanProcess)
, which returns the solution of the particular Ensemble Kalman process (e.g., the mean of the final iteration for EKI, or the mean and covariance for EKS).