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)))
a time series matrix.
integer indication number of factors to estimate.
logical indicating if model should be estimated with differenced data.
character vector indicating the factor estimation method (currently only factanal is supported).
list passed to as arguments to the estimation function.
character vector indicating the factor rotation method (see GPArotation for options).
list passed to the rotation method, specifying arguments for the rotation criteria.
list passed to GPFoblq
or GPForth
, possibly via
the rotation method, specifying arguments for the rotation
optimization. See GPFoblq
and GPForth
.
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.
passed to GPFoblq
passed to GPFoblq
passed to GPFoblq
matrix of loadings. If supplied, this is used to permute the order of estimated factors and change signs in order to compare properly.
vector of strings indicating names to be given to factor series.
A TSFestModel
object which is a list containing TSFmodel
,
the data, and some information about the estimation.
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
or equivalently as
The first is simpler because factanal
and rotated.
The data covariance could also be used for
The returned TSFestModel
object is a list containing
the estimated TSFmodel
.
the indicator data used in the estimation.
a list of
diff
.rotation
.BpermuteTarget
.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.
# 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