裏 RjpWiki

Julia ときどき R, Python によるコンピュータプログラム,コンピュータ・サイエンス,統計学

F 分布の概形を示す GIF アニメーション

2021年06月21日 | ブログラミング

第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()

コメント    この記事についてブログを書く
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする
« χ2分布の概形を示す GIF ア... | トップ | コイントスで中心極限定理を... »
最新の画像もっと見る

コメントを投稿

ブログラミング」カテゴリの最新記事