ai 中 統計_AI統計(第2部分)

ai 中 統計

Today I plan to cover the following topics: Linear independence, special matrices, and matrix decomposition.

今天,我計劃涵蓋以下主題:線性獨立性,特殊矩陣和矩陣分解。

線性獨立 (Linear independence)

A set of vectors is linearly independent if none of these vectors can be written as a linear combination of other vectors.For example, V1=(1,0) and V2=(0,1). Here, V2 cannot be written in terms of V1. However, V3 (3,4) is linearly dependent as V3 can be expressed as 3V1+4V2.

如果這些向量中的任何一個都不能寫成其他向量的線性組合,則它們是線性獨立的,例如V1 =(1,0)和V2 =(0,1)。 在此,不能用V1來寫V2。 但是,V3(3,4)與線性相關,因為V3可以表示為3V1 + 4V2。

Mathematically, s={V1, V2,…., Vn} is linearly independent if and only if the linear combination α1V1+α2V2+…..+αnVn=0 means that all αi=0.

在數學上,當且僅當線性組合α1V1+α2V2+ .... +αnVn= 0表示所有αi= 0時,s = {V1,V2,....,Vn}是線性獨立的。

矩陣運算 (Matrix operations)

Matrices can transform one vector to another vector. For example, V is an Nx1 vector and w is also an Nx1 vector.

矩陣可以將一個向量轉換為另一向量。 例如,V是Nx1向量,w也是Nx1向量。

矩陣的痕跡 (Trace of a matrix)

Trace of a matrix is given by its sum of diagonal elements. For matrix A, its trace will be the summation of all the elements with the same value of row and column.

矩陣的跡線由對角元素的總和給出。 對于矩陣A,其軌跡將是具有相同行和列值的所有元素的總和。

Image for post
Trace of a matrix, Image by author
矩陣的痕跡,作者提供的圖像

一些屬性 (Some properties)

  1. Tr(A+B) = Tr(A)+Tr(B)

    Tr(A + B)= Tr(A)+ Tr(B)
  2. Tr(AB) = Tr(BA)

    Tr(AB)= Tr(BA)
  3. Tr(A) = Tr(A.T) (A.T means transpose of matrix A)

    Tr(A)= Tr(AT)(AT表示矩陣A的轉置)

矩陣的行列式 (The determinant of a matrix)

Laplace expansion for an NxN matrix is given by the following formula:

NxN矩陣的拉普拉斯展開式由以下公式給出:

Image for post
The determinant of a matrix, Image by author
矩陣的行列式,作者提供的圖像

Determinant actually represents the volume formed by the column vectors. For a 2x2 vector, it represents the area.

行列式實際上表示由列向量形成的體積。 對于2x2向量,它表示面積。

Image for post
Interpretation of 2x2 vectors in space, Image by author
空間中2x2向量的解釋,作者提供

矩陣的可逆性 (Invertibility of a matrix)

The inverse of a matrix A is possible only if the det(A) is not 0. Note that this automatically means that the columns of A have to be linearly independent. Consider a matrix below.

僅當det(A)不為0時,矩陣A的逆才可能。請注意,這自動意味著A的列必須線性獨立。 考慮下面的矩陣。

Image for post
Matrix A, image by author
矩陣A,作者提供的圖片

Note that V1, V2,…., Vn are vectors and if any vector, say, Vn can be written as linearly dependent vectors of the rest like Vn=α1V1+α2V2+…..+αn-1Vn-1 then, we can do a simple column operation i.e last column = the last column- (α1V1+α2V2+…..+αn-1Vn-1) and this would yield a column full of zeros. This will make the determinant of matrix 0. For a 2x2 matrix, we will have 2 vectors V1 and V2. If V1 and V2 are linearly dependent like V1=2V2, then the area formed by the two vectors is going to be zero. A smart way to put this would be that the two vectors are parallel to one another.

請注意,V1,V2,...,Vn是向量,如果有任何向量,例如,Vn可以寫為其余部分的線性相關向量,例如Vn =α1V1+α2V2+ ..... +αn-1Vn-1,那么我們可以一個簡單的列運算,即最后一列=最后一列-(α1V1+α2V2+ ..... +αn-1Vn-1),這將產生一列充滿零的列。 這將決定矩陣0的行列式。對于2x2矩陣,我們將有2個向量V1和V2。 如果V1和V2是線性相關的,例如V1 = 2V2,則由兩個向量形成的面積將為零。 一種明智的解釋是,兩個向量彼此平行。

