multilevel: Full estimation of the multilevel factor model

View source: R/main_functions.R

multilevelR Documentation

Full estimation of the multilevel factor model

Description

This is one of the main functions of this package which performs full estimation of the multilevel factor model.

Usage

multilevel(
  data,
  ic = "BIC3",
  standarise = TRUE,
  r_max = 10,
  r0 = NULL,
  ri = NULL,
  depvar_header = NULL,
  i_header = NULL,
  j_header = NULL,
  t_header = NULL
)

Arguments

data

Either a data.frame or a list of data matrices of length R. See Details.

ic

A character string of selection criteria to use for estimation of the numbers of local factors. See Details.

standarise

A logical indicating whether the data is standardised before estimation or not. See Details.

r_max

An integer indicating the maximum number of factors allowed. See Details.

r0

An integer of the number of global factors. See Details.

ri

An array of length R containing the number of local factors in each block. See Details.

depvar_header

A character string specifying the header of the dependent variable. See Details.

i_header

A character string specifying the header of the block identifier. See Details.

j_header

A character string specifying the header of the individual identifier. See Details.

t_header

A character string specifying the header of the time identifier. See Details.

Details

The user-supplied data.frame should contain at least four columns, namely the dependent variable (y_{ijt}), block identifier (i), individual identifier (j), and time (t). The user needs to supply their corresponding headers in the data.frame to the function using the parameters "depvar_header", "i_header", "j_header", and "t_header", respectively. If the data is supplied as a list, these arguments will not be used.

If either r0 = NULL or ri = NULL, then both of them will be estimated. In such case, "r_max" must be supplied. If "r0" and "ri" are supplied then "r_max" is not needed and will be ignored.

If standarise = TRUE, each time series will be standardised so it has zero mean and unit variance. It is recommended to standardise the data before estimation.

See Lin and Shin (2023) for more details.

Value

The return value is an S3 object of class "multi_result". It contains a list of the following items:

  • G = A matrix of the estimated global factors.

  • Gamma = A list of length R containing matrices of the estimated global loading matrices for each block.

  • F = A list of length R containing matrices of the estimated local factors for each block.

  • Lambda = A list of length R containing matrices of the estimated global loading matrices for each block.

  • N = The total number of cross-sections in the panel.

  • Ni = An array of length R containing the number of cross-sections in each block.

  • r0 = The number of global factors. Unchanged if pre-specified.

  • ri = An array of length R containing the number of local factors for each block. Unchanged if pre-specified.

  • d = An array of length R containing the maximum total number of factors allowed for each block. The elements are identically equal to r_max if either r0 or ri is supplied as NULL.

  • Resid = A list of length R containing the residual matrices for each block.

  • delta2 = An array of the mock and the r_{\max} + 1 largest squared singular values.

  • ic = Selection criteria used for estimating the numbers of local factors.

  • block_names = A array of block names.

References

Lin, R. and Shin, Y., 2022. Generalised Canonical Correlation Estimation of the Multilevel Factor Model. Available at SSRN 4295429.

Examples


panel <- UKhouse # load the data

# use data.frame
est_multi <- multilevel(panel, ic = "BIC3", standarise = TRUE, r_max = 5,
                           depvar_header = "dlPrice", i_header = "Region",
                           j_header = "LPA_Type", t_header = "Date")
# or one can use a list of data matrices
Y_list <- panel2list(panel, depvar_header = "dlPrice", i_header = "Region",
                                       j_header = "LPA_Type", t_header = "Date")
est_multi <- multilevel(Y_list, ic = "BIC3", standarise = TRUE, r_max = 5)

GCCfactor documentation built on Nov. 2, 2023, 5:59 p.m.