BAING - Chooses number of factors in linear factor model
This procedure estimates the required number of factors in a linear factor model using the formulas in Bai and Ng(2002), "Determining the Number of Factors in Approximate Factor Models", Econometrica, 2002, vol 70, pp 191-222.
@BaiNg( options ) x
Parameters:
x = nper x nvar matrix of data. The factors are nper x 1 vectors
Options:
[CENTER]/NOCENTER - subtract means from data columns
STANDARDIZE/[NOSTANDARDIZE] - standardize data columns to mean zero, unit variance
MAX=maximum number of factors to consider
TITLE=title for report ["Bai-Ng Factor Determination"]
Example:
This is an example from Tsay's Analysis of Financial Time Series. The data set has 36 time periods with returns from 40 securities. Note that the data needs to be put into a rectangular array of data before being input to the procedure.
@BaiNg( options ) x
Parameters:
x = nper x nvar matrix of data. The factors are nper x 1 vectors
Options:
[CENTER]/NOCENTER - subtract means from data columns
STANDARDIZE/[NOSTANDARDIZE] - standardize data columns to mean zero, unit variance
MAX=maximum number of factors to consider
TITLE=title for report ["Bai-Ng Factor Determination"]
Example:
This is an example from Tsay's Analysis of Financial Time Series. The data set has 36 time periods with returns from 40 securities. Note that the data needs to be put into a rectangular array of data before being input to the procedure.
- Code: Select all
*
* Tsay, Analysis of Financial Time Series, 3rd edition
* Example 9.6.2 from pp 500-501
*
open data m-apca0103.txt
calendar(panelobs=36,m) 2001
data(format=free,org=columns) 1//2001:01 40//2003:12 id date retn
*
compute nper=36
compute nvar=40
*
* Repackage data into an nper x nvar matrix
*
dec rect rmat(nper,nvar)
ewise rmat(i,j)=retn((j-1)*nper+i)
*
* Do Bai-Ng analysis of number of factors
*
@BaiNg(max=10,center) rmat