This is the 25th day of my participation in the November Gwen Challenge. Check out the event details: The last Gwen Challenge 2021

Simulation calculation of AN (Vicious)

First we set up some matrices and parameters


A 0 = [ 0.2 0 0.8 0.9 0.1 0 0 0 1 ] b 0 = [ 0.5 0 0.5 ] Λ q = [ 0.8 0.1 0.1 ] Alpha. = 1 . d = 1 \ begin} {aligned A_0 & = \ begin {bmatrix} \ \ 0.9 & 0.1 & 0.8 & 0.2 0 and 0 \ \ & 0 0 & 1 {bmatrix} \ \ \ end b_0 & = 0.5 \ \ 0 \ \ begin {bmatrix} {bmatrix} \ \ \ \ 0.5 \ end Lambda_q & = \ begin {bmatrix} \ \ \ \ & 0.1 & 0.8 & 0.1 {bmatrix} \ \ \ \ end alpha & = 1, d = 1 \end{aligned}

To explain a little, A0A_0A0 is the prediction probability distribution of NNN samples with high confidence based on the description of the original algorithm. It can be seen that only 3 samples have high confidence, and their prediction categories are 2,0,2 respectively. B0b_0b0 is the predicted probability of a sample XXX. Since it is a probability distribution, the sum must be 1. λ Q \Lambda_q λ Q is the sample proportion of the three categories, and it can be seen that the data of the first category is very large

The first is column normalization


Λ S = D ( L 0 T e ) = D ( [ 0.2 0 0.8 0.9 0.1 0 0 0 1 0.5 0 0.5 ] T [ 1 1 1 1 ] ) = D ( [ 1.6 0.1 2.3 ] ) = [ 1.6 0.1 2.3 ] S d = L 0 Λ S 1 = [ 0.2 0 0.8 0.9 0.1 0 0 0 1 0.5 0 0.5 ] [ 1 / 1.6 10 1 / 2.3 ] = [ 1 / 8 0 8 / 23 9 / 16 1 0 0 0 10 / 23 5 / 16 0 5 / 23 ] \ begin} {aligned \ Lambda_S & = \ mathcal {D} (L_0 ^ T \ mathbf {e}) \ \ & = \ mathcal {D} ({\ begin {bmatrix} \ \ 0.9 & 0.1 & 0.8 & 0.2 0 and 0 1 \ \ \ \ & 0 0 & 0.5 & 0.5\0 & end \ {bmatrix}} ^ T begin {bmatrix} \ \ 1 \ \ 1 \ \ 1 \ end \ \ {bmatrix}) & = \ mathcal {D} (\ begin {bmatrix} \ \ \ \ \ 2.3 0.1 1.6 end {bmatrix}) \ \ & = \ begin && \ \ {bmatrix} 1.6 & 0.1 & \ \ & 2.3 {bmatrix} \ \ \ \ \ end S_d &=L_0\Lambda_S^{-1}\\ & = \ begin {bmatrix} \ \ 0.9 & 0.1 & 0.8 & 0.2 0 & 0 \ \ & 0 0 1 \ \ & 0 0.5 & 0.5 & {bmatrix} \ \ end begin {bmatrix} 1/1.6 && 10 & \ \ \ \ & & & 1/2.3 {bmatrix} \ \ \ end &= \begin{bmatrix}1/8&0&8/23\\9/16&1&0\\0&0&10/23\\5/16&0&5/23\end{bmatrix} \end{aligned}

If you look at the matrix SdS_dSd, the sum of each column is one, the column normalization, and if we go back to the roots, it’s actually the sum of each column of L0L_0L0, and then dividing each column of L0L_0L0 by that sum

And then there’s row normalization


Λ L = D ( [ 1 / 8 0 8 / 23 9 / 16 1 0 0 0 10 / 23 5 / 16 0 5 / 23 ] [ 0.8 0.1 0.1 ] [ 1 1 1 ] ) = D ( [ 31 / 230 11 / 20 1 / 23 25 / 92 ] ) = [ 31 / 230 11 / 20 1 / 23 25 / 92 ] L 1 = [ 230 / 31 20 / 11 23 92 / 25 ] [ 1 / 8 0 8 / 23 9 / 16 1 0 0 0 10 / 23 5 / 16 0 5 / 23 ] [ 0.8 0.1 0.1 ] = [ 23 / 31 0 8 / 31 9 / 11 2 / 11 0 0 0 1 23 / 25 0 2 / 25 ] \begin{aligned} \Lambda_L &= (\ \ mathcal {D} the begin {bmatrix} 1/8 & 9/16 & 8/23 \ \ & 0 1 & 0 \ \ 0 & 5/23 & 5/16 & 10/23 \ \ & 0 0 {bmatrix} \ \ end begin && \ \ {bmatrix} 0.8 & 0.1 & \ 0.1 \ \ & e nd{bmatrix}\begin{bmatrix}1\\1\\1\end{bmatrix})\\ &= \mathcal{D}(\begin{bmatrix}31/230\\11/20\\1/23\\25/92\end{bmatrix})\\ &= \begin{bmatrix}31/230&&&\\&11/20&&\\&&&1/23&\\&&&&25/92\end{bmatrix}\\\\ L_1&= \begin{bmatrix}230/31&&&\\&20/11&&\\&&&23&\\&&&&92/25\end{bmatrix}\begin{bmatrix}1/8&0&8/23\\9/16&1&0\\0&0&10/23\\5/16&0 & 5/23 {bmatrix} \ \ end begin && \ \ {bmatrix} 0.8 & 0.1 & \ \ && \ end {bmatrix} \ \ & = 0.1 \begin{bmatrix}23/31&0&8/31\\9/11&2/11&0\\0&0&1\\23/25&0&2/25\end{bmatrix} \end{aligned}

B1 =[23/2502/25]T\mathbf{b}_1=\begin{bmatrix}23/25&0&2/25\end{bmatrix}^Tb1=[23/2502/25]T \end{bmatrix}^Tb1=[23/2502/25]T \end{bmatrix}^Tb1=[23/2502/25]T Originally, the probability distribution of b0\mathbf{b} _0B0 is [0.500.5]T\begin{bmatrix} 0.5&0&0.5end {bmatrix}^T[0.500.5]T, and the category after “prior” adjustment is obviously inclined to the first category with more data. And the sum of b1\mathbf{b}_1b1 vectors is 1, which conforms to the definition of probability