Functions for the Estimation of the Factor Dimension
1 2 3 4 5 6 7 8 9 10 11 12 13 14 
Obj 
The function requires either a Txn matrix or an object with class "‘Eup"’ or "‘KSS"’. 
criteria 
A character vector that contains the desired criteria to be used. If it is left unspecified, the function returns the result of all 16 criteria. 
standardize 
logical. If 
d.max 
Maximal dimension used in the dimensionalitycriteria of Bai
(2009). The default ( 
sig2.hat 
The squared standard deviation of the errorterm required for the computation of some dimensionality criteria. The user can specify it in instead of 
spar 
Smoothing parameter used to calculate the criterion of Kneip, Sickles, and Song (2012). The default is 
level 
The significance level used for the criterion of Kneip, Sickles, and Song (2012). The default is 0.01. 
c.grid 
Required only for computing 
T.seq 
Required only for computing 
n.seq 
Required only for computing 
The function 'OptDim' allows for a comparison of the optimal factor dimensions obtained from different panel criteria (in total 13). This criteria are adjusted for panel data with diverging T and N.
'OptDim' returns an object of 'class' '"OptDim"' containing a list with the following components:
criteria: 
The name of the criteria specified by the user. 
PC1: 
If specified in 
PC2: 
If specified in 
PC3: 
If specified in 
IC1: 
If specified in 
IC2: 
If specified in 
IC3: 
If specified in 
IPC1: 
If specified in 
IPC2: 
If specified in 
IPC3: 
If specified in 
KSS.C: 
If specified in 
ED: 
If specified in 
ER: 
If specified in 
GR: 
If specified in 
summary: 
A table (in a matrix form) containing all the estimated dimensions obtained by the specified criteria. 
BaiNgC: 
A logical vector required for further internal computations. 
BaiC: 
A logical vector required for further internal computations. 
KSSC: 
A logical vector required for further internal computations. 
OnatC: 
A logical vector required for further internal computations. 
RHC: 
A logical vector required for further internal computations. 
obj: 
The argument ' 
cl: 
Object of mode "call". 
Oualid Bada
Ahn, S. C., Horenstein, A. R. 2013 “Eigenvalue ratio test for the number of factors”, Econometrica
Bai, J., 2009 “Panel data models with interactive fixed effects”, Econometrica
Bai, J. 2004 “Estimating crosssection common stochastic trends in nonstationary data”, Journal of Econometrics
Bai, J., Ng, S. 2009 “Determining the number of factors in approximated factor models”, Econometrica
Kneip, A., Sickles, R. C., Song, W., 2012 “A New Panel Data Treatment for Heterogeneity in Time Trends”, Econometric Theory
Onatski, A. 2010 “Determining the number of factors from empirical distribution of eigenvalues”, The Review of Economics and Statistics
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26  ## See the example in 'help(Cigar)' in order to take a look at the
## data set 'Cigar'
##########
## DATA ##
##########
data(Cigar)
N < 46
T < 30
## Data: CigaretteSales per Capita
l.Consumption < log(matrix(Cigar$sales, T,N))
## Calculation is based on the covariance matrix of l.Consumption
OptDim(l.Consumption)
## Calculation is based on the correlation matrix of l.Consumption
OptDim(l.Consumption, standardize = TRUE)
## Display the magnitude of the eigenvalues in percentage of the total variance
plot(OptDim(l.Consumption))

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.