高校数学の質問スレ(医者・東大卒専用) Part438 (991レス)
上
下
前
次
1-
新
849
: 05/25(日)06:42
ID:P4nhnL8B(3/6)
AA×
>>847
[240|
320
|
480
|
600
|
100%
|
JPG
|
べ
|
レス栞
|
レス消
]
849: [sage] 2025/05/25(日) 06:42:27.34 ID:P4nhnL8B >>847 このプロトタイプをAIに与えて描画機能やコメントをつけてもらった。 beta.parameter <- function(lower, upper, credMass = 0.95, verbose = FALSE) { # Helper function to convert decimal numbers to fraction strings using MASS::fractions fractionStr <- function(x) { as.character(MASS::fractions(x)) } # Function to compute beta parameter (beta) based on alpha, # derived from the condition on the shape of the distribution between lower and upper f <- function(alpha) { 1 + ((alpha - 1) * log(upper / lower)) / log((1 - lower) / (1 - upper)) } # Root-finding function: difference between desired credible mass # and the Beta CDF probability between lower and upper with parameters (alpha, f(alpha)) g <- function(alpha) { pbeta(upper, alpha, f(alpha)) - pbeta(lower, alpha, f(alpha)) - credMass } # Find the root of g(alpha) = 0 over the interval [1, 1e5] # to find the alpha value that satisfies the credible mass condition re <- uniroot(g, c(1, 1e5)) alpha <- re$root beta <- f(alpha) # Calculate the mean of the Beta distribution mean <- alpha / (alpha + beta) # Calculate the mode if defined (alpha > 1 and beta > 1), # otherwise set mode to NA as it is undefined mode <- if (alpha > 1 && beta > 1) { (alpha - 1) / (alpha + beta - 2) } else { NA } http://rio2016.5ch.net/test/read.cgi/math/1723152147/849
このプロトタイプをに与えて描画機能やコメントをつけてもらった
上
下
前
次
1-
新
書
関
写
板
覧
索
設
栞
歴
あと 142 レスあります
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
ぬこの手
ぬこTOP
0.038s