特殊矩陣和向量 (Special matrices and vectors)

  1. Diagonal matrix: Only diagonal entries are non zero and rest all elements are zero. D(i,j) = 0 if i is not equal to j.

    對角矩陣:僅對角線條目為非零,其余所有元素為零。 如果i不等于j,則D(i,j)= 0。
  2. Symmetric matrix: A matrix is said to be symmetric if the matrix and its transpose are equal.

    對稱矩陣:如果矩陣及其轉置相等,則稱該矩陣是對稱的。
  3. Unit vector: vector with unit length. 2-Norm of the vector is 1.

    單位向量:單位長度的向量。 向量的2范數為1。
  4. Orthogonal vectors: Two vectors X and Y are orthogonal if (X.T)Y = 0

    正交向量:如果(XT)Y = 0,則兩個向量X和Y是正交的
  5. Orthogonal matrix: If a transpose of a matrix is equal o its inverse, then we can say that the matrix is orthogonal. Also, all columns are orthonormal. The orthogonal matrix can be used to rotate vectors which preserve volume.

    正交矩陣:如果矩陣的轉置等于其逆,則可以說矩陣是正交的。 同樣,所有列都是正交的。 正交矩陣可用于旋轉保留體積的向量。
  6. Orthonormal matrix: If the inverse of a matrix is equal to its transpose with unit determinant, the matrix is said to be orthonormal.

    正交矩陣:如果矩陣的逆等于其行列式的轉置,則稱該矩陣為正交的。
Image for post
Orthogonal matrix, Image by author
正交矩陣,作者提供的圖片
Image for post
Orthonormal matrix, Image by author
正交矩陣,作者提供

本征分解 (Eigen decomposition)

Eigen decomposition is extremely useful for a square symmetric matrix. Let's look at the physical meaning of the term.

本征分解對于平方對稱矩陣非常有用。 讓我們看一下該術語的物理含義。

Every real matrix can be thought of as a combination of rotation and stretching.

每個實數矩陣都可以視為旋轉和拉伸的組合。

Image for post
Vector multiplication, Image by author
矢量乘法,作者提供的圖像
Image for post
operation on vector v that generates vector w, Image by author
向量v的運算,產生向量w,作者提供

Here, A can be thought of as an operator tat stretches and rotates a vector v to obtain a new vector w. Eigenvectors for a matrix are those special vectors that only stretch under the action of a matrix. Eigenvalues are the factor by which the eigenvectors stretch. In the equation below, the vector v is stretched by a value of lambda when operated with an eigenvector A.

在這里,可以將A視為操作員tat拉伸并旋轉向量v以獲得新的向量w。 矩陣的特征向量是那些僅在矩陣作用下才拉伸的特殊向量。 特征值是特征向量伸展的因子。 在下面的公式中,向量v在使用特征向量A時被拉伸了一個lambda值。

Image for post
Eigenvalue lambda of a vector v, Image by author
向量v的特征值λ,作者提供的圖像

Say, A has n linearly independent eigenvectors {V1, V2,….., Vn}. On concatenating all the vectors as a column, we get a single eigenvector matric V where V=[V1, V2,….., Vn]. If we concatenate the corresponding eigenvalues into a diagonal matrix i.e Λ=diag(λ1, λ2,…, λn), we get the eigendecomposition (factorization) of A as:

假設A有n個線性獨立的特征向量{V1,V2,…..,Vn}。 將所有向量連接為一列后,我們得到單個特征向量矩陣V,其中V = [V1,V2,.....,Vn]。 如果將對應的特征值連接到對角矩陣即Λ = diag(λ1,λ2,...,λn),則得到A的特征分解(因式分解)為:

Image for post
eigendecomposition of A, Image by author
A的特征分解,作者提供

Real symmetric matrices have real eigenvectors and real eigenvalues.

實對稱矩陣具有實特征向量和實特征值。

Image for post
Real symmetric matrix, Image y author
實對稱矩陣,作者:y

二次形式和正定矩陣 (Quadratic form and positive definite matrix)

The quadratic form can be interpreted as a ‘weighted’ length.

二次形式可以解釋為“加權”長度。

Image for post
Quadratic form, Image by author
二次形式,作者提供的圖片
Image for post
Quadratic form, Image by author
二次形式,作者提供的圖片

