|
Approx_inference_toolbox
VBA model inversion in 4 steps
This page summarizes the steps required for performing a model inversion with the core VB routines of the toolbox. In brief:
NB: Many demonstration scripts are provided with the toolbox (e.g., see this fast demo). Step 1: Defining observation/evolution functionsGenerative models are defined in terms of evolution and observation functions. One may have to write these evolution/observation functions, in compliance with the following I/O: [ z ] = function_name( x_t,P,u_t,in )
Step 2 : Setting model inversion optionsThe VBA model inversion requires the user to specify some additional information:
For example, setting: dim.n = 1 dim.n_theta = 2 dim.n_phi = 3 tells VBA that there are 1 hidden state, 2 evolution parameters and 3 observation parameters. NB: other dimensions (dim.p and dim.n_t) are optional.
Dealing with categorical (binary) data? options.binomial = 1 Want to get rid of annoying graphical output figures? options.DisplayWin = 0 When dealing with missing data, fill in options.isYout, which is a vector of same size as the data matrix y, whose entries are 1 if the corresponding sample is to be left out. For example: options.isYout = zeros(size(y)) options.isYout(1,1) = 1 forces VBA to ignore the first time sample of the first dimension of y. NB: advanced users may use these optional arguments to control the inversion (see this page for an exhaustive list of options). Step 3 : Defining priorsIn addition to the evolution and observation functions, specifying the generative model requires the definition of prior probability distributions over model unknown variables. These are summarized by sufficient statistics (e.g., mean and variance), which are stored as a matlab structure that is itself added to the 'options' structure:
For example, setting: priors.muPhi = zeros(dim.n_phi,1) priors.SigmaPhi = eye(dim.n_phi) effectively defines a N(0,I) i.i.d. (zero mean, unit variance) normal density on observation parameters. Note that when dealing with deterministic models, one has to specify the following prior for the state noise precision: priors.a_alpha = Inf priors.b_alpha = 0 NB: one then fills in the priors field of the options structure, as follows: options.priors = priors If left unspecified, this field is filled in with defaults (typically, i.i.d. zero-mean and unit variance Gaussian densities). Step 4 : Inverting the modelHaving completed steps 1 to 3, one simply calls the main VB model inversion routine, namely VBA_NLStateSpaceModel.m, as follows: [posterior,out] = VBA_NLStateSpaceModel(y,u,f_fname,g_fname,dim,options) Its input arguments are:
| |
what is isYout?