# matrix's questions - English 1answer

610 matrix questions.

### Self Attention in the Transformer learning algorithm

in this article can somebody tell me where the heck the Wq, Wk, and Wv matrices in the “Self-Attention in Detail” section come from a little more intuitively and specifically since the article doesn't ...

### Solve an equation of two unknowns to fit a distribution and mean

0 answers, 11 views optimization matrix ipf

### Rank Test for a Matrix

Suppose I have a matrix A corrupted with noise and I am looking for a test that tests the null hypothesis that the matrix A, rank(A)==1 v.s. rank(A)>1. I checked a little the literature and this paper ...

### 269 Relationship between SVD and PCA. How to use SVD to perform PCA?

3 answers, 154.906 views pca dimensionality-reduction matrix svd
Principal component analysis (PCA) is usually explained via an eigen-decomposition of the covariance matrix. However, it can also be performed via singular value decomposition (SVD) of the data matrix ...

### PCA in psych package with more columns than rows

1 answers, 68 views r pca matrix svd eigenvalues
Why is it impossible to do a PCA in R using principal from psych package without warnings with a matrix, which has more columns ...

### 6 How to compare two distance matrices?

0 answers, 2.178 views matrix distance similarities
Suppose that I have two distance matrices for the same set of items. By a distance matrix I mean a square matrix whose (i,j)th entry holds the distance (in terms of cosine similarity) between ith and ...

### 2 Are 1-dimensional numpy arrays equivalent to vectors? [closed]

1 answers, 4.683 views matrix linear-algebra numpy shape
I'm new to both linear algebra and numpy, so please bear with me. I'm taking a course on linear regression, where I learned that we can express our hypothesis as $\theta^TX$ where $\theta$ is our ...

### 1 Linear form arising in expected value of empirical variance of non-independent variables

Consider a normal vector $Y \sim \mathcal N(\mu, V)$ with $\mu \in\mathbb R^n$ and $V\in\mathbb R^{n\times n}$. I am interested in the expected value of  {1\over n-1} \left( Y'Y - {1\over n} (\...

### multivariate multiple regression, testing if a variable leads y's at the same time

I have a what I understand to be a multivariate multiple predictive regression. The y's are different variables and I am attempting to see if these are lead by w at the same time. I use the standard ...

### 1 Obtaining hard, overlapping clusters using non-negative matrix factorization

From my understanding non-negative matrix factorization (NMF) provides a natural way to obtain soft clusters from a non-negative $n$x$m$ data matrix $X$. NMF decomposes $X$ into two non-negative ...

### 31 If I generate a random symmetric matrix, what's the chance it is positive definite?

I got a strange question when I was experimenting some convex optimizations. The question is: Suppose I randomly (say standard normal distribution) generate a $N \times N$ symmetric matrix, (for ...

### 1 Model for independant categorical Games, Publications and dependant Interval Review Scores [closed]

What model should I use for for 2 independent categorical Games, Publications and dependent interval Review Scores? Each score is made by a publication reacting to elements or genera of the game. For ...

### 1 Analyze similarity matrix using linear mixed model

0 answers, 45 views r regression mixed-model lme4-nlme matrix
Let's say I have a similarity matrix where every subject is compared to every other subject on some similarity measure (e.g., body movement synchrony). These subjects are divided into two groups, say ...

### Is there a (matrix) operation that can count the elements in the vector?

For two vectors $x \in \{0, 1, 2\}^{n}$ and $y \in \{0, 1, 2\}^{n}$ And I need to generate a matrix $C\in \mathcal{R}^{3\times3}$, where $C_{i,j}$ equals to the number of index $t$, where $x[t]=i$ ...

### 3 Decrease of $(X'X)^{-1}$ as n increases

Let $X$ be a $n \times p$ matrix ($n \geq p$ like a conventional data matrix), with each column j filled by iid draws from a variable $\mathcal{X}_j$. I would like ...

### 3 Variance of a linear combination of vectors

1 answers, 1.360 views probability variance matrix
Let $A$ and $B$ be two constant matrices and let $x$ and $y$ be two random vectors, what is the general formula for $Var(Ax+By)$? I know the formula for when $x$ and $y$ are scalar random variables ...

### 2 Rayleigh quotient, traces and LDA optimization problem

I've been working about Linear Discriminant Analysis the last weeks, and after reading many articles, I see some aspects of this problem not very clear. The LDA optimization problem is formulated by ...

### 1 Explained Sums of Squares in matrix notation

1 answers, 34 views regression multiple-regression matrix
I am currently reading Appendix C from Gujarati Basic Econometrics 5e. It deals with the Matrix Approach to Linear Regression Model. I am unable to decipher how the author went from equation 7.4.19 ...

### Finding probability vectors from a matrix equation

0 answers, 14 views probability matrix inverse-problem

### 2 How to represent a non-trivial kernel as a Gram matrix? [closed]

Given a kernel, can we represent it as a Gram matrix? For example, a linear kernel can be presented (in Python/MATLAB code) in a ...

### calculate probabilities with Markov / Matrix calculations

0 answers, 14 views markov-process matrix
I am trying to get a little bit back into matrix calculations after I have sucessfully ignored it for about 25 years. Certainly you're laughing at me for this question. Here it comes: I thought I'd ...

### 1 Predicting categories based on a similarity matrix

I am looking for some help in organising some analyses. I will describe what I am trying to do with a fictional example and then talk about some of the things I've thought about already. Example I ...

### 3 Matrix and Vector Approaches to Backpropagation in a Neural Network

2 answers, 1.325 views neural-networks matrix backpropagation
I recently implemented a neural network, with backpropagation in a fully matrix approach, as described here, where the whole dataset is used for each backprop: http://ufldl.stanford.edu/wiki/index.php/...