

    \filetitle{diffloglik}{Approximate gradient and hessian of log-likelihood function}{model/diffloglik}

	\paragraph{Syntax}

\begin{verbatim}
[MinusLogLik,Grad,Hess,V] = diffloglik(M,D,Range,PList,...)
\end{verbatim}

\paragraph{Input arguments}

\begin{itemize}
\item
  \texttt{M} {[} model {]} - Model object whose likelihood function will
  be differentiated.
\item
  \texttt{D} {[} cell \textbar{} struct {]} - Input data from which
  measurement variables will be taken.
\item
  \texttt{Range} {[} numeric {]} - Date range on which the likelihood
  function will be evaluated.
\item
  \texttt{List} {[} cellstr {]} - List of model parameters with respect
  to which the likelihood function will be differentiated.
\end{itemize}

\paragraph{Output arguments}

\begin{itemize}
\item
  \texttt{MinusLogLik} {[} numeric {]} - Value of minus the likelihood
  function at the input data.
\item
  \texttt{Grad} {[} numeric {]} - Gradient (or score) vector.
\item
  \texttt{Hess} {[} numeric {]} - Hessian (or information) matrix.
\item
  \texttt{V} {[} numeric {]} - Estimated variance scale factor if the
  \texttt{'relative='} options is true; otherwise \texttt{v} is 1.
\end{itemize}

\paragraph{Options}

\begin{itemize}
\item
  \texttt{'chkSstate='} {[} \texttt{true} \textbar{}
  \emph{\texttt{false}} \textbar{} cell {]} - Check steady state in each
  iteration; works only in non-linear models.
\item
  \texttt{'refresh='} {[} \emph{\texttt{true}} \textbar{} \texttt{false}
  {]} - Refresh dynamic links for each change in a parameter.
\item
  \texttt{'solve='} {[} \emph{\texttt{true}} \textbar{} \texttt{false}
  {]} - Re-compute solution for each change in a parameter.
\item
  \texttt{'sstate='} {[} \texttt{true} \textbar{} \emph{\texttt{false}}
  \textbar{} cell {]} - Re-compute steady state in each differentiation
  step; if the model is non-linear, you can pass in a cell array with
  options used in the \texttt{sstate} function.
\end{itemize}

See help on \href{model/filter}{\texttt{model/filter}} for other options
available.

\paragraph{Description}

\paragraph{Example}


