Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [matrix]

A matrix (plural matrices) is a rectangular array of numbers, symbols, or expressions arranged in rows and columns. The individual items in a matrix are called its elements or entries.

1
vote
1answer
42 views

Proof $E[Z'TZ]^2=\operatorname{tr}^2(T)+\operatorname{tr}(T^2)$ [duplicate]

How to prove second moment of a quadratic form where $Z$ has normal distribution with mean zero and covariance matrix identical?
2
votes
0answers
33 views

Maximizing Sum of Upper Triangle Matrix Elements with Respect to Column and Row Swapping

So, I wanna make a ranking method for teams in the EPL, there are 20 teams in EPL, therefore there are $20!$ configurations of ranking assignment, my final ranking assignment would be the one that ...
0
votes
0answers
8 views

Inline Expression to Stack a Matrix and Raise to Powers [migrated]

I am writing this question seeking some help with an elegant, inline solution to stack matrices and at each iteration in the stack, apply a power. I have two matrices $\Lambda \in \mathbb{R}^{m\...
1
vote
0answers
21 views

Question about collinearity amongst variables in a correlation matrix

I have a data set which contains cell counts across the 250 brain regions in 12 animals. I want to construct a correlation matrix and a graph theoretical model using the grouped lasso correction. ...
5
votes
1answer
92 views

When does the underfitted regression model have more precise coefficient estimates?

Say we have a full regression model \begin{align*} \mathbf{y} &= \mathbf{X} \boldsymbol{\beta} + \boldsymbol{\epsilon}\\ &= \mathbf{X}_p \boldsymbol{\beta}_p + \mathbf{X}_r \boldsymbol{\beta}...
0
votes
1answer
27 views

representation of a convolutional layer as a fully connected one (matrix representation)

I'm surprised this isn't a duplicate, but Google seems to confirm that this is indeed the case. What is the representation of a convolutional layer as a fully connected layer? A convolutional layer ...
2
votes
0answers
14 views

How to apply the diffusion maps when the matrix is PSD but not positivity preserving?

In order to apply the diffusion maps in a matrix $C\in\mathbb R^{n\times n}$ , that matrix must obey some restrictions, C is symmetric: $C_{ij} = C_{ji}$, C is positivity preserving (PP): $\forall ...
0
votes
0answers
9 views

How to answer the following questions about Hopfield Networks

Below is the weight matrix of a Hopfield network ...
1
vote
0answers
32 views

Gradient Descent Vectorization with Numpy (1D transpose confusion) [closed]

I'm working through Andrew Ng's original Stanford course and ran into some numpy confusion. Basically, my main question is, if we dot product a 1D array with a 2D array in numpy (and the dimensions ...
0
votes
1answer
25 views

Is “$\mathrm E[X'X]$ has rank $k$” the assumption of no multicollinearity?

My lecturer wrote this on the board: Assume $\mathrm E[X'X]=Q$ has rank $k$, where $X$ is the data matrix and $k$ is the number of independent variables. I asked her if that is the assumption of ...
0
votes
0answers
8 views

Use a Mantel test in R

I have two matrices, which are exactly the same ones. I apply a mantel test and I get this output : ...
0
votes
1answer
73 views

Kappa condition number in R

I have read that the kappa function in R does not always explicitly calculate the condition number of a matrix, but rather, estimates the 2 norm of a matrix or a QR ...
1
vote
1answer
19 views

Updating regression solutions for removing a regressor without the original dependent variable

Note: This question is analagous to the question I asked here except instead of adding a column, I am removing it. I am interested in a linear regression on the model; $Y= X\beta + \epsilon$ And I ...
0
votes
0answers
16 views

True covariance matrix in Monte Carlo simulation?

In a linear model, such that Population model is $y_{it}=\ {\beta_{i1}f}_1+{\beta_{i2}f}_2+\cdots{\beta_{ik}f}_k\ +\ \varepsilon_{it} , i = 1,2,3...,p$ and $t=1,2,3,...T$ and $\mathrm{\Sigma_y}\ =\ ...
0
votes
0answers
35 views

Alternating Least Squares for Baseline Predictor

I am trying to figure out how ALS works when minimizing the following formula: $\\ \\$ $\text{min}_{\lbrace b_u,b_i \rbrace} \sum_{(u,i)\in \mathcal{K}} (r_{ui} - \bar{r} - b_u - b_i )^2 + \lambda_{...
0
votes
1answer
49 views

Verifying Identification Results for Univariate Regression

So I have this linear regression model shown below and I'm supposed to be showing that equation 3 is equal to equation 4. There's a hint that says a 2x2 inverse matrix appears in the proof, but the ...
0
votes
0answers
19 views

Is it useful to add a proportion hyperparameter in the concatenation layer?

I'm reading a paper on deep learning-based recommender systems: Neural Collaborative Filtering. There are two sub-networks, GMF and MLP, which are fused into a unified model, by a concatenation layer. ...
0
votes
0answers
11 views

Dimensionality of similarity matrix

Below is a screen shot of a paper. The authors take a data-set $E\in R^{nxm}$. Here $n$ is the number of observations/samples/patients and $m$ is the number of genes/features. Preprocessing ...
0
votes
0answers
6 views

Eigengene K-means algorithm

Someone please explain the following in simple words especially focusing on: 1: The understanding of the "indicator vector". 2: Gram matrix. How X'X is the Gram matrix of samples and how $trace(X'...
1
vote
0answers
56 views

Markov Chains to Predict Weather States

This is my first question so I apologize if it is located in the wrong section or does not follow forum protocols. I am currently working on developing a transition matrix for predictions of weather ...
0
votes
0answers
33 views

R: Covariance matrix with Kronecker product

I use the Kronecker product for the fast generation of a big covariance matrix for two random vectors $X = (X_1,..., X_p)$ and $Y = (Y_1, ..., Y_k)$ based on a small covariance matrix applying to each ...
0
votes
0answers
15 views

Efficient way to do Autoencoder on large sparse matrix

I have a large csr_matrix of shape (60,000, 180,000) and about 99.7% sparsity. I was trying to train an autoencoder for this matrix via mini-batch optimization. I tried batch size of 6000 with ...
0
votes
1answer
27 views

Matrix Orthogonal to Vector: why take transpose?

In econometrics, we often have n observations (in a column vector $y$) which we want to explain with k$<$n regressors (the observations are in an nxk matrix $X$). In this case we use least squares ...
1
vote
0answers
21 views

Calculating heritability: pedigree information with family variation

currently I am aiming to calculate heritability, for which I would have to estimate additive genetic variance (the inverse of the relatedness matrix) for a first step. This is done with the following ...
1
vote
0answers
25 views

Testing for non-zero values above and below the diagonal of a matrix

I have a $n\times n$ contingency matrix comparing count data (classification) of two procedures. I want to test for non-zero values above and below the diagonal (different classifications in both ...
0
votes
0answers
11 views

Effect size on the difference between group differences (ΔA-B vs ΔA-C) using R

I am trying to calculate effect sizes, but all I can find on the web relates only to the effect size of the difference between two groups. What I am interested in, is the effect size of the difference ...
2
votes
0answers
105 views

Does anyone know the rank of the Netflix Prize dataset?

I'm looking into the Netflix Prize at the moment. We model the dataset as an $n \times m$ matrix, where $n$ is the number of users and $m$ is the number of movies. Does anyone know the rank of the ...
0
votes
0answers
25 views

performing function (maxcol) across the column

I'm currently going through this paper: Bidirectional Attention Flow for Machine Comprehension, Seo, Minjoon, et al. (2016) They perform a $max_{col}$ function over a matrix $S \in \mathbb R^{TxJ}$: ...
0
votes
0answers
44 views

Dot Product and Distance Matrix

If we want to calculate the squared distance between 2 vectors, $x$ and $y$, we use the dot product: $$||x-y||^2 = (x-y)(x-y)^T = xx^T - 2xy + yy^T$$ The question is, how to generalize this concept ...
1
vote
0answers
177 views

Hierarchical clustering dendrogram on a distance matrix

When computing hierarchical clustering over a data matrix, a dissimilarity matrix is first computed in order to build the tree (dendrogram). For example: ...
0
votes
0answers
8 views

Generic expression used to compute output feature value map

Is there a generic expression used to compute output feature value map given an mxm input feature map and an nxn filter? ...
4
votes
2answers
598 views

Inverse of the covariance matrix of a multivariate normal distribution

Is the covariance matrix of a multivariate normal distribution always invertible?
1
vote
1answer
68 views

Observed information matrix with multivariate normal distribution

$$ \DeclareMathOperator\tr{tr} \DeclareMathOperator\vecOP{vec} \newcommand\di{\mathrm{d}} \newcommand\D{\mathrm{D}} \newcommand\Hess{\mathrm{H}} $$ I do not have much experience with matrix ...
1
vote
1answer
30 views

Why do we use quadratic form for random vectors? [closed]

I am studying linear regression. I have studied this in the past, but this is my first time exposing myself to the matrix form of multiple linear regression. My matrix algebra/linear algebra skills ...
3
votes
1answer
93 views

Which is more numerically stable for OLS: pinv vs QR

If I am doing standard OLS and want to calculate beta values (OLS estimators), which of the following is the more numerically stable method? And why? Assuming that the columns of $X$ are already mean-...
0
votes
1answer
45 views

What is matrix norm in (Collins, 2001)

I am studying "A generalization of PCA to the exponential family" (Collins et al., 2001) and I don't understand some notations. What is the meaning of the matrix squared norm on page 6 ? Is it a ...
1
vote
1answer
27 views

QR decomposition computational efficiency

I am struggling to find a reference for this: In terms of big Oh notation does anyone know of any expressions for the computational time taken by commonly used algorithms for QR decompositions?
0
votes
0answers
15 views

Notation question for multiplying matrix rows by vector

I have a matrix A and row vector b such that; $A=\begin{bmatrix} a_{11} & a_{12} & a_{13} & \dots & a_{1n} \\ a_{21} & a_{22} & a_{23} & \dots & a_{2n} \\ ...
2
votes
0answers
168 views

What is the most intuitive proof that Gaussian kernel is positive definite?

I have general form of Gaussian kernel $K(x,x')=\exp(-\|x-x'\|^{2})$ (just not considering $\sigma$). I tried to prove its positive definiteness via Gram matrix properties, but couldn't. Is there any ...
3
votes
2answers
190 views

adding a small constant to the diagonals of a matrix to stabilize

I have a large correlation matrix (110x110) with some small eigenvalues (about 20 < 0.1). It has been suggested that adding a constant (about 0.1) to the diagonals will help to stabilize the matrix....
0
votes
0answers
19 views

Build customer ratings from subscription datetime data for a recommendation system

I want to build a recommendation system with only some customer's subscription and unsubscription date. I have a database that looks like: ...
0
votes
0answers
9 views

Measure the change of feature set over time

I have two matrices mat1 and mat2, the same number of columns but the different number of rows. You can imagine that ...
1
vote
0answers
35 views

Simplifying a covariance expression

Let $I=\begin{pmatrix}I_1\\\vdots\\ I_n \end{pmatrix}$ be a random vector, and $\Omega$ and $\Omega_I$ two random variables. I am trying to simplify the following equation (which worth $\frac{\rho_{I\...
4
votes
2answers
74 views

Steps of Matrix Multiplication

It may seem kind of silly, but can anyone please show me the intermediate steps implied by the second equality in this derivation? $$e^\prime e = \left(y - Xb\right)^\prime\left(y - Xb\right) = y^\...
3
votes
1answer
83 views

The form of the Log-Likelihood Function in Mixed Linear Models

Let us assume the following mixed effects model: $y = X\beta+Zu+e$ where $y$ is a vector of n observable random variables, $\beta$ is a vector of $p$ fixed effects, $X$ and $Z$ are known matrices, ...
0
votes
0answers
25 views

How to apply Lagrange Multiplier to a matrix?

I am learning about the Lagrange Multiplier and I see how to apply it to a set of equations but I don't know how to apply it to matrices. Suppose I have: ...
1
vote
1answer
28 views

Given $m$ $n$-dimensional vectors, how to create a vector perpendicular to all of them?

Given $m$ vectors, $x_1$, $x_2$, ... $x_m$ with all $x_i \,\, \epsilon \,\, \mathcal{R}^n$, $i=1,2... m$ and $m < n$. How to sample a vector $x_{m+1}$ perpendicular to all the vectors $x_1$, $...
3
votes
2answers
111 views

What is the Joint Density Function of a Three-Level Mixed-Effects Model?

This is a follow-up question to a question I posted earlier. Obviously, maximum-likelihood estimation of mixed-effects models requires the joint density function. Let us assume a two-level mixed ...
5
votes
1answer
248 views

Mixed Models: How to derive Henderson's mixed-model equations?

In the context of best linear unbiased predictors (BLUP), Henderson specified the mixed-model equations (see Henderson (1950): Estimation of Genetic Parameters. Annals of Mathematical Statistics, 21, ...
2
votes
1answer
77 views

Interpreting matrix notation to run MLE in R

I am trying to re-create some indicators from the World Bank, using the methodology described in this paper, and I need to do maximum likelihood estimation, preferably using R. The aim is to get an ...