This function creates bootstrap pseudo-data resampling a set of zero mean stationary time series using the stationary bootstrap with random block size by D.N. Politis and J.P. Romano ("The Stationary Bootstrap", Journal of the American Statistical Association, vol. 89, 1994, pp. 1303-1313). PUBLIC FUNCTIONS: ----------------------------------------------------------------------- Function: SB(matrix x "Data to be resampled", scalar b[0::0] "Mean block size") Arguments: x: matrix, Data to be resampled. Rows: time periods, columns:variables b: scalar, Mean block size; if b=0 (default): use rule-of-thumb b = 1.75 * (T^(1/3) as in Palm, F.C., S. Smeekes, J.P. Urbain (2011) "Cross-sectional dependence robust block bootstrap panel unit root tests", Journal of Econometrics, 163, 85-104. Return: Matrix of I(0) bootstrap pseudo-data of the same dimensions of the input matrix. Note on the sample script: ========================== Example 1 estimates 95% bootstrap confidence intervals for the cointegrating coefficients of a relationship estimated on Johansen's Danish data supplied by Gretl. A rather small number of re-drawings is used. In actual empirical work a much larger number, at least 1000 and up to 5000, is recommended. Real money, real income and the bond rate are found to be cointegrated by using the Engle-Granger test. Hence, the OLS residuals are stationary. However, the residuals will generally be weakly dependent, so that simple redrawing as carried out by the Gretl function "resample" cannot be applied, while block bootstrap as carried out by "resample" with the optional "b" argument would be legitimate. However, the block bootstrap is not guaranteed to produce stationary pseudo-residuals. This will have serious consequences in this context. Changelog: 1.4: - Remove the obsolete 3rd argument for the SB() function - The mean block size (b) is allowed to be a non-negative scalar value - Fix typos - Improve manual 1.3: - Implementation of a much faster code - Note: The functions SB_old1 (the initial version) and SB_old2 are deprecated and for pedagogic purposes only 1.2: - Implementation of a faster code - Old function still available under SBslow()