[Please ask questions and report bugs on the gretl mailing list if possible.] This package implements multivariate tests for the dimension of the common stochastic trend components. This is like the multivariate generalization of the univariate KPSS test which has I(0) under the null hypothesis and I(1) (a stochastic trend) under the alternative. Just like the KPSS test is a kind of reversed Dickey-Fuller test in terms of the hypothesis pair, this common-trends test is a kind of reversed Johansen test for cointegration. This package provides the plain case (see Nyblom&Harvey) and a subset of the extensions in the presence of deterministic structural breaks (see Busetti; only the cases with a shift in the mean are implemented here). The main function is also called "CommonTrendsTest" and takes the following arguments: - list indata: required, N-element variable list to be tested - int lagtrunc: optional (default 4), the lag truncation parameter for the internal nonparametric estimation of the longrun variance (related to the bandwidth; value 0 means gretl's default of 0.75*T^{1/3}) - int trendspec: optional (default 0), integer code for the trend specification; 0: no trend, 1: linear trend, [2: not yet implemented] - bool meanshift: optional (default 0), whether to include a mean shift - scalar breakfrac: optional (default 0.5), the relative (known) position of the mean shift in the sample - bool verbose: optional (default 1), set to 0 to suppress messages The return value of the function is a Nx4 matrix with the test results: - 1st col: the test statistics, K=N-1 at the top, K=0 at the bottom (K is the number of common trends under H0, K+1 under H1.) - 2nd to 4th cols: respective critical values for 10/5/1% significance The relevant literature is: Jukka Nyblom & Andrew Harvey, Econometric Theory, 16, 2000, 176-199; Tests of common stochastic trends and Fabio Busetti, J. Forecast. 21, 81-105 (2002): Testing for (Common) Stochastic Trends in the Presence of Structural Breaks Changelog: - 0.91 July 2022: fix failure when data are missing (and require gretl 2019d for internal reasons) - 0.9, March 2019: use the critical values for break fraction 0.02 from Busetti for N=5 or N=6 in the plain case as an approximation (Nyblom&Harvey tables only up to N=4); switch to the built-in lrcovar function (thus require gretl 2018b); add verbose switch (and print results automatically, e.g. for GUI use) - 0.5, February 2017: initial release