Skip to content

Commit f478040

Browse files
committed
Merge branch 'main' of github.com:philchalmers/mirt
2 parents f0467d5 + 1f6b130 commit f478040

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

tests/tests/test-02-mirtTwo.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,5 +181,5 @@ test_that('poly', {
181181
ER <- fscores(modp2, returnER = TRUE)
182182
expect_equal(as.numeric(ER), c(0.4882546, 0.5099054), tolerance=1e-4)
183183
suppressWarnings(ER2 <- fscores(modp2, returnER = TRUE, mean = c(-1, 1), cov = matrix(c(1.5,1,1,2), 2)))
184-
expect_equal(as.numeric(ER2), c(0.5434572, 0.5930109 ), tolerance=1e-4)
184+
expect_equal(as.numeric(ER2), c(0.5433246, 0.5929488), tolerance=1e-4)
185185
})

tests/tests/test-03-bfactor.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ test_that('dich data', {
1111
cfs <- as.numeric(na.omit(cfs[cfs != 0 & cfs != 1]))
1212
expect_equal(cfs, c(0.7861, 0.5159, 1.0563, 0.4426, 0.0102, 0.875, -1.0729, -1.3116, -0.8343, 1.4909, 1.066, 1.9157, 0.8135, 0.3039, 1.3231, 0.471, 0.1911, 0.7509, 1.1476, 0.8265, 1.4687, -0.1526, -0.5584, 0.2532, -1.1727, -1.4361, -0.9093, 0.5277, 0.296, 0.7595, 0.5813, 0.1573, 1.0053, -0.5576, -0.7686, -0.3465, 0.968, 0.6684, 1.2677, 0.5136, 0.0972, 0.9299, 0.6283, 0.3893, 0.8672, 1.1389, 0.8043, 1.4734, 0.5835, 0.0236, 1.1435, -2.1287, -2.5185, -1.7389, 1.0383, 0.6538, 1.4228, 0.9505, 0.3252, 1.5758, 1.5624, 1.1836, 1.9412, 0.6731, 0.3993, 0.9468, 0.524, 0.0133, 1.0347, -1.57, -1.8547, -1.2853, 0.4473, 0.051, 0.8437, 1.0716, 0.2209, 1.9223, 2.4985, 1.8584, 3.1386, 1.0389, 0.7071, 1.3706, 0.8009, 0.2857, 1.316, -0.4025, -0.6423, -0.1626, 1.5827, 0.1568, 3.0087, 0.8549, -0.9418, 2.6517, 5.4019, 3.4336, 7.3702, 0.1221, -0.0922, 0.3364, 0.2729, -0.0654, 0.6113, -0.3504, -0.532, -0.1689, 1.0958, 0.7507, 1.4409, 0.5884, 0.1265, 1.0502, 0.8847, 0.629, 1.1404, 1.0908, 0.6922, 1.4894, 1.034, 0.4259, 1.642, 1.3605, 1.0081, 1.713, 1.3277, 0.9036, 1.7518, 0.5674, 0.0418, 1.0931, 2.0162, 1.6303, 2.4022, 0.7375, 0.4793, 0.9957, 0.3912, 0.0054, 0.777, -0.3909, -0.5967, -0.185, 1.5223, 0.7735, 2.271, 0.3034, -0.545, 1.1518, 4.1836, 3.3304, 5.0369, 1.7575, 1.3192, 2.1959, 0.1929, -0.3447, 0.7304, -0.8748, -1.1651, -0.5845, 0.8645, 0.5785, 1.1506, 0.0331, -0.3091, 0.3754, 0.2388, 0.0304, 0.4472, 1.5332, 0.9808, 2.0856, 0.4104, -0.1434, 0.9642, 2.6505, 2.1186, 3.1823, 0.5263, 0.0806, 0.9721, 0.6773, -0.1142, 1.4687, 2.6609, 2.1603, 3.1615, 1.6737, 0.8655, 2.4818, -0.0344, -0.7411, 0.6722, 3.6147, 2.7752, 4.4542, 0.6087, 0.3653, 0.8522, 0.4945, 0.0858, 0.9031, -0.8815, -1.1074, -0.6556, 1.2319, 0.8525, 1.6114, 0.2423, -0.1535, 0.6382, 1.2882, 1.0023, 1.5741, 0.7354, 0.476, 0.9947, 0.6426, 0.2139, 1.0712, -0.5995, -0.8249, -0.3742, 1.4898, 1.0991, 1.8806, 0.4859, 0.0468, 0.9251, -0.1725, -0.4279, 0.0828, 1.9058, 1.3075, 2.504, 0.415, -0.169, 0.9991, 2.8064, 2.2378, 3.375, 1.0572, 0.761, 1.3534, 0.149, -0.2358, 0.5338, 0.1725, -0.0414, 0.3863, 1.2276, 0.0476, 2.4075, 2.0402, -1.1072, 5.1875, -1.1821, -2.307, -0.0571, 0.4342, 0.1946, 0.6738, -0.1733, -0.5266, 0.1801, -0.2521, -0.4383, -0.0658, 2.5816, 1.5551, 3.6081, -0.235, -0.9097, 0.4398, 2.9944, 2.0731, 3.9156, 0.1326, -0.1185, 0.3838, 0.0294, -0.3714, 0.4302, -1.6521, -1.8929, -1.4113),
1313
tolerance = 1e-2)
14-
fs <- suppressWarnings(fscores(mod1, verbose = FALSE, full.scores=FALSE))
14+
fs <- suppressWarnings(fscores(mod1, verbose = FALSE, full.scores=FALSE, method='MAP'))
1515
expect_is(fs, 'matrix')
16-
expect_equal(fs[1:6,'G'], c(-1.3732391, -0.8030791, -1.4868364, -1.4993907, -1.7456934, -1.4884274), tolerance = 1e-2)
16+
expect_equal(fs[1:6,'G'], c(-1.0103793, -0.7807428, -1.2088350, -1.4099888, -2.0074429, -1.2226505), tolerance = 1e-2)
1717
cof <- coef(mod1, verbose = FALSE)
1818
expect_is(cof, 'list')
1919
sum <- summary(mod1, verbose = FALSE)
2020
expect_is(sum, 'list')
2121
fs <- suppressWarnings(fscores(mod1, method = 'EAPsum', verbose = FALSE, full.scores=FALSE))
22-
expect_equal(fs[1:3,'G'], c(-3.086119, -3.028427, -2.959479), tolerance = 1e-4)
23-
expect_equal(fs[1:3,'S1'], c(-1.3570059, -1.0763476, -0.7813406), tolerance = 1e-4)
22+
expect_equal(fs[1:3,'G'], c(-3.153030, -2.973976, -2.786622), tolerance = 1e-4)
23+
expect_equal(fs[1:3,'S1'], c(-1.319310, -1.097647, -0.893891), tolerance = 1e-4)
2424
fit <- suppressWarnings(M2(mod1))
2525
expect_equal(fit$M2, 553.6781, tolerance = 1e-2)
2626
expect_equal(fit$df, 432, tolerance = 1e-2)

tests/tests/test-04-multipleGroup.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,5 +204,6 @@ test_that('one factor', {
204204

205205
fs1 <- fscores(mod_metric, verbose = FALSE, full.scores=FALSE)
206206
expect_is(fs1, 'list')
207-
expect_true(mirt:::closeEnough(fs1[[1L]][1:6, 'F3'] - c(-0.3666644,-0.4531451,-0.194526,0.07536214,0.3359495,-0.4426196), -1e-3, 1e-3))
207+
expect_equal(fs1[[1L]][1:6, 'F3'],
208+
c(-0.36817499, -0.45410998, -0.19616041, 0.07609491, 0.33779790, -0.44366024), tolerance = 1e-2)
208209
})

tests/tests/test-10-extras.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ test_that('extras', {
1010
fs1 <- fscores(mod1, verbose = FALSE, custom_den = fun, MIN = -3, MAX = 3, full.scores=FALSE)
1111
fs2 <- suppressWarnings(fscores(mod1, custom_den = fun, MIN = -3, MAX = 3, verbose = FALSE, method = 'MAP',
1212
full.scores=FALSE))
13-
expect_equal(as.numeric(fs1[1,c('F1', 'SE_F1')]), c(-2.4766, .4988), tolerance = 1e-3)
14-
expect_equal(as.numeric(fs2[5,c('F1', 'SE_F1')]), c(-1.9121, .9381), tolerance = 1e-3)
13+
expect_equal(as.numeric(fs1[1,c('F1', 'SE_F1')]), c(-2.4407, 0.4927), tolerance = 1e-3)
14+
expect_equal(as.numeric(fs2[5,c('F1', 'SE_F1')]), c(-1.9121379, 0.9381842), tolerance = 1e-3)
1515

1616
if(FALSE){
1717
rm(list=ls())

0 commit comments

Comments
 (0)