[Bayes] Parameter estimation by Sampling
虽然openBugs效果不错,但原理是什么呢?需要感性认识,才能得其精髓。
Recall [Bayes] prod: M-H: Independence Sampler firstly. 采样法
Recall [ML] How to implement a neural network then. 梯度下降法
And compare them.
梯度下降,其实就是减小loss function,不断逼近拟合的过程。
那采样法呢?
y = a*x +sigma, where sigma~N(0, tao^2)
r <- prod(fy/fx)* # 求原分布的 似然比 以及 提议分布的 比值
g(xt[i-1]) / g(y[i]) # 提议分布if (u[i] <= r)
xt[i] <- y[i]
else {
xt[i] <- xt[i-1]
难道是贝叶斯线性回归?
全贝叶斯还是好
链接:https://www.zhihu.com/question/22007264/answer/70512154
- 用训练数据得到似然函数likelihood,再加上一个先验分布prior,得到一个后验分布posterior.
- 对于一个新的测试数据x,用之前得到的posterior作为权重在整个参数空间里计算一个加权积分,得到一个预测分布。(sampling method获得)
Full-Bayesian与最大似然估计,最大后验估计(MAP)不同之处在于它得到的是测试数据在整个空间上的一个概率分布,而不单纯是一个点估计。
后验形式太复杂,怎么办?
在实际中,除了少数情况(比如先验和似然函数都是高斯分布),那个后验分布的形式一般都很复杂,第二步里的积分是积不出来的。这时候就要采取一些近似方法,近似方法又分为两大类:
- 简化复杂的后验分布,然后就能算出积分的解析形式了。具体方法有变分推断,Laplace近似等。这类方法的特点是人算起来困难,机器跑起来快。
- 用采样的方法搞定后验分布。具体方法有Gibbs采样,HMC采样等。这类方法反过来了,人算起来简单,但是机器跑起来慢。
采样方法还有一个好处,就是精度算得比谁都高,但是毕竟还是too slow too simple~
对后验进行采样
From: https://zhuanlan.zhihu.com/p/20753438
贝叶斯网

Figure 01, rewrite PGM
结论:
通过sample 获得后验的一堆随机点,根据这些随机点再计算/推断出后验分布的各种统计量。
概念辨析
全贝叶斯:
The terminology "fully Bayesian approach" is nothing but a way to indicate that one moves from a "partially" Bayesian approach to a "true" Bayesian approach, depending on the context.
Or to distinguish a "pseudo-Bayesian" approach from a "strictly" Bayesian approach.
经验贝叶斯:
For example one author writes: "Unlike the majority of other authors interested who typically used an Empirical Bayes approach for RVM, we adopt a fully Bayesian approach" beacuse the empirical Bayes approach is a "pseudo-Bayesian" approach.
实质是:利用历史样本对先验分布或者先验分布的某些数字特征做出直接或间接的估计,是对贝叶斯方法的改进和推广,是介于经典统计学和贝叶斯统计学之间的一种统计推断方法。
There are others pseudo-Bayesian approaches, such as the Bayesian-frequentist predictive distribution (a distribution whose quantiles match the bounds of the frequentist prediction intervals).
In this page several R packages for Bayesian inference are presented. The MCMCglmm is presented as a "fully Bayesian approach" because the user has to choose the prior distribution, contrary to the other packages.
Another possible meaning of "fully Bayesian" is when one performs a Bayesian inference derived from the Bayesian decision theory framework, that is, derived from a loss function, because Bayesian decision theory is a solid foundational framework for Bayesian inference.
I think the terminology is used to distinguish between the Bayesian approach and the empirical Bayes approach.
Full Bayes uses a specified prior whereas empirical Bayes allows the prior to be estimated through use of data.
全贝叶斯:使用指定的先验
经验贝叶斯:使用数据估算来的先验
对openBugs的浅显的理解
未知量很多时,比如有n个。
先讨论nth的变量,那么先设定n-1个变量的值,怎么给,因为有预先假设的分布,故,从分布上随机取一个点。
注意有三个值,以及这三个值的关系:
样本中的(x, y)以及nth variable.
根据nth的值(是在假设的分布下随机取的),求出在已知样本数据(x,y)下的似然值。
一开始,很可能拟合的不好,即:似然值很小。那么调整假设分布的参数,比如正态分布的mu,使似然值达到“当前情况下”的所谓的最大。
调整后,在这个新分布下去一个值作为固定值,然后再考虑下一个变量的情况。
这里的Gibber只是代表一个算法思路,跟sampling貌似关系不大。
变量变多时,貌似过程会复杂很多,但概率图模型的作用就是告诉我们 (Figure 01, rewrite PGM),估计一个变量D时,没必要考虑 all rest,在当前情形下,只考虑B, C即可。这便大大的简化了计算时间。
这里注意到了一点与neutral network的一些区别:
Bayes方法如果参数很多怎么办?毕竟一次只能改变一个变量,如果是图片的话,即使是一个像素点一个变量,都是巨大的数量。
而neutral network 的 back propagation是一次调整众多的值。
- 以上的这个issue是否成为纯贝叶斯预测的一个瓶颈呢?
- 这种贝叶斯有局部极小点之说么?感觉没有,理论上总会出现一个能跳出局部极小点的随机点发生。
[Bayes] Parameter estimation by Sampling的更多相关文章
- (转) Parameter estimation for text analysis 暨LDA学习小结
Reading Note : Parameter estimation for text analysis 暨LDA学习小结 原文:http://www.xperseverance.net/blogs ...
- [Bayes] Hist & line: Reject Sampling and Importance Sampling
吻合度蛮高,但不光滑. > L= > K=/ > x=runif(L) > *x*(-x)^/K)) > hist(x[ind],probability=T, + xla ...
- something about Parameter Estimation (参数估计)
点估计 Point Estimation 最大似然估计(Maximum Likelihood Estimate —— MLE):视θ为固定的参数,假设存在一个最佳的参数(或参数的真实值是存在的),目的 ...
- Click Models for Web Search(2) - Parameter Estimation
在Click Model中进行参数预估的方法有两种:最大似然(MLE)和期望最大(EM).至于每个click model使用哪种参数预估的方法取决于此model中的随机变量的特性.如果model中的随 ...
- [Bayes] Metroplis Algorithm --> Gibbs Sampling
重要的是Gibbs的思想. 全概率分布,可以唯一地确定一个联合分布 ---- Hammersley-Clifford 多元高斯分布 当然,这个有点复杂,考虑个简单的,二元高斯,那么超参数就是: 二元高 ...
- [AI] 深度数学 - Bayes
数学似宇宙,韭菜只关心其中实用的部分. scikit-learn (sklearn) 官方文档中文版 scikit-learn Machine Learning in Python 一个新颖的onli ...
- 本人AI知识体系导航 - AI menu
Relevant Readable Links Name Interesting topic Comment Edwin Chen 非参贝叶斯 徐亦达老板 Dirichlet Process 学习 ...
- [ML] Bayesian Linear Regression
热身预览 1.1.10. Bayesian Regression 1.1.10.1. Bayesian Ridge Regression 1.1.10.2. Automatic Relevance D ...
- [Bayes] runif: Inversion Sampling
runifum Inversion Sampling 看样子就是个路人甲. Ref: [Bayes] Hist & line: Reject Sampling and Importance S ...
随机推荐
- Instruments
链接: iOS性能优化:Instruments使用实战 iOS 使用Instruments的工具小结
- c++对象工厂
一.简单工厂 #pragma once struct IObjectA { virtual void Test1()=0; }; class ObjectA:public IObjectA { p ...
- 关于iphone6/5/4s 在iOS8.0系统下 仅仅读@3x图片
做iphone6和plus适配时候发现一个问题,先来看图(一下讨论所有在真机下完毕,非模拟器) 128*750图片是 nav@2x.png watermark/2/text/aHR0cDovL2Js ...
- 【.NET线程--进阶(一)】--线程方法详解
上篇博客从线程的基本概况开始着重讨论了线程,进程,程序之间的区别,然后讨论了线程操作的几个类,并通过实例来说明了线程的创建方法.本篇博客将会带大家更深入的了解线程,介绍线程的基本方法,并通过一个Dem ...
- Permutations II leetcode java
题目: Given a collection of numbers that might contain duplicates, return all possible unique permutat ...
- 了解 JavaScript (3)- 马上开始
之前演示了一个 Hello World 程序,而后讲解了一些基础概念,下面开始一些基础工作. 将脚本放在哪里 脚本可以放置在两个位置 <head></head>之间,头脚本(h ...
- C# System.Collections.Queue
using System; using System.Collections; public class SamplesQueue { public static void Main() { // C ...
- 解锁scott账户方法
装完了数据库,忘了给scott账户解锁.这时可以在sql plus工具里,也可以在控制台通过命令行给scott账户解锁. 在第一种情况下,以system账户+自己安装时设置的密码,登录SQL Plus ...
- Open-Source performance testing tools(From other site)
http://www.appdynamics.com/blog/php/tools-of-the-trade-for-performance-and-load-testing/
- 在线检测域名或者ip的端口是否开放(http://coolaf.com/tool/port)
http://coolaf.com/tool/port