Linear Regression Basic

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θ
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值