atmos_flux_inversion.psas module¶
Inversions using Physical-Space Assimilation System.
Iterative observation-space algorithm.
-
atmos_flux_inversion.psas.
fold_common
(background, background_covariance, observations, observation_covariance, observation_operator, reduced_background_covariance=None, reduced_observation_operator=None)[source]¶ Solve the inversion problem, in a slightly optimized manner.
Assumes all arrays fit in memory with room to spare. Evaluates each sub-expression only once. Uses the algorithm from
atmos_flux_inversion.optimal_interpolation.fold_common()
with an iterative solver for the matrix inversion.Assumes everything follows a multivariate normal distribution with the specified covariance matrices. Under this assumption analysis_covariance is exact, and analysis is the Maximum Likelihood Estimator and the Best Linear Unbiased Estimator for the underlying state in the frequentist framework, and specify the posterior distribution for the state in the Bayesian framework. If these are not satisfied, these still form the Generalized Least Squares estimates for the state and an estimated uncertainty.
- Parameters
background (array_like[N]) – The background state estimate.
background_covariance (array_like[N, N]) – Covariance of background state estimate across realizations/ensemble members. “Ensemble” is here interpreted in the sense used in statistical mechanics or frequentist statistics, and may not be derived from a sample as in meteorological ensemble Kalman filters
observations (array_like[M]) – The observations constraining the background estimate.
observation_covariance (array_like[M, M]) – Covariance of observations across realizations/ensemble members. “Ensemble” again has the statistical meaning.
observation_operator (array_like[M, N]) – The relationship between the state and the observations.
reduced_background_covariance (array_like[Nred, Nred], optional) – The covariance for a smaller state space, usually obtained by reducing resolution in space and time. Note that reduced_observation_operator must also be provided
reduced_observation_operator (array_like[M, Nred], optional) – The relationship between the reduced state space and the observations. Note that reduced_background_covariance must also be provided.
- Returns
analysis (array_like[N]) – Analysis state estimate
analysis_covariance (array_like[Nred, Nred] or array_like[N, N]) – Estimated uncertainty of analysis across realizations/ensemble members. Calculated using reduced_background_covariance and reduced_observation_operator if possible
- Raises
ConvergenceError – If iterative solver does not converge
Notes
Performs the matrix inversion in the Kalman gain
\[K = B H^T (HBH^T + R)^{-1}\]approximately, with an iterative algorithm. There is an approximation to the analysis covariance, but it is very bad.
-
atmos_flux_inversion.psas.
simple
(background, background_covariance, observations, observation_covariance, observation_operator, reduced_background_covariance=None, reduced_observation_operator=None)[source]¶ Solve the inversion problem, using the equations directly.
Assumes all arrays fit in memory with room to spare. This uses the algorithm from
atmos_flux_inversion.optimal_interpolation.simple()
, except the matrix inversion is done with an iterative solver.Assumes everything follows a multivariate normal distribution with the specified covariance matrices. Under this assumption analysis_covariance is exact, and analysis is the Maximum Likelihood Estimator and the Best Linear Unbiased Estimator for the underlying state in the frequentist framework, and specify the posterior distribution for the state in the Bayesian framework. If these are not satisfied, these still form the Generalized Least Squares estimates for the state and an estimated uncertainty.
- Parameters
background (array_like[N]) – The background state estimate.
background_covariance (array_like[N, N]) – Covariance of background state estimate across realizations/ensemble members. “Ensemble” is here interpreted in the sense used in statistical mechanics or frequentist statistics, and may not be derived from a sample as in meteorological ensemble Kalman filters
observations (array_like[M]) – The observations constraining the background estimate.
observation_covariance (array_like[M, M]) – Covariance of observations across realizations/ensemble members. “Ensemble” again has the statistical meaning.
observation_operator (array_like[M, N]) – The relationship between the state and the observations.
reduced_background_covariance (array_like[Nred, Nred], optional) – The covariance for a smaller state space, usually obtained by reducing resolution in space and time. Note that reduced_observation_operator must also be provided
reduced_observation_operator (array_like[M, Nred], optional) – The relationship between the reduced state space and the observations. Note that reduced_background_covariance must also be provided.
- Returns
analysis (array_like[N]) – Analysis state estimate
analysis_covariance (array_like[Nred, Nred] or array_like[N, N]) – Estimated uncertainty of analysis across realizations/ensemble members. Calculated using reduced_background_covariance and reduced_observation_operator if possible
- Raises
ConvergenceError – If iterative solver does not converge
Notes
Performs the matrix inversion in the Kalman gain
\[K = B H^T (HBH^T + R)^{-1}\]approximately, with an iterative algorithm. There is an approximation to the analysis covariance, but it is very bad.