[Tex/LaTex] Write equations VAR and VECM equations in R

equationsmath-mode

\documentclass[10pt]{article}
\usepackage{graphicx}
\usepackage{amsmath}
\begin{document}

\title{Case studies: Long run relationship}

\maketitle 

\begin{abstract}
The cointegrating approach is proposed
\end{abstract}

\section{introduction}


Over the last century

\section{Methods and Results}

The 9 prices indexes from each province  

A VAR(p) is written as

\begin{equation}
k_{t } =  A_{0}+ A_1k_{t-1}+ A_{2}k_{t-2}+ A_{2} k_{t-2} +......A_nk_{t-n} + e_{t}
\end{equation}
####################################################################################
where k_{n}  =  (k_{1t}, k_{2t},.....,m_{Kt))  for k=1,....., K time series. The key assumptions are in the VAR(p)
##################################################################################
\begin{eqnarray}
\Delta k_{t} & = & \Delta\Gamma{1}k_{t-1}+\Delta\Gamma{2}k_{t-2}+...+\Delta\Gamma{n}k_{t-n} 
 \end{eqnarray}

#########################################################################################
Where \gamma_{i}=-(I-A_{1} - ...A_{i}),  i= 2,.....,p-1     \Pi= -(I - A_{1}-....-A_{p})  is a N-dimensional time series,  A_{0}  is the intercept term, e_{t} is white noise
########################################################################################
\end{document}

Hi everybody, I'm trying to write this piece of article in latex but it doesn't work at all because of these 4 lines. If you remove this 4 following lines then the the article comes quite well. But when i insert them, latex doesn't recognize. However i must insert these explanation on my article. Please can you help me to add this 4 codes in order to have my formal article. I must insert as everybody must explain every sign on his mathematical model. Please help me to insert them on my article.

where k_{n}  =  (k_{1t}, k_{2t},.....,m_{Kt))  for k=1,....., K time series. The key assumptions are in the VAR(p)


Where \gamma_{i}=-(I-A_{1} - ...A_{i}),  i= 2,.....,p-1     \Pi= -(I - A_{1}-....-A_{p})  is a N-dimensional time series,  A_{0}  is the intercept term, e_{t} is white noise

Best Answer

Try to pay attention of the .log file. You'll notice, for example, the following message:

! Missing $ inserted.
<inserted text> 
                $
l.29 where k_
             {n}  =  (k_{1t}, k_{2t},.....,m_{Kt))  for $k=1,....., K$ time ...

This is LaTeX telling you that you're missing a $ sign in line 29. As David suggested in the comment, you need to enclose inline math contents with $...$ or \(...\). So for the two instances that cause you trouble, you should do the following

where $k_{n}  =  (k_{1t}, k_{2t},.....,m_{Kt})$  for $k=1,....., K$ time series. 

and

Where $\gamma_{i}=-(I-A_{1} - ...A_{i})$,  $i= 2,.....,p-1$     
$\Pi= -(I - A_{1}-....-A_{p})$ is a $N$-dimensional time series,  
$A_{0}$ is the intercept term, $e_{t}$ is white noise.

There are also several other places where the codes are not considered "best practices":

  • instead of + ... +, use + \cdots +
  • instead of , ... ,, use , \ldots , or , \dots ,
  • instead of using eqnarray, use align

Full Code

\documentclass[10pt]{article}
\usepackage{graphicx}
\usepackage{amsmath}
\begin{document}

\title{Case studies: Long run relationship}

\maketitle 

\begin{abstract}
  The cointegrating approach is proposed
\end{abstract}

\section{introduction}

Over the last century

\section{Methods and Results}

The 9 prices indexes from each province  

A VAR(p) is written as

\begin{equation}
  k_{t } =  A_{0}+ A_1k_{t-1}+ A_{2}k_{t-2}+ A_{2} k_{t-2} +\cdots +A_nk_{t-n} + e_{t}
\end{equation}
% ####################################################################################
where $k_{n}  =  (k_{1t}, k_{2t},\ldots,m_{Kt})$  for $k=1,\ldots, K$ time series. 
The key assumptions are in the VAR(p)
% ##################################################################################
\begin{align}
  \Delta k_{t} & = \Delta\Gamma{1}k_{t-1}+\Delta\Gamma{2}k_{t-2}+\cdots+\Delta\Gamma{n}k_{t-n} 
\end{align}

% ##############################################################################
Where $\gamma_{i}=-(I-A_{1} - \cdots -A_{i})$,  $i= 2,\ldots,p-1$     
$\Pi= -(I - A_{1}-\cdots-A_{p})$  is a $N$-dimensional time series,  
$A_{0}$  is the intercept term, $e_{t}$ is white noise
% ##############################################################################
\end{document}

Output

enter image description here