function output = artf_data(M,N,SigmaE,C,EX,nobs); %----------------------------------------------------------------- % PURPOSE: creates artificial data for a specified linear process % for purposes of checking the accuracy of estimation %----------------------------------------------------------------- % USAGE: output = artf_data(M,N,SigmaE,C,EX,nobs) % where: M = (nx x nx) matrix % N = (nx x ne) matrix % SigmaE = (ne x ne) covariance matrix % C = (nd x nx) matrix of data % EX = unconditional mean of X % nobs = desired length of time series %---------------------------------------------------------------- % model setup: % X(t+1) = M*X(t) + N*e(t+1) reduced form solution for the % state vector % d(t) = C*X(t) linear relationship between the % variables in the data and the % state vector % --------------------------------------------------------------- % RETURNS: an 'output' structure % output.data = (nobs x nd) matrix of artificial data % output.nobs = number of observations %--------------------------------------------------------------- % written by: Gregory Givens % UNC Economics % 4 October 2003 %--------------------------------------------------------------- nx = size(M,1); ne = size(SigmaE,1); nd = size(C,1); t = nobs; junk = 10000; %throw out 1st 10000 observations% X = [EX zeros(nx,t)]; D = zeros(nd,t); E = multirandn(zeros(ne,1),SigmaE,t+junk); for i = 1:t; X(:,i+1) = M*X(:,i) + N*E(:,i+junk); D(:,i) = C*X(:,i+1); end; output.data = D'; output.nobs = nobs;