Learn R Programming

tsfa (version 2021.1-3)

estTSFmodel: Estimate Time Series Factor Model

Description

Estimate a TSFmodel.

Usage

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.

Value

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

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^{-1} B)^{-1} B' \Omega^{-1} x$$

or equivalently as

$$(B' \Sigma^{-1} B)^{-1} B' \Sigma^{-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.

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

Run this code
# NOT RUN {
  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))
  }
# }

Run the code above in your browser using DataLab