<< Factor Analysis Factor Analysis fac_density_boot >>

Grocer >> Factor Analysis > DFM_estimate

DFM_estimate

General dynamic factor model

CALLING SEQUENCE

Res = DFM_estimate(data,nbfactors,nblags,thResh,transf,i_idio,arg1,...,argn)

PARAMETERS

Input

* data = a string matrix of any size or a list, collecting the name of the series

* nbfactors = a scalar, the # of factors

* nblags = # of lags of the AR process followed by the factors

* thresh = a scalar, thReshold for convergence of EM algorithm

* transf = a list of vectors indicating the weight of the factors lags into each variable ([] for variables for which no lag is needed)

* i_idio = a (k x 1) vector collecting the ordrer of the AR for the Residuals of the state equations

* arg1,...,argn = optional arguments, which can be:

   . 'noprint' if the user does not want to print the estimation Results

   . 'max_iter=N' where N is the maximum # of iterations of the EM process that are allowed (default: 1E5)

   . 'blocks=B' where B is a (k x 1) vector, collecting the indexes of the blocks the variables belong to (default: B is a vector of 1, which means that there is only one block )

Output

* Res = a Results tlist with:

   - Res('meth') = 'DFM'

   - Res('X') = the (N x k) matrix of raw data, converted if needed to the highest frequencies using %nan

   - Res('X_est') = the (M x k) matrix of data used for estimation, derived from X by removing the raw that are fully %nan and standardizing the X columns

   - Res('X_sm') = the (M x k) matrix of smoothed data

   - Res('F') = the ((M-1) x nb_factors) matrix of smoothed factors

   - Res('C') = (k x (nb_factors x nb_lags)) observation

   - Res('R') = (k x k) variance of the observation equation Residuals

   - Res('A') = (nb_factors x nb_lags) x (nb_factors x nb_lags))

   - Res('Q') = (nb_factors x nb_lags) x (nb_factors x nb_lags)) transition equation residuals

   - Res('Mx') = (1 x k) vector, collecting the means of the

   - Res('Wx') = (1 x k) vector, collecting the standard deviations of the variables

   - Res('Z_0') = ((nb_factors x nb_lags) x 1) vector, the

   - Res('V_0) = ((nb_factors x nb_lags) x (nb_factors x nb_lags)) initial value of covariance matrix

   - Res('nb_factors') = a scalar, the # of factors

   - Res('nb_lags') = a scalar, the # of lags of the AR process estimated for the factors

   - Res('loglik') = a scalar, the value of the log-likelihood

   - Res('names') = a (k x 1) string vector, collecting the names of the variables

   - Res('bounds') = a (2x 1) string vector, collecting the

DESCRIPTION

Estimates a dynamic factor model (DFM) with series of potential different frequencies.

EXAMPLE

global GROCERDIR ;    
// load the French GDP and business surveys available in September 2025
load(GROCERDIR+'\data\fra_bs_sept25.dat')
data=dblist(GROCERDIR+'\data\fra_bs_sept25.dat')
// recover the data: the growth rate of GDP and the 26 baalnces used by
// Insee to build the French business climate
data_dfm=['growthr(PIB_7CH)' ; data(3:28) ]

bounds('1980m1','2019m12')
transf=list()
// set the weight of the current and lagged factor in the GDP equation
transf(1)=[1,2,3,2,1]
// no wieghting scheme for the other variables
for i=2:27
   transf(i)=[]
end
// perform the DFM estimation using the data listed above, one factor, 4 lags for the 
// factor equation, the weight defined above, 1e-6 as convergence criterion and AR(1)
// for all monthly residuals
Res=DFM_estimate(data_dfm,1,4,1e-6,transf,0;ones(26,1))

AUTHOR

Éric Dubois 2026

Report an issue
<< Factor Analysis Factor Analysis fac_density_boot >>