estTSFmodel: Estimate Time Series Factor Model

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/tsfa.R

Description

Estimate a TSFmodel.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
    estTSFmodel(y, p, diff.=TRUE, 
                est="factanal", 
		estArgs=list(scores="none", control=list(opt=list(maxit=10000))),
                rotation=if(p==1) "none" else "quartimin", 
		rotationArgs=NULL, 
		GPFargs=list(Tmat=diag(p),normalize=TRUE, eps=1e-5, maxit=1000), 
		BpermuteTarget=NULL,
                factorNames=paste("Factor", seq(p)))
    estTSF.ML(y, p, diff.=TRUE,
                rotation=if(p==1) "none" else "quartimin", 
		rotationArgs=NULL,  
		normalize=TRUE, eps=1e-5, maxit=1000, Tmat=diag(p),
 		BpermuteTarget=NULL,
                factorNames=paste("Factor", seq(p)))

Arguments

y

a time series matrix.

p

integer indication number of factors to estimate.

diff.

logical indicating if model should be estimated with differenced data.

est

character vector indicating the factor estimation method (currently only factanal is supported).

estArgs

list passed to as arguments to the estimation function.

rotation

character vector indicating the factor rotation method (see GPArotation for options).

rotationArgs

list passed to the rotation method, specifying arguments for the rotation criteria.

GPFargs

list passed to GPFoblq or GPForth, possibly via the rotation method, specifying arguments for the rotation optimization. See GPFoblq and GPForth.

normalize

Passed to GPFoblq. TRUE means do Kaiser normalization before rotation and then undo it after completing rotatation. FALSE means do no normalization. See GPFoblq for other possibilities.

eps

passed to GPFoblq

maxit

passed to GPFoblq

Tmat

passed to GPFoblq

BpermuteTarget

matrix of loadings. If supplied, this is used to permute the order of estimated factors and change signs in order to compare properly.

factorNames

vector of strings indicating names to be given to factor series.

Details

The function estTSF.ML is a wrapper to estTSFmodel.

The function estTSF.ML estimates parameters using standard (quasi) ML factor analysis (on the correlation matrix and then scaled back). The function factanal with no rotation is used to find the initial (orthogonal) solution. Rotation, if specified, is then done with GPFoblq. factanal always uses the correlation matrix, so standardizing does not affect the solution.

If diff. is TRUE (the default) the indicator data is differenced before it is passed to factanal. This is necessary if the data is not stationary. The resulting Bartlett factor score coefficient matrix (rotated) is applied to the undifferenced data. See Gilbert and Meijer (2005) for a discussion of this approach.

If rotation is "none" the result of the factanal estimation is not rotated. In this case, to avoid confusion with a rotated solution, the factor covariance matrix Phi is returned as NULL. Another possibility for its value would be the identity matrix, but this is not calculated so NULL avoids confusion.

The arguments rotation, methodArgs, normalize, eps, maxit, and Tmat are passed to GPFoblq.

The estimated loadings, Bartlett factor score coefficient matrix and predicted factor scores are put in a TSFmodel which is part of the returned object. The Bartlett factor score coefficient matrix can be calculated as

