A possible cause for the problem: if you have the spreadsheet open in Excel (results from a previous run), Ox cannot open the file.

Regards,
Jaap

Van: The ox-users list is aimed at all Ox users [[log in to unmask]] namens T.Riedle [[log in to unmask]]
Verzonden: vrijdag 4 november 2016 12:52
Aan: [log in to unmask]
Onderwerp: Cannot open results error


 

Dear all,

 

Is ther anybody who can help me with following problem:


I have following part of a code and I want to obtain the results for tau and the saved estimation results according to the code below. Unfortunately, I get the message

 

------------------------
Save estimation results:
------------------------
Warning: concatenation dimensions don't match, padded with zeros
D:\OxMetrics7\ox\bin\OxEdit\garch_midas.ox (323): main
Warning: concatenation dimensions don't match, padded with zeros
D:\OxMetrics7\ox\bin\OxEdit\garch_midas.ox (323): main
Cannot open results/tspread_1s_asym_2w12lags.xls

Time elapsed - total:  1:00.31

 

Could anybody please help me with that? I just want to get the results as shown in the code but I neither get the tau nor the saved results.

 

Thanks in advance

 

 /////////////////////////////////////////////////////////////////////////////
 // print estimation results
 /////////////////////////////////////////////////////////////////////////////
 
 println("\n------------------------");
 println("Estimation results:");        
 println("------------------------");

 println("\n", "Maximized LLF: ", "%7.2f", double(dfunc));

 println("\n");
 
 println("MLE results: ", "%r", {"mu", "alpha", "beta", "gamma", "m", "theta", "w_1", "w_2"},
   "%c", {"Coeff.", "S.E. (OP)", "Prob.", "S.E. (H)", "Prob."},
    "%cf", {"%10.4f","%10.4f", "%10.4f","%10.4f", "%10.4f"},
   values ~ ml_op_sterr ~ ml_op_p_value ~ ml_sterr ~ ml_p_value, "\n");
 
 println("QMLE results: ", "%r", {"mu", "alpha", "beta", "gamma", "m", "theta", "w_1", "w_2"},
   "%c", {"Coeff.", "S.E.", "Prob."},
    "%cf", {"%10.4f","%10.4f", "%10.4f"},
   values ~ qmle_sterr ~ qmle_p_value, "\n");
 
 println("\nTime elapsed - Error calculation: ", timespan(time), "\n");

 ////////////////////////////////////////////////////////////////////////////////
 // Save estimation results
 ////////////////////////////////////////////////////////////////////////////////

 println("\n------------------------");
 println("Save estimation results:");        
 println("------------------------");
 
 decl phi = beta_weighting(lags+1, values[6], values[7]);
 
 decl model = "Asymmetric GARCH-MIDAS model with 1-sided (2weights) macro variabble : " ~ macro_variable ~ " ";
 
 decl file_save = macro_variable ~ "_1s_asym_2w" ~ sprint(lags) ~ "lags";

 decl file_save_results = "results/" ~ macro_variable ~ ".txt";  // save results in Text-File
 decl file_save_components = "results/" ~ file_save ~ ".xls";   // save tau, g component in Excel-File
 decl file_save_graphs = "results/" ~ file_save ~ ".eps";    // save graph of components to eps-File
  
 // long- and short-run volas
 decl tau_final = tau_comp(values);

 // annualized volatilities divided by 100
 decl short_run_vola, long_run_vola;
 long_run_vola = sqrt(tau_final) .* sqrt(252) ./ 100 ;
 short_run_vola = sqrt(g) .* long_run_vola;

 decl volatilities = short_run_vola' | long_run_vola';

 // errors
 decl errors = (Y - values[0]) ./ sqrt( g.* tau_final);

 // Eps. Graphs with long-and short-run volas
 DrawTMatrix(0, volatilities, {"short-run volatility", "long-run volatility"}, 4, 1, 1);
 DrawTitle(0, model);
 DrawT(1, long_run_vola', 4,1,1);
 DrawTitle(1, "Long-run volatility component");
 DrawTMatrix(2, phi[1:]',{"Beta weights (unrestricted)"}, 1,1,1,2);
 DrawTitle(2, "Weighting Scheme" ); 
 SaveDrawWindow(file_save_graphs);
 CloseDrawWindow();
 
 // Excel File with tau, g and coeff values
 savemat(file_save_components, tau_final ~ g ~ errors ~ phi[1:] ~ values , {"tau" , "g", "errors", "weights", "coeff_vector"});

 println("\nTime elapsed - total: ", timespan(time), "\n");


 }  // END of loop over list of macro variables
 }
}