You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the covariance function (in the Gaussian process / random field sense) used for computing the mean and covariance of the (Gaussian) optimal proposal is hardcoded in the following
Separately each model is expected to define a update_particle_noise! method which perturbs the state particles (post propagating forwards in time under the deterministic model dynamics) with additive Gaussian state / process noise. In both the currently implemented TDAC model in test/model and in @DanGiles' ongoing implementation of the SPEEDY model in #203 the update_particle_noise! methods use the GaussianRandomFields package to sample a Gaussian random field to use as the additive Gaussian state noise. GaussianRandomFields itself provides methods for evaluating a covariance function at one or multiple pairs of points.
The current covariance implementation in src/OptimalFilter.jl hardcodes both the family of covariance function and the specific parameterization used. If a model uses a covariance function from a different family or from the same family but with a different parameterization then the state noise covariances computed to construct the optimal proposal and in simulating the state noise will not match and lead to incorrect results.
If the covariance implementation in src/OptimalFilter.jl was instead passed the CovarianceStructure struct used to define the state noise Gaussian random field, and used the apply method from GaussianRandomFields internally, this would both ensure consistency between the definitions without having to worry about the particular parameterization used and also allow the implementation to straight away generalize to any of the other stationary covariance functions defined in GaussianRandomFields.
As a related point, it is not entirely clear if the covariance function definition for the TDAC model does match that in the optimal proposal implementation currently. In
grf =GaussianRandomField(cov, CirculantEmbedding(), x, y, minpadding=pad, primes=primes)
v = grf.data[1]
xi =Array{eltype(grf.cov)}(undef, size(v)..., nthreads())
w =Array{complex(float(eltype(v)))}(undef, size(v)..., nthreads())
z =Array{eltype(grf.cov)}(undef, length.(grf.pts)..., nthreads())
RandomField(grf, xi, w, z)
end
return [_generate(l, n, s) for (l, n, s) inzip(lambda, nu, sigma)]
end
the state noise Gaussian random field (for the fields for each of the three state variables) is set to have a Matern covariance function with lengthscale parameter lambda = 1e4, smoothness parameter nu = 2.5 and marginal standard deviation sigma = 1. The documentation for the Matern covariance function in the GaussianRandomFields package suggests the corresponding covariance function definition is
with rho(x_1, x_2) = sum(abs(x_1 .- x_y).^2). While the Matern covariance (under a different parametrization) does simplify for certain values of the smoothness parameter nu it is not clear this matches the corresponding defnition in OptimalFilter.jl
Currently the covariance function (in the Gaussian process / random field sense) used for computing the mean and covariance of the (Gaussian) optimal proposal is hardcoded in the following
ParticleDA.jl/src/OptimalFilter.jl
Lines 48 to 53 in c278bbc
Separately each model is expected to define a
update_particle_noise!
method which perturbs the state particles (post propagating forwards in time under the deterministic model dynamics) with additive Gaussian state / process noise. In both the currently implemented TDAC model intest/model
and in @DanGiles' ongoing implementation of the SPEEDY model in #203 theupdate_particle_noise!
methods use theGaussianRandomFields
package to sample a Gaussian random field to use as the additive Gaussian state noise.GaussianRandomFields
itself provides methods for evaluating a covariance function at one or multiple pairs of points.The current
covariance
implementation insrc/OptimalFilter.jl
hardcodes both the family of covariance function and the specific parameterization used. If a model uses a covariance function from a different family or from the same family but with a different parameterization then the state noise covariances computed to construct the optimal proposal and in simulating the state noise will not match and lead to incorrect results.If the
covariance
implementation insrc/OptimalFilter.jl
was instead passed theCovarianceStructure
struct used to define the state noise Gaussian random field, and used theapply
method fromGaussianRandomFields
internally, this would both ensure consistency between the definitions without having to worry about the particular parameterization used and also allow the implementation to straight away generalize to any of the other stationary covariance functions defined inGaussianRandomFields
.As a related point, it is not entirely clear if the covariance function definition for the TDAC model does match that in the optimal proposal implementation currently. In
ParticleDA.jl/test/model/model.jl
Lines 250 to 272 in c278bbc
the state noise Gaussian random field (for the fields for each of the three state variables) is set to have a Matern covariance function with lengthscale parameter
lambda = 1e4
, smoothness parameternu = 2.5
and marginal standard deviationsigma = 1
. The documentation for the Matern covariance function in theGaussianRandomFields
package suggests the corresponding covariance function definition iswith
rho(x_1, x_2) = sum(abs(x_1 .- x_y).^2)
. While the Matern covariance (under a different parametrization) does simplify for certain values of the smoothness parameternu
it is not clear this matches the corresponding defnition inOptimalFilter.jl
The text was updated successfully, but these errors were encountered: