Matlab code associated with manuscript "Lognormal and Mixed Gaussian–Lognormal Kalman Filters" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Abstract In this paper we shall present the derivation of two new forms of the Kalman filter equations; the first is for a pure lognormally distributed random variable, while the second set of Kalman filter equations will be for a combination of Gaussian and lognormally distributed random variables. We shall show that the appearance is similar to that of the Gaussian based equations, but that the analytical state is a multivariate median and not the mean. We shall show results of the mixed distribution Kalman filter with the Lorenz 1963 model with lognormal errors for the background and observations of the $z$ component, and compare them to results and forecasts from a traditional Gaussian based Kalman filter and show that under certain circumstances the new approach produces more accurate results. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Contact: Dr. Steven J. Fletcher, Cooperative Institute for Research in the Atmosphere (CIRA), Colorado State University (CSU) Email: steven.fletcher@colostate.edu Format: m file (MATLAB) This MATLAB code applies the new mixed Gaussian-Lognormal Kalman filter (MXKF) to the Lorenz 1963 model with lognormally distributed errors for the z component, both background and observational errors, and Gaussian distributed errors for the x and y components, again for both background and observational errors, and compares it to the performance of the Extended Kalman Filter (EKF). The code is based upon 4 different command line questions for the user to select options, or enter values for certain components. The four queries are: 1) Please select the number of time steps between observations: 1=25, 2=50, 3=100, 4=200, 2) Is there noise on the observations:, 1=no, 2=yes, 3) How to read noise?, 1=Generate in program, 2=Read from file, 4) Please enter the value of the observational error variance, Once the two methods have been completed, the program produces two sets of plots: The first figure contain two subplots that show the z and x trajectories respectively for the true trajectory (red), the MXKF (Blue), and the EKF (black). The observations are also plotted as green circles. The second figure again contains two sublpots, but now we have the geometric analysis errors for z component in the top plot (z_a/z_t), and the additive analysis errors for the x component in the bottom plot (x_a-x_t). The errors associated with the MXKF are the solid black lines, while the dashed black lines are associated with the EKF.