小编jos*_*ya7的帖子

关于正态分布均值的贝叶斯推断的玩具R代码[降雪量数据]

我有一些降雪观测:

x <- c(98.044, 107.696, 146.050, 102.870, 131.318, 170.434, 84.836, 154.686,
       162.814, 101.854, 103.378, 16.256)
Run Code Online (Sandbox Code Playgroud)

我被告知它遵循正态分布,已知标准偏差为25.4,但未知均值mu.我必须推断mu使用贝叶斯公式.

这是关于之前的信息 mu

mean of snow |  50.8  | 76.2  | 101.6 | 127.0 |  152.4 | 177.8  
---------------------------------------------------------------
probability  |   0.1  | 0.15  | 0.25  |0.25   |  0.15  |  0.1 
---------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)

以下是我到目前为止所尝试的内容,但最后一行post无法正常工作.得到的图只是给出一条水平线.

library(LearnBayes)
midpts <- c(seq(50.8, 177.8, 30))
prob <- c(0.1, 0.15, 0.25, 0.25, 0.15, 0.1)
p <- seq(50, 180, length = 40000)
histp <- histprior(p, midpts, prob) …
Run Code Online (Sandbox Code Playgroud)

statistics plot r normal-distribution bayesian

3
推荐指数
1
解决办法
955
查看次数

标签 统计

bayesian ×1

normal-distribution ×1

plot ×1

r ×1

statistics ×1