# Function to generate the parameters of the ACS
# First Version: 2018-03-27
# Current Version: 2018-07-09
# Version Notes:
#=



=#
function params_Smolyak()

par_out=Dict{String,Float64}()


# FIXED PARAMETERS
eta   = 0.72;                # Frisch Elasticity
nu    = 0.1000;              # Elasticity of substitution intermediate goods
chi_h = 1.0;                 # Disutility of labor
cy    = 0.7780;              # C-Y ratio (estimation sample)
gstar = 1.2853;              # SS Gov Expenditure

# DATA RELATED PARAMETERS
rA    = 1 + 0.8619/ 400;                       # Annualized real interest rate
gamma = 1 + 0.5*0.4964 / 100;                  # Quarterly growth rate of technology
piA   = 0*2.3800;                              # Annualized inflation rate

# ACS PARAMETERS - SUNSPOT MODEL US 4vGrowth-C

tau   = 2.014812;
kappa = 0.217795;
psi1  = 2.603040;
psi2  = 0.985259;
rho_r = 0.800202;
rho_g = 0.971793;
rho_z = 0.186258;
rho_d = 0.916577;
sig_r = 0.001623;
sig_g = 0.002524;
sig_z = 0.005868;
sig_d = 0.017158*1.0;

#--------------------------------------------------------------------------
#                       TRANSFORMED PARAMETERS
#--------------------------------------------------------------------------
pistar= 1 + (piA / 400);                      # Annualized inflation rate
pibar = pistar;                               # Reference inflation rate for cost adjustment
beta  = 1 / rA;                               # Disccount factor
r     = rA * gamma;                           # Real interest rate
phi   = tau*(1-nu)/((nu * pistar^2 * kappa)); # Adjustment cost parameter
b     = 1/(2*nu);                             # Constant

#--------------------------------------------------------------------------
#                   NON-STOCHASTIC STEADY STATE
#--------------------------------------------------------------------------

### Star steady state ###
pi_ss  = pistar;

c_ss   = ( (1 - nu + phi*nu*(1-beta)*pi_ss*(pi_ss-pibar)-0.5*phi*(pi_ss-pibar)^2) / (chi_h*((1/(gstar))-0.5*phi*(pi_ss-pibar)^2)^(-1/eta)) )^(1/(tau + 1/eta));

y_ss   = c_ss/(1/(gstar) - 0.5 * phi * (pi_ss -pibar)^2);

R_ss   = pi_ss * gamma/beta;

ee1_ss = (c_ss^-tau)/(gamma*pi_ss);

#--------------------------------------------------------------------------
#                       Different frequency parameters
#--------------------------------------------------------------------------

gammaQ  = (gamma-1)*100

rA      = (rA-1)*400


par_out["eta"]=eta
par_out["nu"]=nu
par_out["chi_h"]=chi_h
par_out["cy"]=cy
par_out["gstar"]=gstar
par_out["rA"]=rA
par_out["gamma"]=gamma
par_out["piA"]=piA
par_out["tau"]=tau
par_out["kappa"]=kappa
par_out["psi1"]=psi1
par_out["psi2"]=psi2
par_out["rho_r"]=rho_r
par_out["rho_g"]=rho_g
par_out["rho_z"]=rho_z
par_out["rho_d"]=rho_d
par_out["sig_r"]=sig_r
par_out["sig_g"]=sig_g
par_out["sig_z"]=sig_z
par_out["sig_d"]=sig_d
par_out["pistar"]=pistar
par_out["pibar"]=pibar
par_out["beta"]=beta
par_out["r"]=r
par_out["phi"]=phi
par_out["b"]=b
par_out["pi_ss"]=pi_ss
par_out["c_ss"]=c_ss
par_out["y_ss"]=y_ss
par_out["R_ss"]=R_ss
par_out["ee1_ss"]=ee1_ss
par_out["gammaQ"]=gammaQ

return par_out

end
