glm の当てはめについて、一般化線形モデルの残差です。行ごとに 1 つです (既定は "deviance")。R の residuals(fit, type) と同等です。残差の種類は 2 番目の引数、またはオプション type で指定します (両方を指定すると RangeError になります)。
glm
"deviance"
residuals(fit, type)
type
Optional
const fit = glm([1, 2, 3, 4, 5, 6], [0, 0, 1, 0, 1, 1], { family: "binomial" });glmResiduals(fit); // [-0.30644, -0.54776, 1.4436, -1.4436, 0.54776, 0.30644]glmResiduals(fit, "pearson"); // [-0.21925, -0.40231, 1.3546, -1.3546, 0.40231, 0.21925] コピー
const fit = glm([1, 2, 3, 4, 5, 6], [0, 0, 1, 0, 1, 1], { family: "binomial" });glmResiduals(fit); // [-0.30644, -0.54776, 1.4436, -1.4436, 0.54776, 0.30644]glmResiduals(fit, "pearson"); // [-0.21925, -0.40231, 1.3546, -1.3546, 0.40231, 0.21925]
一般化線形モデルの残差です。残差の種類はオプションで指定します (例: glmResiduals(fit, { type: "pearson" }))。
glmResiduals(fit, { type: "pearson" })
const fit = glm([1, 2, 3, 4, 5, 6], [0, 0, 1, 0, 1, 1], { family: "binomial" });glmResiduals(fit, { type: "pearson" }); // [-0.21925, -0.40231, 1.3546, -1.3546, 0.40231, 0.21925] コピー
const fit = glm([1, 2, 3, 4, 5, 6], [0, 0, 1, 0, 1, 1], { family: "binomial" });glmResiduals(fit, { type: "pearson" }); // [-0.21925, -0.40231, 1.3546, -1.3546, 0.40231, 0.21925]
glmの当てはめについて、一般化線形モデルの残差です。行ごとに 1 つです (既定は"deviance")。R のresiduals(fit, type)と同等です。残差の種類は 2 番目の引数、またはオプションtypeで指定します (両方を指定すると RangeError になります)。