BAYESAB正态分布测试

时间:2018-08-31 01:18:24

标签: r bayesian

在BAYESAB软件包中,提供了以下示例:

A_norm <- rnorm(100, 6, 1.5)
B_norm <- rnorm(100, 5, 2.5)

AB2 <- bayesTest(A_norm, B_norm,
             priors = c('mu' = 5, 'lambda' = 1, 'alpha' = 3, 'beta' = 1),
             distribution = 'normal')'

从两个分布A_norm和dB_norm-如何生成mu,lambda,alpha和beta的值?

非常感谢。

1 个答案:

答案 0 :(得分:0)

来自?bayesTest(黑体字)

• Normal: If your data is well modeled by the normal  
          distribution, with parameters mu, sigma^2 controlling mean  
          and variance of the underlying distribution  

            • Data _can_ be negative if it makes sense for your
              experiment

            • Uses a conjugate ‘NormalInverseGamma’ distribution for
              the parameters *mu* and *sigma^2* in the Normal
              Distribution.

            • ‘mu’, ‘lambda’, ‘alpha’, and ‘beta’ must be set for prior
              distributions over *mu, sigma^2* in accordance with the
              parameters of the conjugate prior distributions:

                • mu, sigma^2 ~ NormalInverseGamma(mu, lambda, alpha,
                  beta)

            • This is a bivariate distribution (commonly used to model
              mean and variance of the normal distribution).  You may
              want to experiment with both this distribution and the
              ‘plotNormal’ and ‘plotInvGamma’ outputs separately before
              arriving at a suitable set of priors for the Normal and
              LogNormal ‘bayesTest’

总结一下,mulambdaalphabeta表示(mu,{{1 }})的正态分布。如何为您的先验选择参数是一个非常广泛的问题,通常需要特定领域的知识。在贝叶斯推理中,选择哪个先验(进而选择哪个参数值)是一个关键问题,您可以找到许多有关此的文献。

在这种情况下,您假设一个Normal-inverse-gamma distribution,其中sigma^2是位置参数,mu是缩放参数,lambdaalphainverse Gamma distribution的参数,该参数定义了beta上的在先条件。了解先验的潜在概率分布并考虑到您/任何先验知识后,您可以根据要考虑信息还是非信息性来选择参数(弱)优先于正态分布的参数sigma^2mu