web-dev-qa-db-ja.com

lme4の開発バージョンの収束エラー

Lme4の開発バージョンと this チュートリアルを使用して、混合効果モデルの消費電力解析を試みています。チュートリアルで、lme4が収束エラーをスローすることに気付きました。

## Warning: Model failed to converge with max|grad| = 0.00187101 (tol =
## 0.001)

データセットのコードを実行すると、次のように同じ警告が表示されます。

## Warning message: In checkConv(attr(opt, "derivs"), opt$par, checkCtrl =
control$checkConv,  : 
Model failed to converge with max|grad| = 0.774131 (tol = 0.001)

この更新されたバージョンでの通常のglmer呼び出しからの推定値も、更新されたCRANバージョンを使用していたときとはわずかに異なります(その場合、警告はありません)。なぜこれが起こっているのかについてのアイデアはありますか?

[〜#〜] edit [〜#〜]

指定しようとしたモデルは次のとおりです。

glmer(resp ~ months.c * similarity * percSem + (similarity | subj), family = binomial, data = myData)

私が持っているデータセットには、1つの被験者間(年齢、中央)、および2つの被験者内変数(類似性:2レベル、percSem:3レベル)があり、バイナリ結果(誤った記憶/推測)を予測しています。さらに、各被験者内セルには3つの反復測定があります。したがって、個人ごとに合計2 x 3 x 3 = 18個のバイナリ応答があり、合計38人の参加者がいます。

structure(list(subj = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 16L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 17L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 19L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 20L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 21L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 22L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 23L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 25L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 26L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 27L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 28L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 29L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 30L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 32L, 32L, 32L, 32L, 32L, 32L, 32L, 32L, 32L, 32L, 32L, 32L, 32L, 32L, 32L, 32L, 32L, 32L, 33L, 33L, 33L, 33L, 33L, 33L, 33L, 33L, 33L, 33L, 33L, 33L, 33L, 33L, 33L, 33L, 33L, 33L, 34L, 34L, 34L, 34L, 34L, 34L, 34L, 34L, 34L, 34L, 34L, 34L, 34L, 34L, 34L, 34L, 34L, 34L, 35L, 35L, 35L, 35L, 35L, 35L, 35L, 35L, 35L, 35L, 35L, 35L, 35L, 35L, 35L, 35L, 35L, 35L, 36L, 36L, 36L, 36L, 36L, 36L, 36L, 36L, 36L, 36L, 36L, 36L, 36L, 36L, 36L, 36L, 36L, 36L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 37L, 38L, 38L, 38L, 38L, 38L, 38L, 38L, 38L, 38L, 38L, 38L, 38L, 38L, 38L, 38L, 38L, 38L, 38L), .Label = c("09A", "10", "11", "12", "12A", "13", "14", "14A", "15", "15A", "16", "17", "18", "19", "1A", "2", "20", "21", "22", "22A", "23", "24", "25", "26", "27", "28", "29", "3", "30", "31", "32A", "32B", "33", "4B", "5", "6", "7", "8"), class = "factor"), months.c = structure(c(-9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, 2.18421052631579, 2.18421052631579, 2.18421052631579, 2.18421052631579, 2.18421052631579, 2.18421052631579, 2.18421052631579, 2.18421052631579, 2.18421052631579, 2.18421052631579, 2.18421052631579, 2.18421052631579, 2.18421052631579, 2.18421052631579, 2.18421052631579, 2.18421052631579, 2.18421052631579, 2.18421052631579, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, -7.81578947368421, 9.18421052631579, 9.18421052631579, 9.18421052631579, 9.18421052631579, 9.18421052631579, 9.18421052631579, 9.18421052631579, 9.18421052631579, 9.18421052631579, 9.18421052631579, 9.18421052631579, 9.18421052631579, 9.18421052631579, 9.18421052631579, 9.18421052631579, 9.18421052631579, 9.18421052631579, 9.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, 6.18421052631579, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, -9.81578947368421, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -6.81578947368421, -6.81578947368421, -6.81578947368421, -6.81578947368421, -6.81578947368421, -6.81578947368421, -6.81578947368421, -6.81578947368421, -6.81578947368421, -6.81578947368421, -6.81578947368421, -6.81578947368421, -6.81578947368421, -6.81578947368421, -6.81578947368421, -6.81578947368421, -6.81578947368421, -6.81578947368421, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 5.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, -1.81578947368421, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, 1.18421052631579, -8.81578947368421, -8.81578947368421, -8.81578947368421, -8.81578947368421, -8.81578947368421, -8.81578947368421, -8.81578947368421, -8.81578947368421, -8.81578947368421, -8.81578947368421, -8.81578947368421, -8.81578947368421, -8.81578947368421, -8.81578947368421, -8.81578947368421, -8.81578947368421, -8.81578947368421, -8.81578947368421, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 3.18421052631579, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 11.1842105263158, 0.184210526315795, 0.184210526315795, 0.184210526315795, 0.184210526315795, 0.184210526315795, 0.184210526315795, 0.184210526315795, 0.184210526315795, 0.184210526315795, 0.184210526315795, 0.184210526315795, 0.184210526315795, 0.184210526315795, 0.184210526315795, 0.184210526315795, 0.184210526315795, 0.184210526315795, 0.184210526315795, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -4.81578947368421, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -2.81578947368421, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -10.8157894736842, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, -0.815789473684205, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, 8.18421052631579, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421, -3.81578947368421), "`scaled:center`" = 70.8157894736842), similarity = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 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, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 1L,  1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 1L), .Label = c("false memory", "guess"), class = "factor")), .Names = c("subj", "months.c", "similarity", "percSem", "resp"), row.names = c(NA, -684L), class = "data.frame")
25
dmartin

