The following content is provided under a Creative 广告素材下提供了以下内容
Commons license. 普通许可。
Your support will help MIT OpenCourseWare continue to 您的支持将帮助MIT OpenCourseWare继续
offer high quality educational resources for free. 免费提供高质量的教育资源。
To make a donation or view additional materials from 捐赠或查看其他资料
hundreds of MIT courses, visit MIT OpenCourseWare at 数百个MIT课程，请访问MIT OpenCourseWare，网址为：
ocw.mit.edu. ocw.mit.edu。
PROFESSOR: It involves real phenomena out there. 教授：它涉及真实的现象。
So we have real stuff that happens. 因此，我们发生了真正的事情。
So it might be an arrival process to a bank that we're 所以这可能是我们到达银行的过程
trying to model. 试图建模。
This is a reality, but this is what we have 这是现实，但这就是我们所拥有的
been doing so far. 到目前为止为止。
We have been playing with models of 我们一直在玩
probabilistic phenomena. 概率现象。
And somehow we need to tie the two together. 而且我们需要将两者结合在一起。
The way these are tied is that we observe the real world and 这些联系的方式是我们观察现实世界并
this gives us data. 这给了我们数据。
And then based on these data, we try to come up with a model 然后根据这些数据，我们尝试提出一个模型
of what exactly is going on. 到底发生了什么。
For example, for an arrival process, you might ask the 例如，对于到达过程，您可以询问
model in question, is my arrival process Poisson or is 问题模型，我的到达过程是泊松还是
it something different? 有什么不同吗？
If it is Poisson, what is the rate of the arrival process? 如果是泊松，到达过程的速率是多少？
Once you come up with your model and you come up with the 一旦您提出了自己的模型，就提出了
parameters of the model, then you can use it to make 模型的参数，那么您可以使用它来
predictions about reality or to figure out certain hidden 关于现实的预测或找出某些隐藏的东西
things, certain hidden aspects of reality, that you do not 事物，现实的某些隐藏方面，您不会
observe directly, but you try to infer what they are. 直接观察，但是您尝试推断它们是什么。
So that's where the usefulness of the model comes in. 这就是模型有用性的体现。
Now this field is of course tremendously useful. 现在，这个领域当然非常有用。
And it shows up pretty much everywhere. 它几乎在所有地方都显示出来。
So we talked about the polling examples in the 因此，我们在
last couple of lectures. 最后两节课。
This is, of course, a real application. 当然，这是一个真实的应用程序。
You sample and on the basis of the sample that you have, you 您进行抽样，并根据所拥有的抽样，
try to make some inferences about, let's say, the 尝试做出一些推断，例如
preferences in a given population. 给定人群的偏好。
Let's say in the medical field, you want to try whether 假设在医学领域，您想尝试
a certain drug makes a difference or not. 某种药物是否起作用。
So people would do medical trials, get some results, and 因此人们会进行医学试验，获得一些结果，然后
then from the data somehow you need to make sense of them and 然后从数据中以某种方式需要理解它们，
make a decision. 做决定。
Is the new drug useful or is it not? 新药有用吗？
How do we go systematically about the 我们如何系统地处理
question of this type? 这个问题吗？
A sexier, more recent topic, there's this famous Netflix 一个更性感，更新的话题，就是这个著名的Netflix
competition where Netflix gives you a huge table of Netflix为您提供了巨大的竞争优势
movies and people. 电影和人。
And people have rated the movies, but not everyone has 人们对电影进行了评分，但并不是每个人都对电影评分
watched all of the movies in there. 看了那里的所有电影。
You have some of the ratings. 您有一些评级。
For example, this person gave a 4 to that particular movie. 例如，这个人给那部特定的电影4分。
So you get the table that's partially filled. 这样就得到了部分填充的表。
And the Netflix asks you to make Netflix要求您制作
recommendations to people. 给人们的建议。
So this means trying to guess. 因此，这意味着尝试猜测。
This person here, how much would they like this 这个人在这里，他们想要多少
particular movie? 特别的电影？
And you can start thinking, well, maybe this person has 你可以开始思考，也许这个人有
given somewhat similar ratings with another person. 与其他人的评分相似。
And if that other person has also seen that movie, maybe 如果那个人也看过那部电影，也许
the rating of that other person is relevant. 那个人的等级是相关的。
But of course it's a lot more complicated than that. 但是，当然要复杂得多。
And this has been a serious competition where people have 这是一场激烈的竞争
been using every heavy, wet machinery that there is in 正在使用其中的每台重型湿机器
statistics, trying to come up with good 统计，试图拿出好
recommendation systems. 推荐系统。
Then the other people, of course, are trying to analyze 然后其他人当然在尝试分析
financial data. 财务数据。
Somebody gives you the sequence of the values, let's 有人给你值的顺序，让我们
say of the SMP index. 说到SMP索引。
You look at something like this 你看这样的东西
and you can ask questions. 您可以提出问题。
How do I model these data using any of the models that 如何使用以下任何模型对这些数据建模
we have in our bag of tools? 我们的工具包里有什么？
How can I make predictions about what's going to happen 我该如何预测会发生什么
afterwards, and so on? 之后，等等？
On the engineering side, anywhere where you have noise 在工程方面，任何有噪音的地方
inference comes in. 推论进来。
Signal processing, in some sense, is just 从某种意义上讲，信号处理只是
an inference problem. 推理问题。
You observe signals that are noisy and you try to figure 您观察到嘈杂的信号，然后尝试计算
out exactly what's happening out there or what kind of 到底发生了什么事或发生了什么
signal has been sent. 信号已发送。
Maybe the beginning of the field could be traced a few 也许可以追溯到这个领域的开始
hundred years ago where people would observe, make 一百年前人们会观察
astronomical observations of the position of the 天文观测的位置
planets in the sky. 在天空中的行星。
They would have some beliefs that perhaps the orbits of 他们会相信，也许
planets is an ellipse. 行星是椭圆形的。
Or if it's a comet, maybe it's a parabola, hyperbola, don't 或者如果是彗星，也许是抛物线，双曲线，不要
know what it is. 知道是什么。
But they would have a model of that. 但是他们会有一个模型。
But, of course, astronomical measurements would not be 但是，当然，天文测量不会
perfectly exact. 完全正确。
And they would try to find the curve that fits these data. 他们将尝试找到适合这些数据的曲线。
How do you go about choosing this particular curve on the 您如何选择该特定曲线
base of noisy data and try to do it in a 嘈杂的数据基础，并尝试在
somewhat principled way? 有些原则性的方式？
OK, so questions of this type-- clearly the 好吧，所以这类问题很明显
applications are all over the place. 应用程序无处不在。
But how is this related conceptually with what we have 但这在概念上与我们所拥有的有什么关系
been doing so far? 到目前为止做得如何？
What's the relation between the field of inference and the 推理领域和推理领域之间有什么关系
field of probability as we have been 一直以来的概率领域
practicing until now? 练习到现在？
Well, mathematically speaking, what's going to happen in the 从数学上来说，
next few lectures could be just exercises or homework 接下来的几节课可能只是练习或作业
problems in the class in based on what we have done so far. 班级中存在的问题基于我们到目前为止所做的事情。
That means you're not going to get any new facts about 这意味着您不会获得任何有关的新事实
probability theory. 概率论。
Everything we're going to do will be simple applications of 我们要做的所有事情都是
things that you already do know. 您已经知道的事情。
So in some sense, statistics and inference is just an 所以从某种意义上说，统计和推论只是一个
applied exercise in probability. 应用运动的可能性。
But actually, things are not that simple in 但是实际上，事情并不是那么简单
the following sense. 以下的意义。
If you get a probability problem, 如果您遇到概率问题，
there's a correct answer. 有正确的答案。
There's a correct solution. 有一个正确的解决方案。
And that correct solution is unique. 正确的解决方案是独一无二的。
There's no ambiguity. 没有歧义。
The theory of probability has clearly defined rules. 概率理论有明确定义的规则。
These are the axioms. 这些是公理。
You're given some information about probability 您将获得有关概率的一些信息
distributions. 分布。
You're asked to calculate certain other things. 要求您计算某些其他内容。
There's no ambiguity. 没有歧义。
Answers are always unique. 答案总是唯一的。
In statistical questions, it's no longer the case that the 在统计问题中，不再是
question has a unique answer. 问题有一个独特的答案。
If I give you data and I ask you what's the best way of 如果我给你数据，我问你什么是最好的方法
estimating the motion of that planet, reasonable people can 估计那颗行星的运动，合理的人可以
come up with different methods. 拿出不同的方法。
And reasonable people will try to argue that's my method has 有理智的人会尝试说这是我的方法
these desirable properties but somebody else may say, here's 这些理想的特性，但其他人可能会说，这是
another method that has certain desirable properties. 具有某些理想属性的另一种方法。
And it's not clear what the best method is. 最好的方法是什么还不清楚。
So it's good to have some understanding of what the 因此，最好了解一下
issues are and to know at least what is the general 问题是，至少知道什么是一般
class of methods that one tries to consider, how does 人们试图考虑的一类方法，如何
one go about such problems. 一去解决这样的问题。
So we're going to see lots and lots of 所以我们将看到很多
different inference methods. 不同的推理方法。
We're not going to tell you that one is 我们不会告诉你一个是
better than the other. 比其他更好。
But it's important to understand what are the 但是了解什么是重要的
concepts between those different methods. 这些不同方法之间的概念。
And finally, statistics can be misused really badly. 最后，统计数据可能会被严重滥用。
That is, one can come up with methods that you think are 也就是说，您可以提出您认为是的方法
sound, but in fact they're not quite that. 听起来不错，但实际上并非如此。
I will bring some examples next time and talk a little 下次我会带一些例子，并谈一些
more about this. 有关此的更多信息。
So, they want to say, you have some data, you want to make 因此，他们想说，您有一些数据，您想要
some inference from them, what many people will do is to go 从他们那里推断，很多人会做的是去
to Wikipedia, find a statistical test that they 到维基百科，找到一个统计测试
think it applies to that situation, plug in numbers, 认为适用于这种情况，插入数字，
and present results. 并展示结果。
Are the conclusions that they get really justified or are 是他们得出的结论是正确的，还是
they misusing statistical methods? 他们滥用统计方法？
Well, too many people actually do misuse statistics and 好吧，实际上有太多人滥用统计数据，
conclusions that people get are often false. 人们得出的结论通常是错误的。
So it's important to, besides just being able to copy 因此，重要的是，除了能够复制
statistical tests and use them, to understand what are 统计测试并使用它们，以了解什么是
the assumptions between the different methods and what 不同方法之间的假设以及什么
kind of guarantees they have, if any. 他们有某种担保（如果有）。
All right, so we'll try to do a quick tour through the field 好吧，我们将尝试在野外快速浏览
of inference in this lecture and the next few lectures that 本讲和接下来的几讲中的推论
we have left this semester and try to highlight at the very 我们已经离开了这个学期，并试图在
high level the main concept skills, and 高水平的主要概念技能，以及
techniques that come in. 出现的技术。
Let's start with some generalities and some general 让我们从一些一般性开始
statements. 陈述。
One first statement is that statistics or inference 第一个陈述是统计或推断
problems come up in very different guises. 问题以完全不同的形式出现。
And they may look as if they are of very different forms. 而且它们看起来好像是非常不同的形式。
Although, at some fundamental level, the basic issues turn 尽管在某些基本层面上，基本问题转向
out to be always pretty much the same. 总是几乎一样。
So let's look at this example. 因此，让我们来看这个例子。
There's an unknown signal that's being sent. 正在发送未知信号。
It's sent through some medium, and that medium just takes the 它是通过某种媒介发送的，而该媒介只需要
signal and amplifies it by a certain number. 信号并放大一定数量。
So you can think of somebody shouting. 这样您就可以想到有人大喊大叫。
There's the air out there. 那里有空气。
What you shouted will be attenuated through the air 你大喊大叫的声音会被空中衰减
until it gets to a receiver. 直到到达接收者为止。
And that receiver then observes this, but together 然后那个接收者观察到这一点，但是在一起
with some random noise. 带有一些随机噪音。
Here I meant S. S is the signal that's being sent. 在这里，我的意思是S。S是正在发送的信号。
And what you observe is an X. 您观察到的是X。
You observe X, so what kind of inference problems 您观察到X，那么什么样的推理问题
could we have here? 我们可以在这里吗？
In some cases, you want to build a model of the physical 在某些情况下，您想构建一个物理模型
phenomenon that you're dealing with. 您正在处理的现象。
So for example, you don't know the attenuation of your signal 例如，您不知道信号的衰减
and you try to find out what this number is based on the 然后您尝试找出这个数字是基于
observations that you have. 您的观察结果。
So the way this is done in engineering systems is that 因此，在工程系统中完成此操作的方式是
you design a certain signal, you know what it is, you shout 你设计一个特定的信号，你知道它是什么，你大喊
a particular word, and then the receiver listens. 特定的单词，然后接收者听。
And based on the intensity of the signal that they get, they 根据他们得到的信号强度，
try to make a guess about A. So you don't know A, but you 尝试猜测A。所以您不认识A，但是您
know S. And by observing X, you get some information 知道S。通过观察X，您可以获得一些信息
about what A is. 关于什么是A。
So in this case, you're trying to build a model of the medium 因此，在这种情况下，您正在尝试建立媒介模型
through which your signal is propagating. 通过它传播信号。
So sometimes one would call problems of this kind, let's 所以有时候有人会称这类问题，让我们
say, system identification. 例如，系统识别。
In a different version of an inference problem that comes 在另一个版本的推理问题中
with this picture, you've done your modeling. 有了这张图片，您就完成了建模。
You know your A. You know the medium through which the 你知道你的A。你知道媒介
signal is going, but it's a communication system. 信号正在发出，但这是一个通信系统。
This person is trying to communicate 此人正在尝试交流
something to that person. 给那个人的东西。
So you send the signal S, but that person receives a noisy 因此，您发送信号S，但是那个人收到了噪音
version of S. So that person tries to reconstruct S based S的版本。因此，该人尝试重建基于S的
on X. 在X上。
So in both cases, we have a linear relation between X and 因此，在两种情况下，X和
the unknown quantity. 未知数量。
In one version, A is the unknown and we know S. In the 在一个版本中，A是未知数，我们知道S。
other version, A is known, and so we try to infer S. 在其他版本中，A是已知的，因此我们尝试推断S。
Mathematically, you can see that this is essentially the 在数学上，您可以看到这实际上是
same kind of problem in both cases. 在两种情况下都是相同的问题。
Although, the kind of practical problem that you're 虽然，这是您遇到的实际问题
trying to solve is a little different. 试图解决是有点不同。
So we will not be making any distinctions between problems 因此，我们不会在问题之间进行任何区分
of the model building type as opposed to models where you 与您在其中建立的模型相对应的模型构建类型
try to estimate some unknown signal and so on. 尝试估计一些未知信号，依此类推。
Because conceptually, the tools that one uses for both 因为从概念上讲，一个用于两者的工具
types of problems are essentially the same. 问题类型基本相同。
OK, next a very useful classification 好，接下来一个非常有用的分类
of inference problems-- 推理问题
the unknown quantity that you're trying to estimate 您要估算的未知数量
could be either a discrete one that takes a 可能是一个离散的
small number of values. 少量值。
So this could be discrete problems, such as the airplane 所以这可能是离散的问题，例如飞机
radar problem we encountered back a long 我们很久以前遇到的雷达问题
time ago in this class. 前段时间在这堂课上。
So there's two possibilities-- 所以有两种可能性
an airplane is out there or an airplane is not out there. 飞机不在那儿或飞机不在那儿。
And you're trying to make a decision 而您正在尝试做出决定
between these two options. 在这两个选项之间。
Or you can have other problems would you have, let's say, 或者说，您可能还有其他问题，
four possible options. 四个可能的选择。
You don't know which one is true, but you get data and you 您不知道哪一个是正确的，但是您得到了数据并且您
try to figure out which one is true. 尝试找出哪一个是正确的。
In problems of these kind, usually you want to make a 在这类问题中，通常您希望
decision based on your data. 根据您的数据做出决定。
And you're interested in the probability of making a 您对制作一个
correct decision. 正确的决定。
You would like that probability to 您希望这种可能性
be as high as possible. 尽可能高。
Estimation problems are a little different. 估计问题有些不同。
Here you have some continuous quantity that's not known. 在这里，您有一些未知的连续量。
And you try to make a good guess of that quantity. 然后您尝试对该数量做出很好的猜测。
And you would like your guess to be as close as possible to 而且您希望您的猜测尽可能地接近
the true quantity. 真实数量。
So the polling problem was of this type. 因此，轮询问题属于此类。
There was an unknown fraction f of the population that had 人口中有f的未知分数
some property. 一些财产。
And you try to estimate f as accurately as you can. 然后您尝试尽可能准确地估计f。
So the distinction here is that usually here the unknown 所以这里的区别是通常这里未知
quantity takes on discrete set of values. 数量具有一组离散值。
Here the unknown quantity takes a 在这里，未知数量需要
continuous set of values. 连续的一组值。
Here we're interested in the probability of error. 在这里，我们对错误的可能性感兴趣。
Here we're interested in the size of the error. 在这里，我们对错误的大小感兴趣。
Broadly speaking, most inference problems fall either 广义上讲，大多数推理问题都属于
in this category or in that category. 在这个类别或那个类别中。
Although, if you want to complicate life, you can also 虽然，如果您想使生活复杂化，也可以
think or construct problems where both of these aspects 考虑或构造这两个方面的问题
are simultaneously present. 同时存在。
OK, finally since we're in classification mode, there is 好的，最后因为我们处于分类模式，所以有
a very big, important dichotomy into how one goes 关于如何进行的非常重要的二分法
about inference problems. 关于推理问题。
And here there's two fundamentally different 这里有两个根本不同的地方
philosophical points of view, which is how do we model the 哲学的观点，这就是我们如何建模
quantity that is unknown? 数量未知？
In one approach, you say there's a certain quantity 在一种方法中，您说有一定数量
that has a definite value. 具有确定的价值。
It just happens that they don't know it. 只是他们不知道而已。
But it's a number. 但这是一个数字。
There's nothing random about it. 没有什么随机的。
So think of trying to estimate some physical quantity. 因此，请考虑尝试估算一些物理量。
You're making measurements, you try to estimate the mass 您在进行测量，您尝试估算质量
of an electron, which is a sort of 电子，这是一种
universal physical constant. 通用物理常数。
There's nothing random about it. 没有什么随机的。
It's a fixed number. 这是一个固定的数字。
You get data, because you have some measuring apparatus. 您会得到数据，因为您有一些测量仪器。
And that measuring apparatus, depending on what that results 那种测量仪器，取决于结果
that you get are affected by the true mass of the electron, 你受到电子真实质量的影响，
but there's also some noise. 但也有一些噪音
You take the data out of your measuring apparatus and you 您将数据从测量仪器中取出，然后
try to come up with some estimate of 尝试提出一些估计
that quantity theta. 那个数量theta。
So this is definitely a legitimate picture, but the 因此，这绝对是合理的情况，但是
important thing in this picture is that this theta is 这张图片中重要的是这个theta是
written as lowercase. 写为小写。
And that's to make the point that it's a real number, not a 这就是说它是一个实数，而不是一个
random variable. 随机变量。
There's a different philosophical approach which 有一种不同的哲学方法
says, well, anything that I don't know I should model it 说，嗯，我不知道的任何事情我都应该建模
as a random variable. 作为随机变量。
Yes, I know. 是的我知道。
The mass of the electron is not really random. 电子的质量并不是真正随机的。
It's a constant. 这是一个常数。
But I don't know what it is. 但是我不知道那是什么。
I have some vague sense, perhaps, what it is perhaps 我有些含糊的感觉，也许是什么
because of the experiments that some other 因为其他一些实验
people carried out. 人们进行了。
So perhaps I have a prior distribution on the possible 所以也许我事先对
values of Theta. 值。
And that prior distribution doesn't mean that the nature 而且这种先验分布并不意味着自然
is random, but it's more of a subjective description of my 是随机的，但更多是对我的主观描述
subjective beliefs of where do I think this constant number 我认为这个常数在哪里的主观信念
happens to be. 碰巧是。
So even though it's not truly random, I model my initial 因此，即使它不是真正随机的，我也可以为初始模型建模
beliefs before the experiment starts. 实验开始之前的信念。
In terms of a prior distribution, I view it as a 就先前的分配而言，我将其视为
random variable. 随机变量。
Then I observe another related random variable through some 然后我通过一些观察另一个相关的随机变量
measuring apparatus. 测量仪器。
And then I use this again to create an estimate. 然后我再次使用它来创建一个估计。
So these two pictures philosophically are very 所以这两张图片在哲学上非常
different from each other. 彼此不同。
Here we treat the unknown quantities as unknown numbers. 在这里，我们将未知数量视为未知数。
Here we treat them as random variables. 在这里，我们将它们视为随机变量。
When we treat them as a random variables, then we know pretty 当我们将它们视为随机变量时，我们知道
much already what we should be doing. 我们应该做的已经很多了。
We should just use the Bayes rule. 我们应该只使用贝叶斯规则。
Based on X, find the conditional 基于X，找到条件
distribution of Theta. Theta的分布。
And that's what we will be doing mostly over this lecture 这就是我们在本讲座中主要要做的
and the next lecture. 还有下一堂课
Now in both cases, what you end up getting at the end is 现在，在两种情况下，最终得到的都是
an estimate. 一个估计。
But actually, that estimate is what kind of object is it? 但是实际上，该估计是什么样的对象？
It's a random variable in both cases. 在两种情况下都是随机变量。
Why? 为什么？
Even in this case where theta was a 即使在这种情况下theta是
constant, my data are random. 常数，我的数据是随机的。
I do my data processing. 我进行数据处理。
So I calculate a function of the data, the 所以我计算数据的函数
data are random variables. 数据是随机变量。
So out here we output something which is a function 所以在这里我们输出的是一个函数
of a random variable. 随机变量。
So this quantity here will be also random. 因此，此数量也将是随机的。
It's affected by the noise and the experiment that I have 我受到噪音和实验的影响
been doing. 在做。
That's why these estimators will be denoted 这就是为什么将这些估计量表示为
by uppercase Thetas. 通过大写的Thetas。
And we will be using hats. 我们将使用帽子。
Hat, usually in estimation, means 帽子通常是指
an estimate of something. 对某事的估计。
All right, so this is the big picture. 好吧，这就是全局。
We're going to start with the Bayesian version. 我们将从贝叶斯版本开始。
And then the last few lectures we're going to talk about the 接下来的几节课中，我们将讨论
non-Bayesian version or the classical one. 非贝叶斯版本或经典版本。
By the way, I should say that statisticians have been 顺便说一句，我应该说统计学家
debating fiercely for 100 years whether the right way to 激烈辩论100年是否正确的方法
approach statistics is to go the classical way or the 统计方法是采用经典方法还是
Bayesian way. 贝叶斯方式。
And there have been tides going back and forth between 而且之间有来回潮
the two sides. 双方。
These days, Bayesian methods tend to become a little more 如今，贝叶斯方法趋于变得更多一些
popular for various reasons. 由于各种原因而受欢迎。
We're going to come back to this later. 我们待会儿再回到这个。
All right, so in Bayesian estimation, what we got in our 好吧，以贝叶斯估计，我们得到的是
hands is Bayes rule. 手中是贝叶斯法则。
And if you have Bayes rule, there's not a lot 如果您有贝叶斯法则，就没有很多
that's left to do. 剩下要做的。
We have different forms of the Bayes rule, depending on 我们有不同形式的贝叶斯规则，具体取决于
whether we're dealing with discrete data, And discrete 我们是否正在处理离散数据，以及离散
quantities to estimate, or continuous data, and so on. 估算的数量，或连续的数据，依此类推。
In the hypothesis testing problem, the unknown quantity 假设检验问题中，未知数量
Theta is discrete. Theta是离散的。
So in both cases here, we have a P of Theta. 因此，在这两种情况下，我们都有Theta的P。
We obtain data, the X's. 我们获得X的数据。
And on the basis of the X that we observe, we can calculate 根据观察到的X，我们可以计算
the posterior distribution of Theta, given the data. 给定数据，Theta的后验分布。
So to use Bayesian inference, what do we start with? 因此，要使用贝叶斯推理，我们应该从什么开始呢？
We start with some priors. 我们从一些先验开始。
These are our initial beliefs about what 这些是我们最初对什么的信念
Theta that might be. 可能是Theta。
That's before we do the experiment. 那是在我们做实验之前。
We have a model of the experimental aparatus. 我们有一个实验性aparatus模型。
And the model of the experimental apparatus tells 而实验仪器的型号告诉
us if this Theta is true, I'm going to see X's of that kind. 如果这个Theta是正确的，我们将看到这种X。
If that other Theta is true, I'm going to see X's that they 如果另一个Theta是正确的，我将看到X是
are somewhere else. 在其他地方。
That models my apparatus. 那为我的设备建模。
And based on that knowledge, once I observe I have these 基于这些知识，一旦我观察到
two functions in my hands, we have already seen that if you 我手中有两个功能，我们已经看到，如果您
know those two functions, you can also calculate the 知道这两个函数，您还可以计算
denominator here. 分母在这里。
So all of these functions are available, so you can compute, 所有这些功能都可用，因此您可以计算，
you can find a formula for this function as well. 您也可以找到该函数的公式。
And as soon as you observe the data, that X's, you plug in 一旦观察到数据X即插入
here the numerical value of those X's. 这里是那些X的数值。
And you get a function of Theta. 您将获得Theta的功能。
And this is the posterior distribution of Theta, given 这就是Theta的后验分布
the data that you have seen. 您所看到的数据。
So you've already done a fair number of 所以您已经做了很多
exercises of these kind. 这类练习。
So we not say more about this. 因此，我们不对此多说。
And there's a similar formula as you know for the case where 对于这种情况，有一个类似的公式
we have continuous data. 我们有连续的数据。
If the X's are continuous random variable, then the 如果X是连续随机变量，则
formula is the same, except that X's are described by 公式是相同的，除了X由
densities instead of being described by a probability 密度而不是用概率来描述
mass functions. 质量函数。
OK, now if Theta is continuous, then we're dealing 好吧，现在如果Theta是连续的，那么我们正在处理
with estimation problems. 估计问题。
But the story is once more the same. 但是故事又是一样的。
You're going to use the Bayes rule to come up with the 您将使用贝叶斯规则得出
posterior density of Theta, given the data 给定数据，Theta的后密度
that you have observed. 您观察到的。
Now just for the sake of the example, let's come back to 现在仅出于示例的目的，让我们回到
this picture here. 这张照片在这里。
Suppose that something is flying in the air, and maybe 假设某物在空中飞舞，也许
this is just an object in the air close to the Earth. 这只是靠近地球的空中物体。
So because of gravity, the trajectory that it's going to 因此，由于重力，它的轨迹
follow it's going to be a parabola. 随之而来的将是抛物线。
So this is the general equation of a parabola. 这就是抛物线的一般方程。
Zt is the position of my objects at time t. Zt是我的对象在时间t的位置。
But I don't know exactly which parabola it is. 但是我不知道到底是什么抛物线。
So the parameters of the parabola are unknown 因此抛物线的参数未知
quantities. 数量。
What I can do is to go and measure the position of my 我能做的就是去测量我的位置
objects at different times. 对象在不同的​​时间。
But unfortunately, my measurements are noisy. 但不幸的是，我的测量结果很嘈杂。
What I want to do is to model the motion of my object. 我想要做的是对对象的运动进行建模。
So I guess in the picture, the axis would be t going this way 所以我想在图片中，轴将不会这样
and Z going this way. Z就是这样
And on the basis of the data that they get, 根据他们获得的数据，
these are my X's. 这些是我的X。
I want to figure out the Thetas. 我想找出Thetas。
That is, I want to figure out the exact 也就是说，我想找出确切的
equation of this parabola. 这个抛物线的方程。
Now if somebody gives you probability distributions for 现在如果有人给你概率分布
Theta, these would be your priors. Theta，这些将是您的先决条件。
So this is given. 因此，给出。
We need the conditional distribution of the X's given 我们需要给定X的条件分布
the Thetas. Thetas。
Well, we have the conditional distribution of Z, given the 好吧，给定
Thetas from this equation. 这个方程式的θ。
And then by playing with this equation, you can also find 然后通过玩这个方程，您还可以找到
how is X distributed if Theta takes a particular value. 如果Theta取特定值，X的分布情况。
So you do have all of the densities that you might need. 因此，您确实拥有了可能需要的所有密度。
And you can apply the Bayes rule. 您可以应用贝叶斯规则。
And at the end, your end result would be a formula for 最后，您的最终结果将是
the distribution of Theta, given to the X 给X的Theta分布
that you have observed-- 您观察到的-
except for one sort of computation, or to make things 除了一种计算或制造事物
more interesting. 更有趣的。
Instead of these X's and Theta's being single random 而不是这些X和Theta是单随机的
variables that we have here, typically those X's and 我们在这里拥有的变量，通常是那些X和
Theta's will be multi-dimensional random Theta将是多维随机的
variables or will correspond to multiple ones. 变量或将对应多个变量。
So this little Theta here actually stands for a triplet 所以这个小小的Theta实际上代表着三胞胎
of Theta0, Theta1, and Theta2. Theta0，Theta1和Theta2。
And that X here stands here for the entire sequence of X's X在这里代表X的整个序列
that we have observed. 我们观察到的。
So in reality, the object that you're going to get at to the 因此，实际上，您要到达的对象
end after inference is done is a function that you plug in 推断完成后插入的功能
the values of the data and you get the function of the 数据的值，您将获得
Theta's that tells you the relative likelihoods of Theta告诉您
different Theta triplets. 不同的Theta三胞胎。
So what I'm saying is that this is no harder than the 所以我的意思是，这并不比
problems that you have dealt with so far, except perhaps 到目前为止，您已经解决的问题，也许
for the complication that's usually in interesting 通常很有趣的并发症
inference problems. 推断问题。
Your Theta's and X's are often the vectors of random 您的Theta和X通常是随机向量
variables instead of individual random variables. 变量而不是单个随机变量。
Now if you are to do estimation in a case where you 现在，如果您要进行估算，
have discrete data, again the situation is no different. 拥有离散的数据，情况也一样。
We still have a Bayes rule of the same kind, except that 我们仍然有相同类型的贝叶斯规则，除了
densities gets replaced by PMF's. 密度被PMF所代替。
If X is discrete, you put a P here instead of putting an f. 如果X是离散的，则在此处放置P而不是f。
So an example of an estimation problem with discrete data is 因此，离散数据估计问题的一个示例是
similar to the polling problem. 类似于投票问题。
You have a coin. 你有一枚硬币。
It has an unknown parameter Theta. 它具有未知的参数Theta。
This is the probability of obtaining heads. 这是获得头脑的概率。
You flip the coin many times. 您多次掷硬币。
What can you tell me about the true value of Theta? 您能告诉我Theta的真实价值吗？
A classical statistician, at this point, would say, OK, I'm 此时，一位古典统计学家会说，好的，我是
going to use an estimator, the most reasonable 使用估计量，最合理
one, which is this. 一个，就是这个。
How many heads did they obtain in n trials? 他们在n次试验中获得了多少个脑袋？
Divide by the total number of trials. 除以试验总数。
This is my estimate of the bias of my coin. 这是我对我的硬币偏见的估计。
And then the classical statistician would continue 然后古典统计学家会继续
from here and try to prove some properties and argue that 从这里尝试证明一些性质，并争辩说
this estimate is a good one. 这个估计是一个很好的估计。
For example, we have the weak law of large numbers that 例如，我们有大量的弱定律
tells us that this particular estimate converges in 告诉我们，这个特定的估算值收敛于
probability to the true parameter. 真实参数的概率。
This is a kind of guarantee that's useful to have. 这是一种很有用的保证。
And the classical statistician would pretty much close the 古典统计学家几乎会关闭
subject in this way. 这样的主题。
What would the Bayesian person do differently? 贝叶斯人会做些什么？
The Bayesian person would start by assuming a prior 贝叶斯人将首先假设先验
distribution of Theta. Theta的分布。
Instead of treating Theta as an unknown constant, they 他们没有将Theta当作未知常数，而是
would say that Theta would speak randomly or pretend that 会说Theta会随机说话或假装
it would speak randomly and assume a 它会随机说话，并假设
distribution on Theta. 分布在Theta。
So for example, if you don't know they need anything more, 因此，举例来说，如果您不知道他们还需要什么，
you might assume that any value for the bias of the coin 您可能会认为硬币的偏差的任何值
is as likely as any other value of the bias of the coin. 与硬币偏差的任何其他值一样大。
And this way so the probability distribution 这样，概率分布
that's uniform. 那是统一的。
Or if you have a little more faith in the manufacturing 或者，如果您对制造更有信心
processes that's created that coin, you might choose your 创建硬币的过程，您可以选择
prior to be a distribution that's centered around 1/2 and 在以1/2和
sits fairly narrowly centered around 1/2. 位于1/2的中心位置。
That would be a prior distribution in which you say, 那是您说的先验分布，
well, I believe that the manufacturer tried to make my 好吧，我相信制造商试图使
coin to be fair. 硬币是公平的。
But they often makes some mistakes, so it's going to be, 但是他们经常会犯一些错误，所以会这样，
I believe, it's approximately 1/2 but not quite. 我相信大约是1/2，但还不完全是。
So depending on your beliefs, you would choose an 因此，根据您的信念，您可以选择
appropriate prior for the distribution of Theta. 适当先分配Theta。
And then you would use the Bayes rule to find the 然后，您将使用贝叶斯规则来查找
probabilities of different values of Theta, based on the Theta的不同值的概率，基于
data that you have observed. 您观察到的数据。
So no matter which version of the Bayes rule that you use, 因此，无论您使用哪种版本的贝叶斯规则，
the end product of the Bayes rule is going to be either a 贝叶斯规则的最终结果将是
plot of this kind or a plot of that kind. 这种情节或那种情节。
So what am I plotting here? 那我打算在这里做什么？
This axis is the Theta axis. 该轴是Theta轴。
These are the possible values of the unknown quantity that 这些是未知数量的可能值，
we're trying to estimate. 我们正在尝试估算。
In the continuous case, theta is a 在连续情况下，theta是
continuous random variable. 连续随机变量。
I obtain my data. 我获取了我的数据。
And I plot for the posterior probability distribution after 然后画出后验概率分布
observing my data. 观察我的数据。
And I'm plotting here the probability density for Theta. 我在这里绘制Theta的概率密度。
So this is a plot of that density. 因此，这是该密度的图。
In the discrete case, theta can take finitely many values 在离散情况下，theta可以取有限的多个值
or a discrete set of values. 或一组离散值。
And for each one of those values, I'm telling you how 对于这些价值观中的每一个，我都在告诉您
likely is that the value to be the correct one, given the 给定的值很可能是正确的值
data that I have observed. 我观察到的数据。
And in general, what you would go back to your boss and 通常，您会回到老板那里
report after you've done all your inference work would be 完成所有推断工作后，报告
either a plot of this kinds or of that kind. 这种情节或那种情节。
So you go to your boss who asks you, what is 所以你去问你老板是什么
the value of Theta? Theta的价值？
And you say, well, I only have limited data. 你说，嗯，我只有有限的数据。
That I don't know what it is. 我不知道那是什么。
It could be this, with so much probability. 很有可能就是这个。
There's probability. 有可能。
OK, let's throw in some numbers here. 好吧，让我们在这里输入一些数字。
There's probability 0.3 that Theta is this value. Theta就是0.3的可能性。
There's probability 0.2 that Theta is this value, 0.1 that Theta是0.2的概率是0.1
it's this one, 0.1 that it's this one, 0.2 that it's that 这是这个，0.1是这个，0.2是
one, and so on. 一，依此类推。
OK, now bosses often want simple answers. 好吧，现在老板们经常想要简单的答案。
They say, OK, you're talking too much. 他们说，好的，你说的太多了。
What do you think Theta is? 您觉得Theta是什么？
And now you're forced to make a decision. 现在，您不得不做出决定。
If that was the situation and you have to make a decision, 如果是这种情况，您必须做出决定，
how would you make it? 你会怎么做？
Well, I'm going to make a decision that's most likely to 好吧，我将做出最有可能做出的决定
be correct. 是正确的。
If I make this decision, what's going to happen? 如果我做出这个决定，将会发生什么？
Theta is this value with probability 0.2, which means Theta是这个值的概率为0.2，这意味着
there's probably 0.8 that they make an error 大概有0.8的错误
if I make that guess. 如果我做出这样的猜测。
If I make that decision, this decision has probably 0.3 of 如果我做出这个决定，那么这个决定大概有0.3
being the correct one. 是正确的。
So I have probably of error 0.7. 所以我的错误可能是0.7。
So if you want to just maximize the probability of 因此，如果您只想最大化
giving the correct decision, or if you want to minimize the 做出正确的决定，或者如果您想最小化
probability of making an incorrect decision, what 做出错误决定的可能性
you're going to choose to report is that value of Theta 您将选择报告Theta的价值
for which the probability is highest. 概率最高。
So in this case, I would choose to report this 因此，在这种情况下，我将选择报告
particular value, the most likely value of Theta, given 特定值，Theta最可能的值，给定
what I have observed. 我观察到的。
And that value is called them maximum a posteriori 该值称为最大后验值
probability estimate. 概率估计。
It's going to be this one in our case. 在我们的情况下将是这个。
So picking the point in the posterior PMF that has the 因此，在后PMF中选择具有
highest probability. 最高概率。
That's the reasonable thing to do. 那是合理的事情。
This is the optimal thing to do if you want to minimize the 如果要最大程度地减少
probability of an incorrect inference. 错误推断的可能性。
And that's what people do usually if they need to report 这就是人们通常需要举报的情况
a single answer, if they need to report a single decision. 一个答案，如果他们需要报告一个决定。
How about in the estimation context? 在估算范围内怎么样？
If that's what you know about Theta, Theta could be around 如果这是您对Theta的了解，那么Theta可能就在附近
here, but there's also some sharp probability that it is 在这里，但也很有可能是
around here. 这附近。
What's the single answer that you would give to your boss? 您给老板的唯一答案是什么？
One option is to use the same philosophy and say, OK, I'm 一种选择是使用相同的哲学说，好的，我是
going to find the Theta at which this posterior density 要找到后验密度的Theta
is highest. 最高。
So I would pick this point here and report this 所以我在这里选择这一点并报告
particular Theta. 特别是Theta。
So this would be my Theta, again, Theta MAP, the Theta 所以这将是我的Theta，再次是Theta MAP，Theta
that has the highest a posteriori probability, just 后验概率最高的
because it corresponds to the peak of the density. 因为它对应于密度的峰值。
But in this context, the maximum a posteriori 但是在这种情况下，最大后验
probability theta was the one that was most 概率θ是最大的概率
likely to be true. 可能是真的。
In the continuous case, you cannot really say that this is 在连续的情况下，您不能真正说这是
the most likely value of Theta. Theta的最可能值。
In a continuous setting, any value of Theta has zero 在连续设置中，Theta的任何值都为零
probability, so when we talk about densities. 概率，所以当我们谈论密度时。
So it's not the most likely. 因此，可能性最大。
It's the one for which the density, so the probabilities 这是密度的原因，所以概率
of that neighborhoods, are highest. 在那些社区中，是最高的。
So the rationale for picking this particular estimate in 因此，在
the continuous case is much less compelling than the 连续案件的吸引力远不及
rationale that we had in here. 我们在这里的基本原理。
So in this case, reasonable people might choose different 因此，在这种情况下，合理的人可能会选择不同的
quantities to report. 要报告的数量。
And the very popular one would be to report instead the 而非常受欢迎的一种是报告
conditional expectation. 有条件的期望。
So I don't know quite what Theta is. 所以我不太清楚Theta是什么。
Given the data that I have, Theta has this distribution. 给定我拥有的数据，Theta具有此分布。
Let me just report the average over that distribution. 让我只报告该分布的平均值。
Let me report to the center of gravity of this figure. 让我报告这个数字的重心。
And in this figure, the center of gravity would probably be 在此图中，重心可能是
somewhere around here. 在这里的某个地方。
And that would be a different estimate that you 那将是对您的另一种估计
might choose to report. 可能会选择报告。
So center of gravity is something around here. 所以重心在这里。
And this is a conditional expectation of Theta, given 这是Theta的有条件期望
the data that you have. 您拥有的数据。
So these are two, in some sense, fairly reasonable ways 所以从某种意义上讲，这是两种相当合理的方式
of choosing what to report to your boss. 选择要向老板报告的内容。
Some people might choose to report this. 有些人可能会选择举报。
Some people might choose to report that. 有些人可能会选择举报。
And a priori, if there's no compelling reason why one 还有一个先验，如果没有令人信服的理由
would be preferable than other one, unless you set some rules 会比其他规则更可取，除非您设置一些规则
for the game and you describe a little more precisely what 游戏中，您可以更精确地描述什么
your objectives are. 你的目标是。
But no matter which one you report, a single answer, a 但是无论您报告哪个，一个答案，
point estimate, doesn't really tell you the whole story. 点估计并不能真正告诉您整个故事。
There's a lot more information conveyed by this posterior 后验传递的信息更多
distribution plot than any single number 分布图比任何单个数
that you might report. 您可能会报告。
So in general, you may wish to convince your boss that's it's 所以总的来说，您可能希望说服老板，那就是
worth their time to look at the entire plot, because that 值得他们花时间去看整个情节，因为那
plot sort of covers all the possibilities. 情节涵盖了所有可能性。
It tells your boss most likely we're in that range, but 它告诉您的老板我们很可能在这个范围内，但是
there's also a distinct change that our Theta happens to lie 还有一个明显的变化，我们的Theta碰巧
in that range. 在那个范围内。
All right, now let us try to perhaps differentiate between 好吧，现在让我们尝试区分
these two and see under what circumstances this one might 这两个，看看这在什么情况下可能
be the better estimate to perform. 是执行效果更好的估算。
Better with respect to what? 关于什么更好？
We need some rules. 我们需要一些规则。
So we're going to throw in some rules. 因此，我们将提出一些规则。
As a warm up, we're going to deal with the problem of 作为热身，我们将处理以下问题
making an estimation if you had no information at all, 如果您根本没有任何信息，请进行估算，
except for a prior distribution. 除事先分配外。
So this is a warm up for what's coming next, which 所以这是对接下来的事情的热身
would be estimation that takes into account some information. 将是考虑了一些信息的估计。
So we have a Theta. 因此，我们有一个Theta。
And because of your subjective beliefs or models by others, 而且由于您的主观信念或他人的榜样，
you believe that Theta is uniformly distributed between, 您认为Theta是均匀分布的，
let's say, 4 and 10. 假设4和10
You want to come up with a point estimate. 您想提出一个点估计。
Let's try to look for an estimate. 让我们尝试寻找一个估计值。
Call it c, in this case. 在这种情况下，将其称为c。
I want to pick a number with which to estimate 我想选择一个估计的数字
the value of Theta. Theta的值。
I will be interested in the size of the error that I make. 我会对所犯错误的大小感兴趣。
And I really dislike large errors, so I'm going to focus 我真的不喜欢大错误，所以我将重点介绍
on the square of the error that they make. 他们犯的错误的平方。
So I pick c. 所以我选择c。
Theta that has a random value that I don't know. Theta具有我不知道的随机值。
But whatever it is, once it becomes known, it results into 但是无论它是什么，一旦被人们知道，它就会变成
a squared error between what it is and what I 是什么和我之间的平方误差
guessed that it was. 猜想是这样。
And I'm interested in making a small air on the average, 而且我有兴趣平均降低空气流量，
where the average is taken with respect to all the 相对于所有
possible and unknown values of Theta. Theta的可能值和未知值。
So the problem, this is a least squares formulation of 问题是，这是
the problem, where we try to minimize the 问题，我们尝试将
least squares errors. 最小二乘误差。
How do you find the optimal c? 您如何找到最佳的c？
Well, we take that expression and expand it. 好吧，我们采用该表达式并将其扩展。
And it is, using linearity of expectations-- 而且是利用期望的线性度-
square minus 2c expected Theta plus c squared-- 平方减去2c期望Theta加c平方-
that's the quantity that we want to minimize, 那就是我们要减少的数量
with respect to c. 关于c。
To do the minimization, take the derivative with respect to 要进行最小化，请针对
c and set it to 0. c并将其设置为0。
So that differentiation gives us from here minus 2 expected 这样的差异使我们从这里减去预期的2
value of Theta plus 2c is equal to 0. Theta加上2c的值等于0。
And the answer that you get by solving this equation is that 通过解决这个方程式，您得到的答案是
c is the expected value of Theta. c是Theta的期望值。
So when you do this optimization, you find that 因此，当您进行优化时，您会发现
the optimal estimate, the things you should be 最佳估计，您应该做的事情
reporting, is the expected value of Theta. 报告，是Theta的期望值。
So in this particular example, you would choose your estimate 因此，在此示例中，您可以选择估算值
c to be just the middle of these values, c只是这些值的中间，
which would be 7. 就是7
OK, and in case your boss asks you, how 好吧，万一你老板问你
good is your estimate? 你的估计好吗？
How big is your error going to be? 您的错误有多大？
What you could report is the average size of the estimation 您可以报告的是估算的平均大小
error that you are making. 您正在犯的错误。
We picked our estimates to be the expected value of Theta. 我们选择的估算值是Theta的期望值。
So for this particular way that I'm choosing to do my 所以对于这种特殊的方式，我选择做我的
estimation, this is the mean squared error that I get. 估计，这是我得到的均方误差。
And this is a familiar quantity. 这是一个熟悉的数量。
It's just the variance of the distribution. 这只是分布的方差。
So the expectation is that best way to estimate a 因此，期望是估算
quantity, if you're interested in the mean squared error. 数量（如果您对均方误差感兴趣）。
And the resulting mean squared error is the variance itself. 结果均方误差是方差本身。
How will this story change if we now have data as well? 如果我们现在也有数据，那么这个故事将如何改变？
Now having data means that we can compute posterior 现在有了数据意味着我们可以计算后验
distributions or conditional distributions. 分布或条件分布。
So we get transported into a new universe where instead the 所以我们被带入了一个新的宇宙
working with the original distribution of Theta, the 使用Theta的原始发行版，
prior distribution, now we work with the condition of 事先分配，现在我们在以下条件下工作
distribution of Theta, given the data 给定数据，Theta的分布
that we have observed. 我们观察到的。
Now remember our old slogan that conditional models and 现在，请记住我们以前的口号：条件模型和
conditional probabilities are no different than ordinary 条件概率与普通无异
probabilities, except that we live now in a new universe 概率，除了我们现在生活在新的宇宙中
where the new information has been taken into account. 考虑到新信息的地方。
So if you use that philosophy and you're asked to minimize 因此，如果您使用这种哲学，并且要求您最小化
the squared error but now that you live in a new universe 平方误差，但现在您生活在新的宇宙中
where X has been fixed to something, what would the 如果X被固定为某物，那
optimal solution be? 最佳解决方案是？
It would again be the expectation of theta, but 再次是theta的期望，但是
which expectation? 哪个期望？
It's the expectation which applies in the new conditional 这是适用于新条件的期望
universe in which we live right now. 我们现在生活的宇宙。
So because of what we did before, by the same 因此，由于我们之前所做的，
calculation, we would find that the optimal estimates is 计算，我们会发现最优估计是
the expected value of X of Theta, but the optimal Theta X的期望值，但最优
estimate that takes into account the 估计考虑到
information that we have. 我们拥有的信息。
So the conclusion, once you get your data, if you want to 因此，得出的结论是，一旦获得数据，
minimize the mean squared error, you should just report 最小化均方误差，您应该报告
the conditional estimation of this unknown quantity based on 基于该未知量的条件估计
the data that you have. 您拥有的数据。
So the picture here is that Theta is unknown. 因此，这里的图片是Theta未知。
You have your apparatus that creates measurements. 您拥有可以创建测量值的仪器。
So this creates an X. You take an X, and here you have a box 这样就创建了一个X。取一个X，然后在这里有一个盒子
that does calculations. 进行计算。
It does calculations and it spits out the conditional 它进行计算，并吐出条件
expectation of Theta, given the particular data that you 鉴于您的特定数据，对Theta的期望
have observed. 已经观察到。
And what we have done in this class so far is, to some 到目前为止，我们在这堂课上所做的是
extent, developing the computational tools and skills 程度，发展计算工具和技能
to do with this particular calculation-- 与这个特定的计算有关-
how to calculate the posterior density for Theta and how to 如何计算Theta的后验密度以及如何
calculate expectations, conditional expectations. 计算期望，有条件的期望。
So in principle, we know how to do this. 因此，原则上，我们知道如何执行此操作。
In principle, we can program a computer to take the data and 原则上，我们可以对计算机进行编程以获取数据并
to spit out condition expectations. 吐出条件期望。
Somebody who doesn't think like us might instead design a 不喜欢我们的人可能会设计一个
calculating machine that does something differently and 计算机的功能有所不同，
produces some other estimate. 得出其他一些估计。
So we went through this argument and we decided to 所以我们经历了这个争论，我们决定
program our computer to calculate conditional 对我们的计算机进行编程以计算条件
expectations. 期望。
Somebody else came up with some other crazy idea for how 有人想到了其他疯狂的想法
to estimate the random variable. 估计随机变量。
They came up with some function g and the programmed 他们提出了一些功能g和
it, and they designed a machine that estimates Theta's 然后，他们设计了一种估算Theta的机器
by outputting a certain g of X. 通过输出一定的X。
That could be an alternative estimator. 那可能是一个替代估计量。
Which one is better? 哪一个更好？
Well, we convinced ourselves that this is the optimal one 好吧，我们说服自己，这是最佳选择
in a universe where we have fixed the particular 在一个已经确定了特定条件的宇宙中
value of the data. 数据值。
So what we have proved so far is a relation of this kind. 因此，到目前为止，我们已经证明的是这种关系。
In this conditional universe, the mean squared 在这个条件宇宙中，均方
error that I get-- 我得到的错误-
I'm the one who's using this estimator-- 我就是使用此估算器的人-
is less than or equal than the mean squared error that this 小于或等于此的均方误差
person will get, the person who uses that estimator. 人会得到，使用该估计量的人。
For any particular value of the data, I'm going to do 对于数据的任何特定值，我将要做
better than the other person. 比其他人更好
Now the data themselves are random. 现在数据本身是随机的。
If I average over all possible values of the data, I should 如果我对数据的所有可能值取平均值，则应该
still be better off. 仍然更好。
If I'm better off for any possible value X, then I 如果我最好选择任何可能的值X，那么我
should be better off on the average over all possible 在所有可能的情况下，平均应该更好
values of X. X的值。
So let us average both sides of this quantity with respect 因此，让我们尊重这一数量的双方
to the probability distribution of X. If you want X的概率分布
to do it formally, you can write this inequality between 要正式做到这一点，您可以在
numbers as an inequality between random variables. 数字作为随机变量之间的不等式。
And it tells that no matter what that random variable 它告诉我们无论那个随机变量
turns out to be, this quantity is better than that quantity. 事实证明，这个数量比那个数量要好。
Take expectations of both sides, and you get this 取得双方的期望，您就会明白
inequality between expectations overall. 总体期望之间的不平等。
And this last inequality tells me that the person who's using 最后的不平等告诉我，正在使用的人
this estimator who produces estimates according to this 这个据此产生估算值的估算器
machine will have a mean squared estimation error 机器将具有均方估计误差
that's less than or equal to the estimation error that's 小于或等于估计误差
produced by the other person. 由其他人制作。
In a few words, the conditional expectation 简而言之，有条件的期望
estimator is the optimal estimator. 估计量是最优估计量。
It's the ultimate estimating machine. 这是终极的估算机。
That's how you should solve estimation problems and report 那就是您应该解决估计问题并报告的方式
a single value. 一个值。
If you're forced to report a single value and if you're 如果您被迫报告单个值并且
interested in estimation errors. 对估计误差感兴趣。
OK, while we could have told you that story, of course, a 好的，虽然我们本可以告诉您这个故事，
month or two ago, this is really about interpretation -- 一两个月前，这真的与解释有关-
about realizing that conditional expectations have 关于意识到有条件的期望
a very nice property. 一个非常好的属性。
But other than that, any probabilistic skills that come 但是除此之外，所有的概率技能
into this business are just the probabilistic skills of 从事这项业务只是他们的概率技能
being able to calculate conditional expectations, 能够计算条件期望值，
which you already know how to do. 您已经知道该怎么做。
So conclusion, all of optimal Bayesian estimation just means 因此，结论是，所有最佳贝叶斯估计都意味着
calculating and reporting conditional expectations. 计算和报告条件期望。
Well, if the world were that simple, then statisticians 好吧，如果世界是如此的简单，那么统计学家
wouldn't be able to find jobs if life is that simple. 如果生活这么简单，就找不到工作。
So real life is not that simple. 所以现实生活并不那么简单。
There are complications. 有并发症。
And that perhaps makes their life a little more 那也许会使他们的生活多一点
interesting. 有趣。
OK, one complication is that we would deal with the vectors 好吧，一个复杂的问题是我们要处理向量
instead of just single random variables. 而不只是单个随机变量。
I use the notation here as if X was a 我在这里使用表示法，好像X是一个
single random variable. 单个随机变量。
In real life, you get several data. 在现实生活中，您将获得多个数据。
Does our story change? 我们的故事改变了吗？
Not really, same argument-- 并非完全相同，
given all the data that you have observed, you should 给定您观察到的所有数据，您应该
still report the conditional expectation of Theta. 仍然报告Theta的条件期望。
But what kind of work does it take in order to report this 但是要报告这个问题需要做些什么工作
conditional expectation? 有条件的期望？
One issue is that you need to cook up a plausible prior 一个问题是，您需要先做一个合理的事
distribution for Theta. 分布。
How do you do that? 你是怎样做的？
In a given application , this is a bit of a judgment call, 在给定的应用程序中，这有点判断力，
what prior would you be working with. 您之前会使用什么。
And there's a certain skill there of not 而且那里有一定的技能
making silly choices. 做出愚蠢的选择。
A more pragmatic, practical issue is that this is a 一个更实际，更实际的问题是
formula that's extremely nice and compact and simple that 非常好，紧凑，简单的公式
you can write with minimal ink. 您可以用最少的墨水书写。
But the behind it there could be hidden a huge amount of 但是后面可能隐藏着大量的
calculation. 计算。
So doing any sort of calculations that involve 因此，进行涉及
multiple random variables really involves calculating 多个随机变量确实涉及计算
multi-dimensional integrals. 多维积分。
And the multi-dimensional integrals are hard to compute. 而且多维积分很难计算。
So implementing actually this calculating machine here may 因此，实际上在这里实施此计算机可能会
not be easy, might be complicated computationally. 并非易事，计算可能会很复杂。
It's also complicated in terms of not being able to derive 在无法推导方面也很复杂
intuition about it. 关于它的直觉。
So perhaps you might want to have a simpler version, a 因此，也许您可​​能想要一个更简单的版本，
simpler alternative to this formula that's easier to work 此公式的更简单替代方案，更易于使用
with and easier to calculate. 且易于计算。
We will be talking about one such simpler 我们将讨论一种更简单的方法
alternative next time. 下次选择。
So again, to conclude, at the high level, Bayesian 再次，概括地说，贝叶斯
estimation is very, very simple, given that you have 估计非常非常简单
mastered everything that has happened in 掌握了发生的一切
this course so far. 到目前为止的课程。
There are certain practical issues and it's also good to 存在某些实际问题，
be familiar with the concepts and the issues that in 熟悉其中的概念和问题
general, you would prefer to report that complete posterior 一般而言，您希望报告完整的后验
distribution. 分配。
But if you're forced to report a point estimate, then there's 但是，如果您被迫报告点估计，那么有
a number of reasonable ways to do it. 许多合理的方式来做到这一点。
And perhaps the most reasonable one is to just the 也许最合理的是
report the conditional expectation itself. 报告条件期望本身。