- function [X, y] = mksstrndata(Xi, p)
- % [X, y] = mksstrndata(Xi, p)
- % returns in X a k =n -p by p matrix of input trining data,
- % where each row is an input vector, and the coreesponding desired
- % output vector in y for a one-step prediction problem in the
- % scalar time series Xi of length n.
- Xi = Xi(:);
- n = length(Xi);
- k = n - p;
- X = zeros(k, p);
- for i=0:(k-1)
- X(i+1, :) = Xi((1+i):(p+i))';
- end
- y=Xi((p+1):n);