clear all;

A = 1;
AStar = 1;
Gss = 0.15491;
SG = 0.2; %will be cleared before saving parameters
alpha = 0.58;
beta  = 0.984;
delta = 0.025;
eta = 5; 
gStar = 0.15491;
gamma = 1.004;
hSS = 0.2; %will be cleared before saving parameters
pay = 0.83235;
rho_g = 0.90;
rho_t = 0.90;
sigma = 2;
tauSS  = 0.3;
tauStar = 0.3;
theta = 0.;



for eta = 5:5:50
    for sigma = 1.1:0.1:3
        for SG = 0.15:0.01:0.25

            tauSS = SG + 0.1;

            L = 1-hSS; %duse

            k_over_n = (((gamma/beta)+(delta-1))/((1-tauSS)*A*(1-alpha)))^(-(1/alpha)); %capital labor ratio

            k = k_over_n*hSS; %capital

            y = A*(k_over_n^(1-alpha))*hSS; %output

            inve = delta * k; %investment

            Gss = SG * y;

            c = y - inve - Gss; %Consumption, asset position assumed to be zero at SS

            theta = 1 / (((1-tauSS)*A*alpha*(k_over_n^(1-alpha))*L/c)+1); %Share of c

            clear SG hSS L y k_over_n k inve c;
            save ('paraNew2.mat', 'A', 'AStar', 'Gss', 'alpha', 'beta', 'delta', 'eta', 'gStar', 'gamma', 'pay', 'rho_g', 'rho_t', 'sigma', 'tauSS', 'tauStar', 'theta');
            clear all;
            dynare baxter1_incomplete.mod;

        end
    end
end

