PROBABILISTIC INTERPRETATION ON LEAST SQUARES

Probabilistic Interpretation on Least Squares

Maths

Suppose you are asked to make a regression on a training set,


Figure 1

You might want to find a line as in the Figure 1.

Formally, to find an analytical form of this regression line, we need to formulate this problem by,


In this work, what I want to do is to present two probabilistic interpretations on Least Squares, maximum likelihood (ML) on frequentist statistics and maximum a posteriori (MAP) estimate on Bayesian School, which are two different probabilistic views of the world.


Frequentist Statistic

In the frequentist view of this world, the parameter theta is thought of as being constant-valued but unknown rather than random---it just happens to be unknown---and it’s our job to come up with statistical procedures (such as maximum likelihood) to try to estimate this parameter (as described in Part VII Regularization and model selection of Andrew Ng’s lecture notes on machine learning).

Hence, using ML, we need to choose the parameters according to


Writing down the log likelihood of the objective function to be maximized,


To formulate


we are convinced that the target variables and the inputs are related via the equation (See Figure 1 to get an intuition),


where epsilon(i) is the ith error term that captures either unmodeled effects or random noise. Furthermore, let us assume that the epsilon(i) are distributed IID (independently and identically distributed) according to a Gaussian distribution with mean zero and some variance sigma2.

Writing this assumption as


i.e. the probability density of epsilon(i) is given by

This implies that


i.e. the probability density of y(i)| x(i) is given by


Note that we should not condition on theta, since theta is not a random variable in the view of frequentist statistics.

Back into our problem to maximize l(.) (since the principal of ML says that we should choose the parameters so as to make the data as high probability as possible),


Hence, maximizing l(.) gives the same answer as minimizing


which is recognized to be J(.), our original least squares cost function.


Bayesian School

The Bayesian view of the world is an alternative way to approach parameter estimation problems. In this approach, we insist that theta is an unknown random variable with a prior distribution p(.) on it. Practically, a common choice for the prior p(.) is to assume that


Then, given a training set S, we can compute the posterior distribution on the parameters,


Unfortunately, in general, it is computationally very difficult to compute this posterior distribution in closed-form, since it requires taking integrals over the (usually high-dimensional) theta.

One common approximation to this problem, the MAP (maximum a posteriori) estimate for theta is given by


(Compare this with ML).

Likewise, we will prove that the MAP estimate gives the same answer as minimizing some least-squares-like cost function like


Writing down the log likelihood of MAP,


Therefore, maximizing the above log likelihood gives the same answer as minimizing


Hence,


The proof is completed.


Acknowledgement

This work was inspired by an innovative question raised by C. Huang who is a graduate-to-be of PKU. Some discussions were abstracted from Andrew Ng’s lecture notes on machine learning.


Postscript

