%SIMULHET.M
%  Simulates the prices and quantities for a recursive linear equilibrium
%  model with non-Gorman heterogeneity.  SOLVEHETER.M must be run first
%  and its output must be in memory.  To simulate the individual
%  consumption allocations, respond "[sc1;sc2]" when
%  asked what series you want to simulate.  To simulate the individual
%  consumption service allocations, respond "[ss1;ss2]".
%
%  SEE ALSO: SOLVEA  and HETER.

	t1 = input('How many time periods do you want to plot?  ');

	t = 0:(t1-1);

disp('     ')
disp('The vector t contains a time variable for plotting')
disp('         ')
disp('You will now be asked to input a matrix that governs the variables ')
disp('that you wish to plot.  Respond with a matrix that stacks the names')
disp('of the variables you wish to plot.')
disp('For example, if you wanted to plot consumption for the agent and')
disp('aggregate capital you would respond with the matrix:  [sci; ska]. ')
disp('     ')
disp('If you wish to use previous settings respond with the matrix: sy')
disp('     ')

	sy = input('What processes do you wish to simulate?  ');

disp('   ')
disp('Do you wish to do random simulation?')

	k = input('Type a 1 for yes, a 2 for no  ');

	if k == 1;

	rand('seed',0)

	rand('normal')

	u = rand(t1,nw);

	end;

	if k == 2;

	u = zeros(t1,nw);

	end;

	[rd,dd] = size(sy);

        y = dlsim(ao,c,sy,zeros(rd,nw),u,x0);

disp('   ')
disp('Your simulated vector is in the vector "Y". ')
disp('   ')