The positive definite (PD) matrix has all eigenvalues greater than zero. The semi-definite positive(PSD) matrix has eigenvalues greater than equal to zero. A PD matrix has a property that for all X, (X.T)AX is greater than 0. For example, if A=I or identity matrix then, (X.T)I(X)=(X.T)(X) which is greater than 0. A PSD matrix has a property that for all X, (X.T)AX is greater than equal to 0. Similarly, a negative definite (ND)matrix has all eigenvalues less than zero. And semi-negative definite (PD)matrix has all eigenvalues less than equal to zero.

正定(PD)矩陣的所有特征值均大于零。 半定正(PSD)矩陣的特征值大于零。 PD矩陣的屬性是,對于所有X,(XT)AX都大于0。例如,如果A = I或單位矩陣,則(XT)I(X)=(XT)(X)大于0. PSD矩陣具有以下特性:對于所有X,(XT)AX都等于0。類似地,負定(ND)矩陣的所有特征值均小于零。 半負定(PD)矩陣的所有特征值均小于零。

奇異值分解 (Singular value decomposition)

If A is an MxN matrix, then

如果A是MxN矩陣,則

Image for post
Singular value decomposition, Image by author
奇異值分解,作者提供
  1. U is an MxM matrix and orthogonal

    U是MxM矩陣并且正交
  2. V is an NxN matrix and orthogonal

    V是NxN矩陣并且正交
  3. D is an MxN matrix and diagonal

    D是MxN矩陣和對角線
  4. Elements of U are the eigenvectors of A(A.T), called left singular vectors

    U的元素是A(AT)的特征向量,稱為左奇異向量
  5. Elements of Vare the eigenvectors of (A.T)A, called right singular vectors

    Vare的元素(AT)A的特征向量,稱為右奇異向量
  6. Non zero elements of D are the square-root( λ((A.T)(A))) which means square-root of eigenvalues of (A.T)(A), called as singular values

    D的非零元素是平方根(λ((AT)(A))),它表示(AT)(A)特征值的平方根,稱為奇異值

結束 (End)

Thank you and stay tuned for more blogs on AI.

謝謝,請繼續關注更多有關AI的博客。

翻譯自: https://towardsdatascience.com/statistics-for-ai-part-2-43d81986c87c

ai 中 統計

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/388300.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/388300.shtml
英文地址,請注明出處:http://en.pswp.cn/news/388300.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

如何修改瀏覽器的默認滾動條樣式