May I draw a bold conclusion? Gaussian distribution is the God’s Hallows.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
SQLAlchemy 是一个 SQL 工具包和对象关系映射(ORM)库,用于 Python 编程语言。它提供了一个高级的 SQL 工具和对象关系映射工具,允许开发者以 Python 类和对象的形式操作数据库,而无需编写大量的 SQL 语句。SQLAlchemy 建立在 DBAPI 之上,支持多种数据库后端,如 SQLite, MySQL, PostgreSQL 等。 SQLAlchemy 的核心功能: 对象关系映射(ORM): SQLAlchemy 允许开发者使用 Python 类来表示数据库表,使用类的实例表示表中的行。 开发者可以定义类之间的关系(如一对多、多对多),SQLAlchemy 会自动处理这些关系在数据库中的映射。 通过 ORM,开发者可以像操作 Python 对象一样操作数据库,这大大简化了数据库操作的复杂性。 表达式语言: SQLAlchemy 提供了一个丰富的 SQL 表达式语言,允许开发者以 Python 表达式的方式编写复杂的 SQL 查询。 表达式语言提供了对 SQL 语句的灵活控制,同时保持了代码的可读性和可维护性。 数据库引擎和连接池: SQLAlchemy 支持多种数据库后端,并且为每种后端提供了对应的数据库引擎。 它还提供了连接池管理功能,以优化数据库连接的创建、使用和释放。 会话管理: SQLAlchemy 使用会话(Session)来管理对象的持久化状态。 会话提供了一个工作单元(unit of work)和身份映射(identity map)的概念,使得对象的状态管理和查询更加高效。 事件系统: SQLAlchemy 提供了一个事件系统,允许开发者在 ORM 的各个生命周期阶段插入自定义的钩子函数。 这使得开发者可以在对象加载、修改、删除等操作时执行额外的逻辑。
### 回答1: 概率观点是一种分析问题的方法,强调考虑问题的不确定性和概率。这种观点认为,许多事件和现象都无法以完全确定的方式解释和预测,而只能通过概率分析来获得更准确的结论。 概率观点的关键概念是概率,即某个事件发生的可能性。概率可以用数值来表示,范围从0到1,其中0表示不可能事件,而1表示肯定发生的事件。在概率观点中,我们可以根据以往的经验和相关数据,使用统计方法来计算概率,从而对不确定性的事件作出合理的估计。 概率观点在许多领域都有应用,如统计学、金融学、经济学、人工智能等。在统计学中,概率观点被用于推断总体的特征,从样本中推断总体可能的分布和参数。在金融学和经济学中,概率观点被用于风险管理和预测市场的变化。在人工智能中,概率观点被应用于机器学习算法,通过计算特征的概率分布来进行分类和预测。 概率观点的优点是能够准确地评估不确定性,避免了过度自信和不合理的预测。它提供了一种合理的方法来处理信息不完全或不确定的情况。然而,概率观点也有局限性,因为它基于历史数据和统计方法,可能无法应对未知的情况和突发事件。 总之,概率观点是一种重要的分析方法,通过考虑概率和不确定性来解释和预测事件。它在各个领域都有广泛应用,并且可以提供更准确和可靠的结果。尽管有一些限制,概率观点仍然是我们理解复杂世界的重要工具。 ### 回答2: 概率观点是一种在各种领域中应用的思维方式,它基于概率论和统计学的原理,通过量化不确定性来对事件的发生进行预测和解释。概率观点认为,我们无法精确预测任何事件的结果,但是可以通过概率的计算和分析,得到事件发生的可能性或可能的范围。 概率观点在科学研究中起到了重要的作用。在物理学、化学、生物学等自然科学领域中,概率观点可以帮助科学家更好地理解和解释现象。例如,在量子力学中,概率观点被用来描述粒子的行为,因为在微观尺度下,粒子的位置和动量无法被准确测量,只能通过概率分布来表示。 此外,在社会科学领域,概率观点也被广泛运用。例如,在经济学中,根据不同因素的概率分布,经济学家可以预测市场的走势和价格的变动。在心理学中,概率观点可以帮助研究者量化行为和认知过程中的不确定性,并解释人类的决策行为。 概率观点还在人工智能和机器学习等领域中发挥着重要的作用。通过概率模型和统计方法,研究人员可以训练机器学习算法,使其能够进行准确的预测和判断。例如,在人脸识别中,基于概率观点的算法可以通过比较人脸特征的概率分布,判断两个人脸是否相同。 总之,概率观点是一种重要的思维方式,可以帮助我们理解和解释世界的不确定性。通过使用概率模型和统计方法,我们可以更准确地预测和解释各种事件的发生,推动科学研究和技术发展的进步。 ### 回答3: 概率论观点即从概率的角度来看待问题。概率论是一种数学工具和研究方法,通过衡量各种可能结果发生的概率来描述和解释不确定性的现象和事件。概率论观点强调了我们对不确定性的认识和评估,认为事物的发生和结果是具有一定概率的。 概率论观点的核心概念是概率,概率表示事件发生的可能性大小。我们可以通过收集和分析数据来推断事件发生的概率,并基于概率来做出决策和预测。 在概率论观点下,我们可以对各种现象进行建模并进行预测。通过研究过去的数据和经验,我们可以推断出未来的可能结果,并根据不同的概率来评估其风险和可能性。 概率论观点在许多领域有着广泛的应用,如金融、统计学、物理学、人工智能等。在金融领域,我们可以利用概率论来计算股票价格的波动性和风险,以便做出更明智的投资决策。在人工智能领域,我们可以利用概率模型来进行模式识别和预测,以帮助机器做出智能的决策。 总之,概率论观点是一种重要的思维工具和方法,它帮助我们认识和理解不确定性,并在决策和预测中提供了一种量化的方式。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值