IRIS Toolbox Reference Manual

loglik

Evaluate minus the log-likelihood function in time or frequency domain

Full syntax

[Obj,V,F,PE,Delta,PDelta] = loglik(M,D,Range,...)

Syntax for fast one-off likelihood evaluation

Obj = loglik(M,D,Range,...)

Syntax for repeated fast likelihood evaluations

% Step #1: Initialise.
loglik(M,D,Range,...,'persist=',true);

% Step #2: Assign/change parameters.
M... = ...; % Change parameters.

% Step #3: Re-compute steady state and solution if necessary.
M = ...;
M = ...;

% Step #4: Evaluate likelihood.
L = loglik(M);

% Repeat steps #2, #3, #4 for different values of parameters.
% ...

Input arguments

Output arguments

Options

See help on model/filter for other options available.

Description

The number of output arguments you request when calling loglik affects computational efficiency. Running the function with only the first output argument, i.e. the value of the likelihood function (minus the log of it, in fact), results in the fastest performance.

The loglik function runs an identical Kalman filter as model/filter, the only difference is the types and order of output arguments returned.

Fast evaluation of likelihood

Every time you change the parameters, you need to update the steady state and solution of the model if necessary by yourself, before calling loglik. Follow these rules:

Example