File: test-268.R

package info (click to toggle)
r-cran-openmx 2.21.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 14,412 kB
  • sloc: cpp: 36,577; ansic: 13,811; fortran: 2,001; sh: 1,440; python: 350; perl: 21; makefile: 5
file content (28 lines) | stat: -rw-r--r-- 741 bytes parent folder | download | duplicates (2)
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
library(testthat)
library(OpenMx)
data(demoOneFactor)
context("268")

body <- function() {
  E <- mxAlgebra(U%x%1,name="E")
  
  factorModel <- mxModel(
    "One Factor",
    mxMatrix("Full", 5, 1, values=0.8,
             free=TRUE, name="A"),
    mxMatrix("Symm", 1, 1, values=1,
             free=FALSE, name="L"),
    mxMatrix("Diag", 5, 5, values=1,
             free=TRUE, name="U"),
    mxAlgebra(A %*% L %*% t(A) + E, name="R"),
    mxExpectationNormal(covariance = "R",
                        dimnames = names(demoOneFactor)),
    mxFitFunctionML(),
    mxData(cov(demoOneFactor), type="cov", numObs=500)
  )
  
  expect_error(mxCheckIdentification(factorModel,details=T),
               "'E' not found")
}

test_that("268", body)