From f4b873543153fcc1267bedb38bef4b7384246e1c Mon Sep 17 00:00:00 2001 From: Houtan Bastani Date: Fri, 1 Feb 2019 11:48:16 +0100 Subject: [PATCH] pooled_ols: only save certain variables oo_ structure when passing back to pooled_fgls --- matlab/ols/pooled_ols.m | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/matlab/ols/pooled_ols.m b/matlab/ols/pooled_ols.m index 777fc7a4c..d0f25d91a 100644 --- a/matlab/ols/pooled_ols.m +++ b/matlab/ols/pooled_ols.m @@ -95,17 +95,16 @@ end st = dbstack(1); if strcmp(st(1).name, 'pooled_fgls') save_structure_name = 'pooled_fgls'; + % Pass vars back to pooled_fgls + oo_.pooled_fgls.residnames = residnames; + oo_.pooled_fgls.Y = Y.data; + oo_.pooled_fgls.X = X.data; + oo_.pooled_fgls.pbeta = X.name; + oo_.pooled_fgls.country_name = country_name; else save_structure_name = 'pooled_ols'; end -%% Save -oo_.(save_structure_name).residnames = residnames; -oo_.(save_structure_name).Y = Y.data; -oo_.(save_structure_name).X = X.data; -oo_.(save_structure_name).pbeta = X.name; -oo_.(save_structure_name).country_name = country_name; - %% Estimation % Estimated Parameters [q, r] = qr(X.data, 0);