

    \filetitle{resample}{Resample from the model implied distribution}{model/resample}

	\paragraph{Syntax}
 
 \begin{verbatim}
 OUTP = resample(M,INP,RANGE,NDRAW,...)
 OUTP = resample(M,INP,RANGE,NDRAW,J,...)
 \end{verbatim}
 \paragraph{Input arguments}
 
 \begin{itemize}
 \item
   \texttt{M} {[} model {]} - Solved model object.
 \item
   \texttt{INP} {[} struct \textbar{} empty {]} - Input data (if needed)
   for the distributions of initial condition and/or empirical shocks; if
   not bootstrap is invovled
 \item
   \texttt{RANGE} {[} numeric {]} - Resampling date range.
 \item
   \texttt{NDRAW} {[} numeric {]} - Number of draws.
 \item
   \texttt{J} {[} struct \textbar{} empty {]} - Database user-supplied
   (time-varying) tunes on std devs, corr coeffs, and/or means of shocks.
 \end{itemize}
 \paragraph{Output arguments}
 
 \begin{itemize}
 \item
   \texttt{OUTP} {[} struct \textbar{} cell {]} - Output database with
   resampled data.
 \end{itemize}
 \paragraph{Options}
 
 \begin{itemize}
 \item
   \texttt{'deviation='} {[} \texttt{true} \textbar{}
   \emph{\texttt{false}} {]} - Treat input and output data as deviations
   from balanced-growth path.
 \item
   \texttt{'dtrends='} {[} \emph{\texttt{'auto'}} \textbar{}
   \texttt{true} \textbar{} \texttt{false} {]} - Add deterministic trends
   to measurement variables.
 \item
   \texttt{'method='} {[} \texttt{'bootstrap'} \textbar{}
   \emph{\texttt{'montecarlo'}} {]} - Method of randomising shocks and
   initial condition.
 \item
   \texttt{'output='} {[} \emph{\texttt{'auto'}} \textbar{}
   \texttt{'dbase'} \textbar{} \texttt{'dpack'} {]} - Format of output
   data.
 \item
   \texttt{'progress='} {[} \texttt{true} \textbar{}
   \emph{\texttt{false}} {]} - Display progress bar in the command
   window.
 \item
   \texttt{'randomise='} {[} \emph{\texttt{true}} \textbar{}
   \texttt{false} \textbar{} numeric {]} - Randomise initial condition.
 \item
   \texttt{'stateVector='} {[} \emph{\texttt{'alpha'}} \textbar{}
   \texttt{'x'} {]} - When resampling initial condition, use the
   transformed state vector, \texttt{'alpha'}, or the vector of original
   variables, \texttt{'x'}; this option is meant to guarantee
   replicability of results.
 \item
   \texttt{'svdOnly='} {[} \texttt{true} \textbar{} \emph{\texttt{false}}
   {]} - Do not attempt Cholesky and only use SVD to factorize the
   covariance matrix when resampling initial condition; only applies when
   \texttt{'randomise=' true}.
 \item
   \texttt{'wild='} {[} \texttt{true} \textbar{} \emph{\texttt{false}}
   {]} - Use wild bootstrap instead of Efron bootstrap; only applies when
   \texttt{'method=' 'bootstrap'}.
 \end{itemize}
 \paragraph{Description}
 
 When you use wild bootstrap for resampling the initial condition, note
 that the results are based on an assumption that the mean of the initial
 condition is the asymptotic mean implied by the model (i.e.~the steady
 state).
 
 \paragraph{Example}


