机器学习之参数估计

Probability Theory focus on computing the probability of data arising from a parametric model with known parameters. Statistical Inference flips this on its head: we will estimate the probability of parameters given a parametric model and observed data drawn from it.

比如我得到了一些样本数据,并已知这些数据底层的分布是指数分布,但是并不知道具体是哪个指数分布!因为指数分布不是一个确定的分布,而是 one-parameter family of distributions. 不同的参数 λ 会得到不同的指数分布。正态分布,二项分布也都是同样的道理,不同的参数会得到不同的结果。我们通常把这样的分布叫做 parametric distributions or parametric models.

在这篇文章中,我将介绍一些方法,用给定的数据和参数模型,来估算出这些未知的 population parameters:

  • a population mean μ
  • the difference in two population means μ1μ2
  • a population variance σ2
  • the ratio of two population variances σ21/σ22

Point Estimation VS Interval Estimation

下面是维基百科中关于 Point Estimation 的定义:

In statistics, point estimation involves the use of sample data to calculate a single value which is to serve as a “best guess” or “best estimate” of an unknown population parameter. More formally, it is the application of a point estimator to the data.

下面是维基百科中关于 Interval Estimation 的定义:

In statistics, interval estimation is the use of sample data to calculate an interval of plausible values of an unknown population parameter; this is in contrast to point estimation, which gives a single value.

下面是维基百科中关于 Confidence interval 的定义:

In statistics, a confidence interval is a type of interval estimate (of a population parameter) that is computed from the observed data. The confidence level is the frequency (i.e., the proportion) of possible confidence intervals that contain the true value of their corresponding parameter. In other words, if confidence intervals are constructed using a given confidence level in an infinite number of independent experiments, the proportion of those intervals that contain the true value of the parameter will match the confidence level.

如果你对上面关于 Confidence interval 的定义有些不太理解,没有关系。当我介绍到如何解释一个 Confidence interval 的含义时,你会对这个定义理解的更加深刻。实际上,Interval Estimation 包含很多种方法,但是在这篇文章中我只介绍 confidence intervals.

Point Estimation

假设我们想知道中国人每天读书的平均时间, μ ,由于我们不可能去问到每个中国人他们每天拿出多少时间来读书,因此我们只能随机抽取出一些国人,得到他们的读书时间,然后用得到的这些数据去估算整个所有国人的每天平均读书时间。

我们有2种方法可以做这样的估算,它们分别是 maximum likelihood estimationmethod of moments. 在这个小节中,我也会介绍一种方法来评估某个点估计是否为一个 “好” 的点估计。

在介绍这个点估计的方法之前,我先来介绍一下 point estimator(点估计量)point estimate(点估计值) 的含义。

point estimator VS point estimate

We denote the n random variables arising from a random sample as subscripted uppercase letters:

X1,X2,,Xn

The corresponding observed values of a specific random sample are then denoted as subscripted lowercase letters:

x1,x2,,xn

比如上面那个读书时间的例子,我们一共寻问了100个中国人,那么我们就得到了100个随机变量, X1,X2,,X100 . 他们每个人给出的读书时间为 x1,x2,,x100 . 你可以把这个过程理解为做了100次实验。

下面是 point estimator 的定义:

The function of X1,X2,,Xn used to estimate θ is called a point estimator of θ . For example, the function: X¯=1ni=1nXi is a point estimator of the population mean μ ; The function: S2=1n1i=1n(XiX¯)2 is a point estimator of the population variance σ2 .

下面是 point estimate 的定义:

The function computed from a set of data is an observed point estimate of θ . For example, if xi are the observed grade point averages of a sample of 88 students, then: x¯=188i=188xi=3.12 is a point estimate of μ .

Maximum Likelihood Estimates

有很多方法可以从已知的数据中估算出未知的 population parameters,在这个小节中我会介绍最大似然估计,它属于点估计,它回答的是这样一个问题:

For which parameter value does the observed data have the biggest probability?

接下来,我会用最大似然估计分别求解一个离散的和连续的例子,让大家可以更好的理解它。假设我投掷100次硬币,出现了55个正面,很明显这是一个二项分布,它的参数是 n 和 p,由于 n = 100,现在就只剩下一个未知参数 p 了。那么现在我们很自然的会问这样一个问题:哪个 p 值会最大化观察到的数据的概率。因此我们可以写成一个关于参数 p 的函数:

P(55heads|p)=(10055)p55(1p)45

上面的函数叫做 likelihood function,它可以解释成:the probability of 55 heads given p? 毋庸置疑,接下来的任务就是找出 p 值,最大化这个概率,剩下的任务找微积分搞定吧,这里我就不多说了。通过这个例子,我们可以给出最大似然估计的定义:

Given data the maximum likelihood estimate (MLE) for the parameter p is the value of p that maximizes the likelihood P(data | p). That is, the MLE is the value of p for which the data is most likely.

有时我们会把 likelihood function 取对数,这样会简化计算过程。由于 log 函数是单调递增的,likelihood function 和 取对数之后的 likelihood function 它们最终得到的结果是一致的!

接下来,我再介绍一个关于连续型的例子。假设一种品牌的燎灯泡的寿命服从指数分布,当然我们不知道这个指数分布的参数 λ 是多少,我们只能用已知的数据去估算。假设我们一共测试了5个这种品牌的灯泡,它们的寿命分别是2,3,1,3,4. 现在已知了数据和模型,我们就可以用最大似然估计来估算出未知参数 λ 了。

Xi 表示第 i 个灯泡的寿命, xi 为随机变量 Xi 取到的值。那么每个 Xi 有 PDF: fXi(xi)=λe

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
机器学习实验中的参数估计是指通过使用训练数据来确定模型中的参数。在机器学习任务中,通常会使用一些具有调节参数的模型,如线性回归、逻辑回归等。这些模型的参数需要通过训练数据进行估计,以使模型能够更好地拟合数据并做出准确的预测。 在实验中,我们可以使用Matlab来进行参数估计。Matlab是一种功能强大的数学软件,内置了众多用于参数估计的函数和工具。下面是一些常用的参数估计方法: 1. 最小二乘法:最小二乘法是一种常见的参数估计方法,通过最小化误差平方和来估计模型参数。在Matlab中,可以使用lsqcurvefit函数或lsqnonlin函数来进行最小二乘法参数估计。 2. 极大似然估计:极大似然估计是一种通过最大化似然函数来估计参数的方法。在Matlab中,可以使用mle函数对给定的数据集进行参数估计。 3. 期望最大化算法:期望最大化算法是一种迭代算法,用于在隐藏的马尔可夫模型中进行参数估计。在Matlab中,可以使用em算法对给定的数据集进行参数估计。 无论使用哪种方法,参数估计的目标是找到使得模型在训练数据上表现最好的参数值。在进行参数估计之前,需要准备好合适的训练数据集,选择合适的参数估计方法,并根据实验需求进行调参。 总之,机器学习实验中的参数估计是非常重要的一步,它决定了模型的性能和泛化能力。通过使用Matlab提供的函数和工具,我们可以很方便地进行参数估计,并根据实验结果选择最佳的参数配置。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值