6 Algorithm 878: Exact VARMA Likelihood and Its Gradient for Complete and Incomplete Data with Matlab KRISTJAN JONASSON University of Iceland Matlab functions for the evaluation of the exact log-likelihood of VAR and VARMA time series mod- els are presented (vector autoregressive moving average). The functions accept incomplete data, and calculate analytical gradients, which may be used in parameter estimation with numerical likelihood maximization. Allowance is made for possible savings when estimating seasonal, struc- tured or distributed lag models. Also provided is a function for creating simulated VARMA time series that have an accurate distribution from term one (they are spin-up free). The functions are accompanied by a a simple example driver, a program demonstrating their use for real parameter fitting, as well as a test suite for verifying their correctness and aid further development. The article concludes with description of numerical results obtained with the algorithm. Categories and Subject Descriptors: G.3 [Probability and Statistics]—Multivariate statistics; Statistical software; Stochastic processes; Time series analysis; G.4 [Mathematical Software]— Algorithm design and analysis; Documentation; Efficiency; Matlab; I.6 [Simulation and Mod- elling]: Miscellaneous; J.2 [Computer Applications]: Physical Sciences and Engineering; J.4 [Computer Applications]: Social and Behavioural Sciences—Economics General Terms: Documentation, Verification, Algorithms Additional Key Words and Phrases: Exact likelihood function, missing values, incomplete data, ARMA, VARMA, vector autoregressive moving average model. ACM Reference Format: Jonasson, K. 2008. Algorithm 878: Exact VARMA likelihood and its gradient for complete and incomplete data with Matlab. ACM Trans. Math. Softw. 35, 1, Article 6 (July 2008), 11 pages. DOI = 10.1145/1377603.1377609 http://doi.acm.org/10.1145/1377603.1377609 1. INTRODUCTION Algorithm 878 consists of Matlab functions to aid in the analysis of multi- variate time series models. There are three functions for evaluating exact Author’s address: K. Jonasson, Department of Computer Science, Faculty of Engineering, Univer- sity of Iceland, Hjardarhaga 4, 107 Reykjavik, Iceland; email: jonasson@hi.is. Permission to make digital or hard copies part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or direct commercial advantage and that copies show this notice on the first page or initial screen of a display along with the full citation. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers, to redistribute to lists, or to use any component of this work in other works requires prior specific per- mission and/or a fee. Permissions may be requested from the Publications Dept., ACM, Inc., 2 Penn Plaza, Suite 701, New York, NY 10121-0701 USA, fax +1 (212) 869-0481, or permissions@acm.org. C 2008 ACM 0098-3500/2008/07-ART6 $5.00 DOI 10.1145/1377603.1377609 http://doi.acm.org/ 10.1145/1377603.1377609 ACM Transactions on Mathematical Software, Vol. 35, No. 1, Article 6, Publication date: July 2008.