function Imputed_wNaNs=Missing_Imputer(FAC_ARRAY_Sum, CURRENT_PARS, Inds_OBSERVED)
%function Current_Imputed_Values=Missing_Imputer(FAC_ARRAY_Sum, CURRENT_PARS, Inds_OBSERVED)
%INPUTS: output from Levels_Array, the structure of current parameters, and
%the indices we need to fill.
%

% This one is easy:

% To get the imputations, add to FAC_ARRAY_Sum the grand mean - CURRENT_PARS.GM -  and a matrix of iid
% draws, with std given by sqrt(CURRENT_PARS.sigma2):

Imputed_wNaNs=CURRENT_PARS.GM + FAC_ARRAY_Sum + sqrt(CURRENT_PARS.sigma2)*randn(size(FAC_ARRAY_Sum));

%SET those elements that correspond to locations (i.e. where we don't need
%imputations) to NaNs
Imputed_wNaNs(Inds_OBSERVED)=NaN(1);


