You are here

mxFactorScores - Error: The KA matrix associated with ... is not an N x 1 matrix

2 posts / 0 new
Last post
rabil's picture
Offline
Joined: 01/14/2010 - 16:47
mxFactorScores - Error: The KA matrix associated with ... is not an N x 1 matrix
AttachmentSize
Binary Data df.R5.12 KB
Binary Data model.R1.76 KB

Not sure why I'm getting an error when I'm trying to compute factor scores using mxFactorScores with type="ML". The model has two correlated latent factors.

> fit.lisrel <- mxRun(model.lisrel)
Running Model LISREL
> summary(fit.lisrel)
Summary of Model LISREL

free parameters:
name matrix row col Estimate Std.Error A lbound ubound
1 b_e_nc LX c_nc_el mu_e 1.13324087 0.16178139
2 b_o_nc LX c_nc_or mu_o 1.11548157 0.13534684
3 v_e PH mu_e mu_e 0.11987041 0.03554072 0.01
4 c_o_e PH mu_e mu_o 0.11254740 0.02801911
5 v_o PH mu_o mu_o 0.10934125 0.03024280 0.01
6 ve_e_c TD c_el c_el 0.09987208 0.02010980 0.01
7 ve_e_nc TD c_nc_el c_nc_el 0.03943778 0.01468339 * 0.01*
8 ve_o_c TD c_or c_or 0.07741426 0.01486479 0.01
9 ve_o_nc TD c_nc_or c_nc_or 0.01000000 0.01076563 * 0.01*
10 a_e_nc TX c_nc_el one -0.27638895 0.06264959
11 a_o_nc TX c_nc_or one 0.07936456 0.14602501
12 m_e KA mu_e one -0.22996375 0.05770119
13 m_o KA mu_o one 1.03733849 0.05319423

.
.
.

> mxFactorScores(fit.lisrel,type="ML")

Running FactorScoresModel LISREL1Of66
Error: The KA matrix associated with the LISREL expectation function in model 'FactorScoresModel LISREL1Of66' is not an N x 1 matrix.

But I'm able to use type="Regression":

> factor.scores <- mxFactorScores(fit.lisrel,type="Regression")
Computing Kalman scores in frontend R. This may take a few seconds.

Here is the KA matrix:

> fit.lisrel$matrices$KA
FullMatrix 'KA'

$labels
one
mu_e "m_e"
mu_o "m_o"

$values
one
mu_e -0.2299637
mu_o 1.0373385

$free
one
mu_e TRUE
mu_o TRUE

$lbound: No lower bounds assigned.

$ubound: No upper bounds assigned.

The R code and data dump are attached as files.

mhunter's picture
Offline
Joined: 07/31/2009 - 15:26
Works on my machine

Thanks for the thorough output and minimal working example. It really helps the developers a lot!

I'm not sure why it's not working on your machine. It runs fine on mine with the latest binary release: 2.3.1.

> mxVersion()
OpenMx version: 2.3.1 [GIT v2.3.1]
R version: R version 3.2.0 (2015-04-16)
Platform: x86_64-w64-mingw32
Default optimiser: SLSQP

I do recall finding a bug that would probably give the error message you reported. It was fixed here: https://github.com/OpenMx/OpenMx/commit/e3ace59b7121995a8cdcf8ec555a9e3bec179b55#diff-66ac48d9e019e14b4983f5c15966b265L41 on August 19th.

Hopefully this resolves the issue for you, too!

Cheers,
Mike Hunter