如何修改瀏覽器的默認滾動條樣式 /* 瀏覽器滾動條樣式 *//* width */ ::-webkit-scrollbar {width: 4px;height: 4px; }/* Track */ ::-webkit-scrollbar-track {background: rgb(255, 255, 255);border-radius: 8px; }/* Handle */ ::-webkit-scrollbar-thumb {background: rg…

PE

PE文件規定了可執行文件的格式,凡是符合此格式的文件都能在windows系統上運行。PE文件的格式暫且不談,說一些感染PE文件的幾種途徑。 導入表感染。這個涉及比較復雜的操作,首先,要自行寫一個dll文件,提供程序中對原dl…

python入門系列:對象引用、垃圾回收、可變性

Python中的變量是什么 引言 Python和java中的變量本質不一樣,java的變量可以理解為一個盒子,用來容納我們的對象,使用前要先聲明它,好分配給我們合適的內存空間。Python的變量可以理解為一個標簽,先構造出對象&#xf…

twitter數據分析_Twitter上最受歡迎的數據科學文章主題

twitter數據分析If you’ve written data science articles or are trying to get started, finding the most popular topics is a big help in getting your articles read. Below are the steps to easily determine what these topics are using R and the results of the …

JAVA遇見HTML——JSP篇(JSP狀態管理)

案例:Cookie在登錄中的應用 URL編碼與解碼的工具類解決中文亂碼的問題,這個工具類在java.net.*包里 編碼:URLEncoder.encode(String s,String enc)//s:對哪個字符串進行編碼,enc:用的字符集(例&…

PE文件講解

我們大家都知道,在Windows 9x、NT、2000下,所有的可執行文件都是基于Microsoft設計的一種新的文件格式Portable Executable File Format(可移植的執行體),即PE格式。有一些時候,我們需要對這些可執行文件進…

easyui 布局之window和panel一起使用時,拉動window寬高時panel不跟隨一起變化

項目開發中布局是每一個組件都由最外層的window和內部的至少一個panel組成,其他的細小組件再依次放到panel中。 問題:當拉動外部的window時我們希望內部的panel的寬高也跟著變化,但是并沒有,尤其拉動其高度是更為明顯,…

是什么使波西米亞狂想曲成為杰作-數據科學視角

平均“命中率”是什么樣的 (What an Average ‘Hit’ looks like) Before we break the song down, let us have a brief analysis of what the greatest hits of all time had in common. I have picked 1500 songs ( charting hits ) right from the ’50s to the’10s, spre…

PE文件感染和內存駐留

這次,作者將和大家一起討論病毒的感染技術。另外,從本文開始,我們將陸續接觸到一些病毒的高級編碼技術。例如,內存駐留、EPO(入口點模糊)技術、加密技術、多態和變形等。通過這些高級技巧,你將進…

Python函數積累

評估函數eval() 去掉參數最外側引號并執行余下語句的函數 fun:將讓任何輸入的字符串轉換為python語句(如"12132" -> 12132)轉載于:https://www.cnblogs.com/LYluck/p/10376531.html

流行編程語言_編程語言的流行度排名

流行編程語言There has never been a unanimous agreement on what the most popular programming languages are, and probably never will be. Yet we believe that there is merit in trying to come up with ways to rank the popularity of programming languages. It hel…

Attributes.Add用途與用法

Attributes.Add("javascript事件","javascript語句");如:this.TextBox1.Attributes.add("onblue", "window.Label1.style.backgroundColor#000000;");this.TextBox1.Attributes.Add("onblur","this.style.d…

使用UIWebView加載網頁

1、使用UIWebView加載網頁 運行XCode 4.3&#xff0c;新建一個Single View Application&#xff0c;命名為WebViewDemo。 2、加載WebView 在ViewController.h添加WebView成員變量和在ViewController.m添加實現 [cpp] view plaincopyprint?#import <UIKit/UIKit.h> …

Java 開源庫精選(持續更新)

僅記錄親自使用和考慮使用的Apache Commons Commons IO - Commons IO 是一個幫助開發IO功能的實用程序庫 Commons Configuration - Commons Configuration 提供了一個通用配置界面&#xff0c;使Java應用程序可以從各種來源讀取配置數據。查看更多可重用、穩定的 Commons 組件S…

corba的興衰_數據科學薪酬的興衰

corba的興衰意見 (Opinion) 目錄 (Table of Contents) Introduction 介紹 Salary and Growth 薪資與增長 Summary 摘要 介紹 (Introduction) In the past five years, data science salary cumulative growth has varied between 12% in the United States, according to Glass…

hibernate的多表查詢

1.交叉連接 select * from A ,B 2.內連接 可以省略inner join 隱式內連接&#xff1a; select * from A,B where A.id B.aid; 顯式內連接&#xff1a; select * from A inner join B on A.id B.aid; 迫切內連接&#xff1a; 需要加上fetch關鍵字 內連接查詢兩者共有的屬性…

C# 讀取PE

最后分析結果會放在 一個DATASET里 ResourceDirectory這個TABLE 增加了 GUID列 為了好實現數結構 using System; using System.IO; using System.Data; using System.Collections; namespace PETEST { /// <summary> /// PeInfo 的摘要說明。 /// zgkesina.com …

10 個深惡痛絕的 Java 異常。。

異常是 Java 程序中經常遇到的問題&#xff0c;我想每一個 Java 程序員都討厭異常&#xff0c;一 個異常就是一個 BUG&#xff0c;就要花很多時間來定位異常問題。 什么是異常及異常的分類請看這篇文章&#xff1a;一張圖搞清楚 Java 異常機制。今天&#xff0c;棧長來列一下 J…

POJ 2777 - Count Color(線段樹區間更新+狀態壓縮)

題目鏈接 https://cn.vjudge.net/problem/POJ-2777 【題意】 有一個長度為 LLL 的區間 [1,L][1,L][1,L] &#xff0c;有 TTT 種顏色可以涂&#xff0c;有 QQQ 次操作&#xff0c;操作分兩種C A B CC \ A \ B \ CC A B C 把區間 [A,B][A,B][A,B] 涂成第 CCC 種顏色P A BP \ A \ …

如何實施成功的數據清理流程

干凈的數據是發現和洞察力的基礎。 如果數據很臟&#xff0c;您的團隊為分析&#xff0c;培養和可視化數據而付出的巨大努力完全是在浪費時間。 當然&#xff0c;骯臟的數據并不是新的。 它早在計算機變得普及之前就困擾著決策。 現在&#xff0c;計算機技術已普及到日常生活中…