-
-
Save alphaville/5502459 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Create a LaTeX table for the parameters of an ARIMA Model | |
clc | |
disp('\begin{table}[h]\footnotesize'); | |
disp(' \begin{center}'); | |
disp([' \caption{Parameters of model (???) along with their '... | |
'standard error and t-statistic.}']); | |
disp(' \vspace{0.2cm}'); | |
disp(' \begin{tabular}{|c|c|c|c|}'); | |
disp('\hline'); | |
disp('{ \cellcolor{\deliverableTitleColor!25}\textbf{Parameter}}&'); | |
disp('{ \cellcolor{\deliverableTitleColor!25}\textbf{Value}}&'); | |
disp('{ \cellcolor{\deliverableTitleColor!25}\textbf{St. Error}}&'); | |
disp('{ \cellcolor{\deliverableTitleColor!25}\textbf{t-statistic}} \\'); | |
disp('\hline'); | |
errors = sqrt(diag(mdl.VarCov)); | |
% Autoregressive (\phi) | |
for i=1:length(mdl.arLags) | |
x=mdl.fit.AR(mdl.arLags(i)); | |
disp(['$\phi_{' num2str(mdl.arLags(i)) '}$ & $' num2str(x{1}) '$'... | |
' & $' num2str(errors(1+i)) '$ & $' num2str(x{1}/errors(1+i)) '$ \\']); | |
end | |
% Seasonal Autoregressive (\Phi) | |
for i=1:length(mdl.sarLags) | |
x=mdl.fit.SAR(mdl.sarLags(i)); | |
paramErr = errors(length(mdl.arLags)+i); | |
disp([ '$\Phi_{' num2str(mdl.sarLags(i)) '}$ & $' ... | |
num2str(x{1}) '$ & $' num2str(paramErr) ... | |
'$ & $' num2str(x{1}/paramErr) '$ \\']) | |
end | |
% Moving Average (\psi) | |
for i=1:length(mdl.maLags) | |
x=mdl.fit.MA(mdl.maLags(i)); | |
j=i+length(mdl.arLags) + length(mdl.sarLags)+1; | |
disp(['$\psi_{' num2str(mdl.maLags(i)) '}$ & $' num2str(x{1}) '$' ... | |
' & $' num2str(errors(j)) '$ & $' num2str(x{1}/errors(j)) '$ \\']); | |
end | |
% Seasonal Moving Average | |
% Moving Average (\psi) | |
for i=1:length(mdl.smaLags) | |
x=mdl.fit.SMA(mdl.maLags(i)); | |
j=j+1; | |
disp(['$\Psi_{' num2str(mdl.maLags(i)) '}$ & $' num2str(x{1}) '$'... | |
' & $' num2str(errors(j)) '$ & $' num2str(x{1}/errors(j)) '$ \\']); | |
end | |
% Variance: | |
disp(['$\sigma_\alpha^2$ & $' num2str(mdl.fit.Variance) '$ & $'... | |
num2str(errors(end)) '$'... | |
' & $' num2str(mdl.fit.Variance/errors(end)) '$ \\']); | |
disp('\hline'); | |
disp('\end{tabular}'); | |
disp('\end{center}'); | |
disp('\end{table}'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment