estTSFmodel {tsfa} | R Documentation |
Estimate a TSFmodel
.
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)))
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. |
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
TSFmodel
.diff
.rotation
.BpermuteTarget
.
A TSFestModel
object which is a list containing TSFmodel
,
the data, and some information about the estimation.
Paul Gilbert and Erik Meijer
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 http://som.eldoc.ub.rug.nl/reports/themeF/2005/05F10/.
TSFmodel
,
GPFoblq
,
rotations
,
factanal
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)) }