{'fraction_non_alphanumeric': 0.05135658914728682, 'fraction_numerical': 0.0048449612403100775, 'mean_word_length': 5.112426035502959, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Computation of Standardized Residuals for MARSS Models

This report shows how to compute the variance of the joint conditional model and state residuals for multivariate autoregressive Gaussian state-space (MARSS) models. The MARSS model can be written: x(t)=Bx(t-1)+u+w(t), y(t)=Zx(t)+a+v(t), where w(t) and v(t) are multivariate normal error-terms with variance-covariance matrices Q and R respectively. The joint conditional residuals are the w(t) and v(t) conditioned on a set of, possibly incomplete, data y. Harvey, Koopman and Penzer (1998) show a recursive algorithm for these residuals. I show the equation for the residuals using the conditional variances of the states and the conditional covariance between unobserved data and states. This allows one to compute the variance of un-observed residuals, which could be useful for leave-one-out cross-validation tests. I also show how to modify the Harvey et al algorithm in the case of missing values and how to modify it to return the non-normalized conditional residuals.