第1自由度が 1, 2 のときはそれ以外の場合と形が違う。
以下がプログラム。
using Plots, PlotThemes, Rmath
function fdistribution(;fps=5)
x = 0:0.05:7
theme(:gruvbox_dark)
pyplot(grid=false, label="", size=(400, 300))
anim = @animate for ν1 = 1:10, ν2 = 1:10
plot(x, df.(x, ν1, ν2), color=:yellow, alpha=0.8,
tick_direction=:out, tickfontsize=10,
xlims=(0, 7), ylims=(0, 1), xlabel="\$x\$",
ylabel="\$f(x;ν1,ν2)\$: Probability density function",
title="F distribution")
annotate!(4, 0.2, text("ν1 = $ν1, ν2 = $ν2", :left, 10, :white))
end
gif(anim, "fdistribution.gif", fps=fps)
end
fdistribution()
※コメント投稿者のブログIDはブログ作成者のみに通知されます