library(MASS)
の nnet() で生成された
人工にゅうらるねっと
の例.
実データを正規乱数で修飾した炭化水素 (人工)
データ 200 パターンでトレイニングされた
あるにゅうらるねっとアリ個体.
上から出力層・隠れ層・入力層.
入力層は 25 個のけみかる感覚素子からなっている.
赤い結線はプラス,
青い結線はマイナスの加重,
太さは加重の大きさをあらわす
(加重がゼロにちかい結線は描画してない).
入力層・隠れ層の数値は閾値.
pairs()
を工夫してみた.
二変量正規分布 (二次元正規分布; bivariate normal distribution)
の confidential region (信頼領域?) は
library(ellipse)
(
R Graphical Manuals の図)
の ellipse()
関数を使って描画.
pairs(..., upper.panel = pfunc1, ...)
の pfunc1 パネル関数はこんなかんぢで.
plot.ellipse <- function(x, y, level, col)
{
f <- is.finite(x) & is.finite(y)
x <- x[f]
y <- y[f]
exy <- ellipse(cor(x, y), level = level)
polygon(
mean(x) + exy[,1] * sd(x),
mean(y) + exy[,2] * sd(y),
border = NA,
col = col
)
}
pfunc1 <- function(x, y)
{
plot.ellipse(x, y, 0.8, col = "#ffff00")
plot.ellipse(x, y, 0.5, col = "#eeee00")
points(
x, y,
col = c(rep("#ff4000", n.location), rep("#0000ff", n.location)),
pch = 21,
cex = v.col * 0.25
)
usr <- par("usr"); on.exit(par(usr))
par(usr = c(0, 1, 0, 1))
rect(0, 0, 1, 1)
}
library(VGAM)
な vglm()
解析にとりくんでみる.
これの family = posnegbinomial
すなわち positive negative binomial 分布
なる positive なのか negative なのかはっきりしてくれー
な分布
(その実体はゼロが「見えない」負の二項分布)
なるモノがつかえるのだけど
……
これも glm.nb()
と同じくデータ数が少ないときは計算を途中で投げ出してしまう,
とわかった.
おとなしく
family = pospoisson
とする
……
実際のところ,
ちょっと overdispersion ぎみな気もするんだが.