

    \filetitle{SVAR}{Convert reduced-form VAR to structural VAR}{SVAR/SVAR}

	\paragraph{Syntax}
 
 \begin{verbatim}
 [S,DATA,B,COUNT] = SVAR(V,DATA,...)
 \end{verbatim}
 \paragraph{Input arguments}
 
 \begin{itemize}
 \item
   \texttt{V} {[} VAR {]} - Reduced-form VAR object.
 \item
   \texttt{DATA} {[} struct \textbar{} tseries {]} - Data associated with
   the input VAR object.
 \end{itemize}
 \paragraph{Output arguments}
 
 \begin{itemize}
 \item
   \texttt{S} {[} VAR {]} - Structural VAR object.
 \item
   \texttt{DATA} {[} struct \textbar{} tseries {]} - Data with
   transformed structural residuals.
 \item
   \texttt{B} {[} numeric {]} - Impact matrix of structural residuals.
 \item
   \texttt{COUNT} {[} numeric {]} - Number of draws actually performed
   (both successful and unsuccessful) when \texttt{'method'='draw'};
   otherwise \texttt{COUNT=1}.
 \end{itemize}
 \paragraph{Options}
 
 \begin{itemize}
 \item
   \texttt{'maxIter='} {[} numeric \textbar{} \emph{\texttt{0}} {]} -
   Maximum number of attempts when \texttt{'method'='draw'}.
 \item
   \texttt{'method='} {[} \emph{\texttt{'chol'}} \textbar{}
   \texttt{'draw'} \textbar{} \texttt{'qr'} \textbar{} \texttt{'svd'} {]}
   - Method that will be used to identify structural residuals.
 \item
   \texttt{'nDraw='} {[} numeric \textbar{} \emph{\texttt{0}} {]} -
   Target number of successful draws when \texttt{'method'='draw'}.
 \item
   \texttt{'output='} {[} \emph{\texttt{'auto'}} \textbar{}
   \texttt{'dbase'} \textbar{} \texttt{'tseries'} {]} - Format of output
   data.
 \item
   \texttt{'progress='} {[} \texttt{true} \textbar{}
   \emph{\texttt{false}} {]} - Display progress bar in the command
   window.
 \item
   \texttt{'rank='} {[} numeric \textbar{} \emph{\texttt{Inf}} {]} -
   Reduced rank of the covariance matrix of structural residuals when
   \texttt{'method=' 'svd'}; \texttt{Inf} means full rank is preserved.
 \item
   \texttt{'std='} {[} numeric \textbar{} \emph{\texttt{1}} {]} - Std
   deviation of structural residuals.
 \item
   \texttt{'test='} {[} char {]} - String that will be evaluated for each
   random draw of the impact matrix \texttt{B}. The evaluation must
   result in true or false; only those matrices \texttt{B} that evaluate
   to true will be kept. See Description for more on how to write
   \texttt{test}.
 \item
   \texttt{'ordering='} {[} numeric \textbar{} \emph{empty} {]} -
   Re-order VAR variables before identifying structural residuals.
 \item
   \texttt{'reorderResiduals='} {[} \emph{\texttt{true}} \textbar{}
   \texttt{false} {]} - Re-order identified structural residuals back.
 \end{itemize}
 \paragraph{Description}
 
 ---Identification random Householder transformations
 
 The structural impact matrices \texttt{B} are randomly generated using a
 Householder transformation algorithm. Each matrix is tested by
 evaluating the \texttt{test} string supplied by the user. If it
 evaluates to true the matrix is kept and one more SVAR parameterisation
 is created, if it is false the matrix is discarded.
 
 The \texttt{test} string can refer to the following characteristics:
 
 \begin{itemize}
 \item
   \texttt{S} --- the impulse (or shock) response function; the
   \texttt{S(i,j,k)} element is the response of the \texttt{i}-th
   variable to the \texttt{j}-th shock in period \texttt{k}.
 \item
   \texttt{Y} --- the asymptotic cumulative response function; the
   \texttt{Y(i,j)} element is the asumptotic (long-run) cumulative
   response of the \texttt{i}-th variable to the \texttt{j}-th shock.
 \end{itemize}
 \paragraph{Example}