(B' Omega exp(-1) B) exp(-1) B' Omega exp(-1) x

or equivalently as

(B' Sigma exp(-1) B) exp(-1) B' Sigma exp(-1) x

The first is simpler because Omega is diagonal, but breaks down with a Heywood case, because Omega is then singular (one or more of its diagonal elements are zero). The second only requires nonsingularity of Sigma. Typically, Sigma is not singular even if Omega is singular. Sigma is calculated from B Phi B' + Omega, where B, Phi, and Omega are the estimated values returned from factanal and rotated. The data covariance could also be used for Sigma. (It returns the same result with this estimation method.)

The returned TSFestModel object is a list containing

model

the estimated TSFmodel.

data

the indicator data used in the estimation.

estimates

a list of

estimation

a character string indicating the name of the estimation function.

diff.

the setting of the argument diff.

rotation

the setting of the argument rotation.

uniquenesses

the estimated uniquenesses.

BpermuteTarget

the setting of the argument BpermuteTarget.

Value

A TSFestModel object which is a list containing TSFmodel, the data, and some information about the estimation.

Author(s)

Paul Gilbert and Erik Meijer

References

Gilbert, Paul D. and Meijer, Erik (2005) Time Series Factor Analaysis with an Application to Measuring Money. Research Report 05F10, University of Groningen, SOM Research School. Available from https://hdl.handle.net/11370/d7d4ea3d-af1d-487a-b9b6-c0816994ef5a.

See Also

TSFmodel, GPFoblq, rotations, factanal

Examples

 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
27
28
29
30
31
32
  if (require("CDNmoney")){
    data("CanadianMoneyData.asof.28Jan2005", package="CDNmoney")
    data("CanadianCreditData.asof.28Jan2005", package="CDNmoney")
 
    z <- tframed(tbind(
  	MB2001,
  	MB486 + MB452 + MB453 ,
  	NonbankCheq,
  	MB472 + MB473 + MB487p,
  	MB475,
  	NonbankNonCheq + MB454 + NonbankTerm + MB2046 + MB2047 + MB2048 +
  	MB2057 + MB2058 + MB482),
  	names=c("currency", "personal cheq.", "NonbankCheq",
  	"N-P demand & notice", "N-P term", "Investment" )
      )
 
    z <- tfwindow(tbind (z, ConsumerCredit, ResidentialMortgage,
  			    ShortTermBusinessCredit, OtherBusinessCredit),
  	 start=c(1981,11), end=c(2004,11))
 
    cpi <- 100 * M1total / M1real
    popm <- M1total / M1PerCapita
    scale <- tfwindow(1e8 /(popm * cpi), tf=tframe(z))

    MBandCredit <- sweep(z, 1, scale, "*")
    c4withML  <- estTSF.ML(MBandCredit, 4)
    tfplot(ytoypc(factors(c4withML)),
  	   Title="Factors from 4 factor model (year-to-year growth rate)")
    tfplot(c4withML, graphs.per.page=3)
    summary(c4withML)
    summary(TSFmodel(c4withML))
  }

Example output

Loading required package: GPArotation
Loading required package: dse
Loading required package: tfplot
Loading required package: tframe

Attaching package: 'dse'

The following objects are masked from 'package:stats':

    acf, simulate

Loading required package: EvalEst
Loading required package: CDNmoney
factors have  277  observations from: 1981 11  to  2004 11 
     Estimated loadings:
NULL

     Standardized (using differenced data covariance):
                              Factor 1    Factor 2    Factor 3    Factor 4
currency                    1.01983211  0.09441862  0.09386876  0.08001695
personal cheq.             -0.02898840  0.20319639 -0.87632955  0.07894600
NonbankCheq                 0.20214387 -0.13884613 -0.36792951 -0.11966332
N-P demand & notice         0.55851463 -0.00326414 -0.20169780 -0.24090075
N-P term                    0.02120284  0.10107575  0.23481508 -0.33307726
Investment                  0.15013102  0.45888993  0.23944032 -0.06862474
Consumer Credit             0.01841197  0.10508972 -0.10142580 -0.79551987
Residential Mortgage        0.21597515  0.49350633 -0.22622020 -0.14854196
Short Term Business Credit -0.09041731  0.23970572  0.01376311 -0.09703765
Other Business Credit       0.09632589  0.66331904 -0.23994908 -0.04224045

                 Mean of data:
            Series 1  Series 2  Series 3 Series 4 Series 5  Series 6  Series 7
explained 813.991331 4269.2896   78.4043 3126.973 4077.171 15390.097 4052.2894
actual    819.909058 4151.6513  539.9685 1902.856 2319.560 16637.501 4154.8935
error      -5.917727  117.6383 -461.5642 1224.117 1757.612 -1247.404 -102.6041
           Series 8  Series 9  Series 10
explained 9185.9445  5376.997 11974.7940
actual    9909.9751  7568.010 11222.5148
error     -724.0306 -2191.013   752.2792

		  Mean of differenced data:
            Series 1 Series 2   Series 3  Series 4  Series 5  Series 6
explained 1.47595493 6.753944 -0.3051294  7.062696 15.997702 46.541336
actual    1.39838537 2.880048  3.1577833  9.156883  4.926683 48.744141
error     0.07756956 3.873897 -3.4629128 -2.094187 11.071019 -2.202805
            Series 7  Series 8  Series 9 Series 10
explained 13.3599344 24.335148 16.322258 31.695674
actual    12.7034230 29.878367 -8.066348 37.283246
error      0.6565114 -5.543219 24.388606 -5.587572

     Mean of factors:
  Factor 1   Factor 2   Factor 3   Factor 4 
  48.21825  283.91583  -60.31811 -123.47407 

    Mean of differenced factors:
   Factor 1    Factor 2    Factor 3    Factor 4 
 0.07240118  0.79590893 -0.03766539 -0.44814674 

   Fit statistics:
       chisq           df         pval        delta        RMSEA          RNI 
 17.84348219  11.00000000   0.08528416   6.84348219   0.04747748   0.98988468 
         CFI          MCI          GFI         AGFI          AIC         CAIC 
  0.98988468   0.98767892   0.98812338   0.94061689  -4.15651781 309.14112028 
         SIC          CAK           CK 
265.14112028   0.38349088   0.39672577 

tsfa documentation built on Jan. 13, 2021, 10:53 a.m.