%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Folder Matlab_data        %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% File to convert data under Stata format to data under Matlab format, the procedure is the following:
1. Launch ConvertStataMatlab_Oct014
2. Launch Build_matrix.m to generate the data shaped for Matlab
3. Launch Gen_Covariables.m to generate covariates
% Some utility functions (with self-explaining names)
	% cell2csv.m
	% cell2mat_block.m
	% csv2mat_block.m
	% csv2mat_numeric.m
4. Generates the certainty equivalent data and the covariates data
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Folder Matlab_code    %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% Functions and main script %%%
% MSL.m: main estimation script, inspired from Train (2009)
% loglik.m: log-likelihood function
% llgrad2.m: calculate log likelihood for a sequence of choices among alternatives for each person with multiple choice situations for each person and multiple people,
% Parfor_ValueFunction.m and Parfor_ValueFunction_PT.m: compute value functions
% Vect2Mat.m: convert vector to matrix
% Mat2Vect.m: convert matrix to vector
% makedraws2.m: compute draws
% MVR2.m: transform draws 

%%% Scripts %%%
* Model*H*_Script.m: run Model *H* with 0 no effect, 1 country effects, 2 economic indicators, 3 individual characteristics, 3bis individual characteristics without country effects. Generate Model*H*.mat datafile, to be used in the next series of folders

%%% Inputs %%%
% COV.mat: data on covariates
% Certainty_Equivalents.mat: data on certainty equivalents
% Yaari_model.mat: contains specifications for the estimations

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% 	Folder Results        %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% In each subfolder (one for each model)

%%% Scripts%%%
% Scripts Plot_obs_vs_unobs.m plot observable vs. unobservable heterogeneity and create the  individual-level data
% Scripts Plot_model**.m plot single or comparison of models
% MVR.m transform draws
% nancorr.m calcule sample correlation coefficient

%%% Inputs %%%
% Model*.mat corresponds to the estimation results for model*
% Model*_Individual.mat corresponds to the individual-level data for model*
% countries.mat: individuals vs. countries matrix
