Observations
Observation
EnsembleKalmanProcesses.Observation
— TypeObservation
Structure that contains a (possibly stacked) observation. Defined by sample(s), noise covariance(s), and name(s)
Typical Constructors:
Observation(
Dict(
"samples" => [1,2,3],
"covariances" => I(3),
"names" => "one_two_three",
),
)
or
Observation([1,2,3], I(3), "one_two_three")
One can stack up multiple observations with combine_observations, or by providing vectors of samples, covariances and names to the dictionary.
Fields
samples::AbstractVector
A (vector of) observation vectors
covs::AbstractVector
A (vector of) observation covariance matrices
inv_covs::AbstractVector
A (vector of) inverses of observation covariance matrices
names::AbstractVector
A (vector of) name strings
indices::AbstractVector
A (vector of) indices of the contained observation blocks
EnsembleKalmanProcesses.get_samples
— Functionget_samples(o::Observation) -> AbstractVector
gets the samples
field from the Observation
object
EnsembleKalmanProcesses.get_covs
— Functionget_covs(o::Observation) -> AbstractVector
gets the covs
field from the Observation
object
EnsembleKalmanProcesses.get_inv_covs
— Functionget_inv_covs(o::Observation) -> AbstractVector
gets the inv_covs
field from the Observation
object
EnsembleKalmanProcesses.get_names
— Functionget_names(o::Observation) -> AbstractVector
gets the names
field from the Observation
object
gets the names
field from the ObservationSeries
object
EnsembleKalmanProcesses.get_indices
— Functionget_indices(o::Observation) -> AbstractVector
gets the indices
field from the Observation
object
EnsembleKalmanProcesses.combine_observations
— Functioncombine_observations(obs_vec::AbstractVector) -> Observation{AV1, AV2, AV3, AV4, AV5} where {AV1<:(Vector), AV2<:(Vector), AV3<:(Vector), AV4<:(Vector), AV5<:(Vector)}
combines a vector of Observation
objects into a single Observation
EnsembleKalmanProcesses.get_obs
— Methodget_obs(o::Observation) -> Any
if build=true
, returns the stacked vector of observed samples samples
(default), otherwise it calls get_samples
EnsembleKalmanProcesses.get_obs_noise_cov
— Methodget_obs_noise_cov(o::Observation) -> Any
if build=true
, returns the block matrix of observation covariances covs
(default), otherwise it calls get_covs
EnsembleKalmanProcesses.get_obs_noise_cov_inv
— Methodget_obs_noise_cov_inv(o::Observation) -> Any
if build=true
, returns the block matrix of the inverses of the observation covariances inv_covs
(default), otherwise it calls get_inv_covs
Minibatcher
EnsembleKalmanProcesses.FixedMinibatcher
— TypeFixedMinibatcher <: Minibatcher
A Minibatcher
that takes in a given epoch of batches. It creates a new epoch by either copying-in-order, or by shuffling, the provided batches.
Fields
minibatches::AbstractVector
explicit indices of the minibatched epoch
method::AbstractString
method of selecting minibatches from the list for each epoch ("order" select in order, "random" generate a random selector)
rng::Random.AbstractRNG
rng for sampling, if "random" method is selected
EnsembleKalmanProcesses.no_minibatcher
— Functionno_minibatcher() -> FixedMinibatcher{Vector{_A}, String, Random.TaskLocalRNG} where _A<:(AbstractVector)
no_minibatcher(epoch_size::Int64) -> FixedMinibatcher{Vector{_A}, String, Random.TaskLocalRNG} where _A<:(AbstractVector)
constructs a FixedMinibatcher
of given epoch_size
, that generates an epoch of 1:epoch_size
and one minibatch that constitutes the whole epoch
EnsembleKalmanProcesses.create_new_epoch!
— Methodcreate_new_epoch!(m::FixedMinibatcher, args...) -> Any
updates the epoch by either copying ("order") the initialization minibatches, or by randomizing ("random") their order
EnsembleKalmanProcesses.get_minibatches
— Methodget_minibatches(m::FixedMinibatcher) -> AbstractVector
gets the minibatches
field from the FixedMinibatcher
object
EnsembleKalmanProcesses.get_method
— Methodgets the method
field from the FixedMinibatcher
object
EnsembleKalmanProcesses.get_rng
— Methodgets the rng
field from the FixedMinibatcher
object
EnsembleKalmanProcesses.RandomFixedSizeMinibatcher
— TypeRandomFixedSizeMinibatcher <: Minibatcher
A Minibatcher
that takes in a given epoch of batches. It creates a new epoch by either copying-in-order, or by shuffling, the provided batches.
Fields
minibatch_size::Int64
fixed size of minibatches
method::AbstractString
how to deal with remainder if minibatch-size doesn't divide the epoch size ("trim" - ignore trailing samples, "extend" - have a larger final minibatch)
rng::Random.AbstractRNG
rng for sampling
minibatches::AbstractVector
explicit indices of the minibatched epoch
EnsembleKalmanProcesses.get_minibatch_size
— Methodgets the minibatch_size
field from the RandomFixesSizeMinibatcher
object
EnsembleKalmanProcesses.get_method
— Methodgets the method
field from the RandomFixesSizeMinibatcher
object
EnsembleKalmanProcesses.get_rng
— Methodgets the rng
field from the RandomFixesSizeMinibatcher
object
EnsembleKalmanProcesses.get_minibatches
— Methodget_minibatches(m::RandomFixedSizeMinibatcher) -> AbstractVector
gets the minibatches
field from the RandomFixesSizeMinibatcher
object
ObservationSeries
EnsembleKalmanProcesses.ObservationSeries
— TypeObservationSeries
Structure that contains multiple Observation
s along with an optional Minibatcher
. Stores all observations in EnsembleKalmanProcess
, as well as defining the behavior of the get_obs
, get_obs_noise_cov
, and get_obs_noise_cov_inv
methods
Typical Constructor
ObservationSeries(
Dict(
"observations" => vec_of_observations,
"names" => names_of_observations,
"minibatcher" => minibatcher
),
)
Fields
observations::AbstractVector
A vector of
Observation
s to be used in the experimentminibatcher::Minibatcher
A
Minibatcher
object used to define the minibatchingnames::AbstractVector
A vector of string identifiers for the observations
current_minibatch_index::Dict
The current index (epoch #, minibatch #) of the current minibatch, stored as a Dict
minibatches::AbstractVector
The batch history (grouped by minibatch and epoch)
EnsembleKalmanProcesses.get_observations
— Methodgets the observations
field from the ObservationSeries
object
EnsembleKalmanProcesses.get_minibatches
— Methodgets the minibatches
field from the ObservationSeries
object
EnsembleKalmanProcesses.get_current_minibatch_index
— Methodget_current_minibatch_index(os::ObservationSeries) -> Dict
gets the current_minibatch_index
field from the ObservationSeries
object
EnsembleKalmanProcesses.get_minibatcher
— Methodgets the minibatcher
field from the ObservationSeries
object
EnsembleKalmanProcesses.update_minibatch!
— MethodWithin an epoch: iterates the current minibatch index by one. At the end of an epoch: obtains a new epoch of minibatches from the Minibatcher
updates the epoch index by one, and minibatch index to one.
EnsembleKalmanProcesses.get_current_minibatch
— Methodget the current minibatch that is pointed to by the current_minibatch_indices
field
EnsembleKalmanProcesses.get_obs
— Methodif build=true
then gets the observed sample, stacked over the current minibatch. build=false
lists the samples
for all observations
EnsembleKalmanProcesses.get_obs_noise_cov
— Methodif build=true
then gets the observation covariance matrix, blocked over the current minibatch. build=false
lists the covs
for all observations
EnsembleKalmanProcesses.get_obs_noise_cov_inv
— Methodif build=true
then gets the inverse of the observation covariance matrix, blocked over the current minibatch. build=false
lists the inv_covs
for all observations