Linear Regression Basic

本文探讨了如何通过最大似然估计法来确定线性回归模型的参数。假设目标变量与输入特征间存在线性关系,并且误差项遵循高斯分布,通过构建似然函数并最大化该函数来找到最优参数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Maxmize Liklihood Linear Regression

Suppose we have data set S={(x(i),y(i)),i=1,,m} where x(i)n such that x has n features with m training examples. Let us assume that the target variables and the inputs are related via a linear equation.

y(i)=θTx(i)+ϵ(i)

Where ϵ(i) is an error term that captures either un-model effects or random noise. Let’s assume that the ϵ(i)’s are distribute i.i.d.(independently and identically distributed) according to Gaussian Distribution with mean zero and variance σ2. Which can be written as ϵ(i)N(0,σ2). And the pdf of ϵ(i) is given by
p(ϵ(i))=12πσ((ϵ(i))22σ2)

Because of ϵ(i)=y(i)θTx(i), the pdf also can be given as
p(y(i)|x(i);θ)=12πσ((y(i)θTx(i))22σ2)

Notice that the notation ‘p(y(i)|x(i);θ)’ indicates that this is the distribution of y(i) given x(i) is parameterized by θ and θ is not a random variable, the formula is not a probability consition on θ. We can write the distribution as ‘y(i)|x(i);θN(θTx(i),σ2)’. Given an input matrix X=(x(1),x(2),,x(m))T and θ, what the distribution of y(i)’s is given by p(y|X;θ). When we wish to explicity view this as a function of θ, we call it the likelihood function:
L(θ)=L(θ;X,y)=p(y|X;θ)

Note that by the independence assumption on the ϵ(i)’s, this can be written by
L(θ)==i=1mp(y(i)|x(i);θ)i=1m12πσexp((y(i)θTx(i))2)2σ2)

Now, given this probabilistic model relating the y(i)’s and the x(i)’s. The principal of maximum likelihood says that we should should choose θ so as to make the data as high probability as possible. So We are facing an optimization problem.
maxθL(θ)

We define a new likelihood function called log likelihood:
(θ)=logL(θ)=logi=1m12πσexp((y(i)θTx(i))2)2σ2)=i=1mlog12πσexp((y(i)θTx(i))2)2σ2)=mlog12πσ12σ2i=1m(y(i)θTx(i))2

When we scale the loss function the estimation of θ=argminθmi=1logp(x(i);θ) will not change. We could use the expectation to be the standard.
θ=argminθ
资源下载链接为: https://pan.quark.cn/s/d9ef5828b597 在本文中,我们将探讨如何通过 Vue.js 实现一个带有动画效果的“回到顶部”功能。Vue.js 是一款用于构建用户界面的流行 JavaScript 框架,其组件化和响应式设计让实现这种交互功能变得十分便捷。 首先,我们来分析 HTML 代码。在这个示例中,存在一个 ID 为 back-to-top 的 div 元素,其中包含两个 span 标签,分别显示“回到”和“顶部”文字。该 div 元素绑定了 Vue.js 的 @click 事件处理器 backToTop,用于处理点击事件,同时还绑定了 v-show 指令来控制按钮的显示与隐藏。v-cloak 指令的作用是在 Vue 实例渲染完成之前隐藏该元素,避免出现闪烁现象。 CSS 部分(backTop.css)主要负责样式设计。它首先清除了一些默认的边距和填充,对 html 和 body 进行了全屏布局,并设置了相对定位。.back-to-top 类则定义了“回到顶部”按钮的样式,包括其位置、圆角、阴影、填充以及悬停时背景颜色的变化。此外,与 v-cloak 相关的 CSS 确保在 Vue 实例加载过程中隐藏该元素。每个 .page 类代表一个页面,每个页面的高度设置为 400px,用于模拟多页面的滚动效果。 接下来是 JavaScript 部分(backTop.js)。在这里,我们创建了一个 Vue 实例。实例的 el 属性指定 Vue 将挂载到的 DOM 元素(#back-to-top)。data 对象中包含三个属性:backTopShow 用于控制按钮的显示状态;backTopAllow 用于防止用户快速连续点击;backSeconds 定义了回到顶部所需的时间;showPx 则规定了滚动多少像素后显示“回到顶部”按钮。 在 V
All of Statistics is a comprehensive textbook on statistics written by Larry Wasserman, a professor of statistics at Carnegie Mellon University. The book provides a thorough introduction to statistical concepts and methods, including probability theory, statistical inference, regression analysis, and hypothesis testing. It is intended for students and researchers in a variety of fields, including mathematics, engineering, computer science, and the natural and social sciences. The book is divided into six parts: 1. Probability: This section covers basic concepts in probability theory, including random variables, probability distributions, conditional probability, and Bayes' rule. 2. Statistical Inference: This section covers the principles of statistical inference, including point estimation, confidence intervals, and hypothesis testing. 3. Linear Regression: This section covers linear regression models, including simple linear regression, multiple regression, and logistic regression. 4. Nonparametric Methods: This section covers nonparametric methods, including rank-based tests and density estimation. 5. Bayesian Methods: This section covers Bayesian methods, including Bayes' theorem, Bayesian inference, and hierarchical models. 6. Advanced Topics: This section covers advanced topics in statistics, including high-dimensional data analysis, time series analysis, and causal inference. Throughout the book, Wasserman emphasizes the importance of understanding the underlying concepts and principles of statistics, rather than just memorizing formulas and procedures. He also provides numerous examples and exercises to help readers develop their skills in statistical analysis. Overall, All of Statistics is a highly-regarded textbook that provides a comprehensive introduction to statistical theory and methods. It is suitable for undergraduate and graduate students, as well as researchers and practitioners in a range of fields.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值