Electa-Git / PowerModelsDistributionStateEstimation.jl

A Julia Package for Power System State Estimation.
BSD 3-Clause "New" or "Revised" License
32 stars 12 forks source link

State estimation criterion, global vs local #32

Closed timmyfaraday closed 3 years ago

timmyfaraday commented 3 years ago

For the Gaussian Mixture Model, 'dummy' gaussian variables need to be added for those measurements which have a criterion "gmm". The cleanest way to do this is:

gmv = _PMD.var(pm, nw)[:gmv] = Dict(i => JuMP.@variable(pm.model, [c in 1:ncds, n = 1:N], base_name = "$(nw)_gmv_$(i)", ) for i in _PMD.ids(pm, nw, :meas) if _PMD.ref(pm, nw, :meas, i, "crit") == "gmm" )

This only introduces these variables if the local criterion is "gmm", significantly limiting the variable space.

However, given the current implementation of the "crit", this is only included if the global criterion is "mixed", and not in general. This makes the above implementation impossible and would require first evaluating whether the global criterion is "mixed" to then evaluate whether the local criterion is "gmm".

Would it not be cleaner to set the local criterion for all measurements? This would also simplify some code in the constraint.jl. This way the global criterion "mixed" can also be deprecated.

MartaVanin commented 3 years ago

ok, I think I'll do the following: 1) always check for individual criterion only 2) deprecate "mixed" 3) "rwlav", "wls", etc. stay but call a preprocessing function that just associates that criterion to all individual measurement 4) adapt constraint.jl as per above

MartaVanin commented 3 years ago

PS: I'll do the same for the rescaler, so we can give different rescalers to wls-like criteria and mle-like criteria (might not be advantageous but I'll try to test it a bit)

timmyfaraday commented 3 years ago

The rescaler needs to be a global variable, no? Otherwise, this will incorrectly prefer the wrong measurements.

MartaVanin commented 3 years ago

which you might want to do for wls-like vs mle criteria, no? all other cases would be wrong, I agree with that