tl; drこれは誤検知のように見えます-外れ値は組み込みのように見えますが、さまざまなオプティマイザとの適合には特に重要な違いはありませんNelder-Meadオプティマイザーとnlminb。組み込みのbobyqa、nloptrパッケージのbobyqaおよびNelder-Meadは、非常に厳密な回答を提供し、警告はありません。

これらの場合の私の一般的なアドバイスは、control=glmerControl(optimizer="bobyqa");で再適合を試みることです。 bobyqaをデフォルトとして使用することへの切り替えを検討しています(この質問により、証拠の重みが増加します)。

dput出力を別のファイルに配置します。

source("convdat.R")

可能なオプティマイザーの全範囲を実行します:ビルトインN-Mおよびbobyqa。 optimxパッケージを介したベースRからのnlminbおよびL-BFGS-B。およびnloptrバージョンのN-Mおよびbobyqa。

library(lme4)
g0.bobyqa <- glmer(resp ~ months.c * similarity * percSem +
                 (similarity | subj),
      family = binomial, data = myData,
                   control=glmerControl(optimizer="bobyqa"))
g0.NM <- update(g0.bobyqa,control=glmerControl(optimizer="Nelder_Mead"))
library(optimx)
g0.nlminb <- update(g0.bobyqa,control=glmerControl(optimizer="optimx",
                              optCtrl=list(method="nlminb")))
g0.LBFGSB <- update(g0.bobyqa,control=glmerControl(optimizer="optimx",
                              optCtrl=list(method="L-BFGS-B")))

library(nloptr)
## from https://github.com/lme4/lme4/issues/98:
defaultControl <- list(algorithm="NLOPT_LN_BOBYQA",xtol_rel=1e-6,maxeval=1e5)
nloptwrap2 <- function(fn,par,lower,upper,control=list(),...) {
    for (n in names(defaultControl)) 
      if (is.null(control[[n]])) control[[n]] <- defaultControl[[n]]
    res <- nloptr(x0=par,eval_f=fn,lb=lower,ub=upper,opts=control,...)
    with(res,list(par=solution,
                  fval=objective,
                  feval=iterations,
                  conv=if (status>0) 0 else status,
                  message=message))
}
g0.bobyqa2 <- update(g0.bobyqa,control=glmerControl(optimizer=nloptwrap2))
g0.NM2 <- update(g0.bobyqa,control=glmerControl(optimizer=nloptwrap2,
                           optCtrl=list(algorithm="NLOPT_LN_NELDERMEAD")))

結果を要約します。 nlminbL-BFGS-B、およびNelder-Mead(ただし、最大abs勾配のサイズはNelder-Meadから最大です)

getpar <- function(x) c(getME(x,c("theta")),fixef(x))
modList <- list(bobyqa=g0.bobyqa,NM=g0.NM,nlminb=g0.nlminb,
                bobyqa2=g0.bobyqa2,NM2=g0.NM2,LBFGSB=g0.LBFGSB)
ctab <- sapply(modList,getpar)
library(reshape2)
mtab <- melt(ctab)
library(ggplot2)
theme_set(theme_bw())
ggplot(mtab,aes(x=Var2,y=value,colour=Var2))+
    geom_point()+facet_wrap(~Var1,scale="free")

ちょうど「良い」フィット:

ggplot(subset(mtab,Var2 %in% c("NM2","bobyqa","bobyqa2")),
       aes(x=Var2,y=value,colour=Var2))+
    geom_point()+facet_wrap(~Var1,scale="free")

オプティマイザー間の推定値の変動係数:

summary(cvvec <- apply(ctab,1,function(x) sd(x)/mean(x)))

最高のCVはmonths.c、これはまだ約4%だけです...

対数尤度はそれほど変わらない:NM2は最大対数尤度を与え、すべての「良い」ものは非常に近い(「悪い」ものでも最大でも1%の違いがある)

likList <- sapply(modList,logLik)
round(log10(max(likList)-likList),1)
##  bobyqa      NM  nlminb bobyqa2     NM2  LBFGSB 
##    -8.5    -2.9    -2.0   -11.4    -Inf    -5.0 
42
Ben Bolker