Processing math: 100%

Saturday, October 20, 2018

Linear Discriminant Analysis -1

Computing classification means computing class posterior probabilities Pr(G|X) - that is probability that class is G given input X. If fk(x) is the class conditional density of X in class Gk and if πk is prior probability, then Bayes theorem gives, Pr(G=k|X=x)=fk(x)πkKl=1fl(x)πl
Depending on the models for class density, different techniques emerge.
* linear and quadratic discrimnant analysis use Gaussian densities
* Mixture of Gaussians lead to non-linear decision boundaries.
* Navie Bayes models assume that each class density is product of marginal densities.
Derivations:
Suppose that each class density is modelled as multivariate Gaussian. fk(x)=1(2π)p/2|Σk|1/2e12(xμk)TΣ1k(xμk) Clear that Pr(G=k|X=x)=fk(x)πkKl=1fl(x)πlPr(G=l|X=x)=fl(x)πlKp=1fp(x)πpPr(G=k|X=x)Pr(G=l|X=x)=fk(x)πkfl(x)πllog(Pr(G=k|X=x)Pr(G=l|X=x))=logfk(x)fl(x)+logπk(x)πl(x) Now expression fk(x)fl(x) can be simplified as follows. Note Σ is assumed to be same for all the classes. log(fk(x)fl(x))=[12(xμk)TΣ1(xμk)+12(xμl)TΣ1(xμl)] And =12[xTΣ1xxTΣ1μkμTkΣ1x+μTkΣ1μkxTΣ1x+xTΣ1μk+μlΣ1xμTlΣ1μl] Next =12[xTΣ1x+xTΣ1μk+μTkΣ1xμTkΣ1μk+xTΣ1xxTΣ1μlμTlΣ1x+μTlΣ1μl]
Before simplying, we should note the following:
  • Since Σ is a covariance matrix and since covariance between i and j is same as j and i, then ΣT=Σ=Σ1.
  • The mean matrices μk for class k and μl for class l are p×1 matrix.
  • Terms such as μkΣ1μl have dimensions 1×pp×pp×1=1×1 or scalars aka reals.
Second term and fifth term with leading xT can be simplified as 12xTΣ1(μkμl) Collecting third and seventh terms x at end. [12(μTkμTl)Σ1x]T=12xTΣ1(μkμl) The remaining terms are 12μlkΣ1μl+12μTlΣ1μl+12μTkΣ1μl12(μTkΣ1μl)T=12(μk+μl)TΣ1(μkμl) Combining all those simplification, log(Pr(G=k|X=x)Pr(G=l|X=x))=log(πkπl)12(μk+μl)TΣ1(μkμl)+xTΣ1(μkμl) At the line that divides class k,l has probabilities Pr(G=k|X=x)=Pr(G=l|X=x) log(1)=0=log(πk)log(πl)12μTkΣ1μk+xTΣ1μk+12μTlΣ1μlxTΣ1μl From here, the linear discriminant can be written as δk=log(πk)12μTkΣ1μk+xTΣ1μk

Thursday, August 9, 2018

Sets of Measure Zero.

Heard the saying - What happens in Las Vegas, stays in Las Vegas? Sets of measure zero are kind of like that.

For example, say f(x),g(x) are functions that are equal to each other in measurable space E, except on a subset N. Say a given measure on ``disagreeable'' space N is equal to zero. Now N is like Las Vegas and we are given license to forget about what happens in this space N and assert that f(x)=g(x) a.e where a.e stands for almost everwhere. To be more precise (just to prevent extra point from being leaked out of your exam paper!), we need to state f(x)=g(x) a.e[μ]. That is we need to specify which measure.

Mathematically, μ{x:f(x)g(x)}=0

where xN. The above criteria specifies the points of N. Here f ~ g and it is not too difficult to prove that this is an equivalence relation.

Reflexive property: Clearly f ~ f. The disagreeable set N in this case is a null set and measure of null set is 0. f=f on the whole set. Symmetric: Clearly f ~ g also means that set of disagreeable space remains same when we switch f to the right. Reflexive: Say f ~ g and let N1 be the disagreeable set. Say g ~ h and let N2 be the disagreeable set, then N1N2 where f,g,h are not equal to each other. Hence f ~ h.

Note all the above statements were made based on a property that f=g. Generally, we don't have to be specific about a property. Above assertions and proofs hold in a more abstract sense, that is for any property P.


Sunday, August 5, 2018

R&C - Lebesgue's Dominated Convergence Theorem

Dominated Conv Theorem
If fL(μ), then |Xfdμ|x|f|dμ

Proof uses the previously proven identity -

If f is a complex measurable function on X, there is a complex measurable function α on X such that |α|=1 and f=α|f|. This is an extension of property of complex numbers.

Start off by setting z=Xfdμ. Then there is another complex number α such that |α|=1 and αz=|z|.

Let u be real part of αf. Then, u|αf|=|f|. Hence,

|Xfdμ|=|z|=αz=αXfdμ=Xαfdμ=XudμX|f|dμ Suppose {fn} is a sequence of complex measurable functions on X such that f(x)=limnfn(x) exists for every xX. If there is a function gL1(μ) such that |fn(x)|g(x) (n=1,2,|x) then fL1(μ), limnX|fnf|dμ=0 and limnXfndμ=Xfdμ

Clear that |f|g. Since fn are measurable, the limit f is measurable, fL1(μ). |ffn||f|+|fn|2g This means, 2g|fnf| is a sequence of functions whose range is in [0,]. Hence, precondition to satisfy Fatou’s lemma is satisfied. This yield X2gdμlimninfX(2g|fnf|)dμ=X2gdμ+limninf(X|fnf|dμ)=X2gdμlimsupnX|fnf|dμ Taking advantage of finiteness of 2gdμ, limsupnX|fnf|dμ0 If sequence of nonnegative real numbers fails to converge to 0, then its upper limit is positive. Then above equation implies limnX|fnf|dμ=0. Hence, limnXfndμ=Xfdμ


Chain complexes on Hilbert spaces

 Chain complexes are mathematical structures used extensively in algebraic topology, homological algebra, and other areas of mathematics. Th...