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.
935
questions
0
votes
1
answer
62
views
Comparing linear slopes between two scatterplot matrices
Below is a reproducible example of code that produces a dataset and plot roughly similar to what I am working on. The dataset is comprised of multiple columns for gene transcript abundance values and ...
0
votes
0
answers
13
views
Bishop gradient calculation
In section 3.1.1 of Pattern Recognition and Machine Learning by Christopher Bishop, it is written that
$$\ln p(\mathbf{t} | \mathbf{w}, \beta) = \frac{N}{2} \ln \beta - \frac{N}{2} \ln (2 \pi) - \beta ...
2
votes
0
answers
24
views
Subgradient of the matrix norm
When I want to obtain statistical properties of the matrix-variate lasso method, for example,
$$
\hat{X}=\underset{X\in \mathbb{R}^{n\times n}}{\arg \min}\mathcal{L}\left(X\right)+\lambda_n \|X\|_1,
$$...
5
votes
1
answer
197
views
Is the matrix formed by taking the absolute values of the elements of a positive-definite covariance matrix still positive definite?
Suppose I have a positive-definite covariance matrix $\boldsymbol{\Sigma}$. I construct a new matrix $\boldsymbol{\Lambda}$, where each element $(i,j)$ in $\boldsymbol{\Lambda}$ is equal to the ...
0
votes
0
answers
24
views
Cannot invert "recomposed" matrix after spectral decomposition
Please bear with me here because I don't know much about linear algebra and even less about numerical linear algebra. I'm trying to write an R function that, at some point, decomposes a penalty matrix ...
0
votes
2
answers
59
views
Derivative of $\text{tr}\left(XAX\right)$ w.r.t $X$ [duplicate]
Set a matrix $X\in \mathbb{R}^{n\times n}$ and a symmrtric matrix $A\in\mathbb{R}^{n\times n}$. I'm trying to get $\frac{\partial\text{tr}\left(XAX\right)}{\partial X}$. If the matrix $X$ is ...
5
votes
2
answers
120
views
Hessian of the softmax function
Problem
Let $\mathbf{x} \in \mathbb{R}^n$ and $\mathbf{c} \in \mathbb{R}^n$, and consider a softmax function $\sigma: \mathbb{R}^n \to \mathbb{R}^n$
Find representation of the Hessian of $f=\mathbf{c}...
2
votes
1
answer
40
views
Estimating the success of an approximation of a known matrix
I am trying to approximate a known $N\times N$ matrix $A$ with an 'estimation' matrix $A'$. The question is, how is it possible to quantify the error in this approximation - the difference between $A$...
1
vote
1
answer
35
views
(Multivariate) anomaly detection of (redundant) sensor data
I’m currently working on my master thesis and I’m looking for some inputs for the following situation:
I have data of 2-20 sensors all measuring the same variable at 1-3 different locations in 15mins-...
0
votes
0
answers
13
views
How to test whether the values in one matrix are significantly smaller than in another matrix?
I have a set of proteins for which I have predicted structures using two distinct methods. For each protein, both methods have generated 5 different structures. My goal is to compare the stability of ...
1
vote
0
answers
27
views
Optimize MSE with wildcard elements
Let's say you have a $n \times n$ matrix, for example, this $4 \times 4$ matrix:
$$M = \begin{bmatrix}a & b & c & d \\\ e & f & g & h \\\ i & j & k & l \\\ m & ...
0
votes
0
answers
60
views
Sum of powers (geometric series) of state transition matrix
I am working discrete time Markov chain analysis for some large state transition graph. I want to find the rewards/cost to reach from the init state to the terminal/accepting states.
I have the state ...
1
vote
1
answer
33
views
Derivative of structure matrices
I'm trying to follow 'Advanced Multivariate Statistics with Matrices', chapter 1.4. I know that this book is quite old, however I'm rather constrained with time and the papers I'm reading references ...
0
votes
0
answers
18
views
Proof that regression coefficients are identical for averages over treatments data and raw data [duplicate]
The topic is somewhat related to this question.
Let's say Experiment with treatments T0, T1, T2 with four repetitions for each and a response $y = (y_{0, 1}, y_{0, 2}, ..., y_{2, 4})$, one ...
0
votes
1
answer
75
views
Frobenius norm of rank-constrained matrix product is bounded
Say I have three matrices $\mathbf{W} \in \mathbb{R}^{p \times m}$ and $\mathbf{A}, \mathbf{B} \in \mathbb{R}^{m \times n}$ with $\operatorname{rank}(\mathbf{A}) \leq r$ and $\mathbf{B}$ is ...
0
votes
0
answers
12
views
How to convert pairwise dissimilarity matrix into continues predictor in R
I have collected plant species data and AGB from 25 different sites and I want to do regression analysis of Beta-diversity (i.e. dissimilarity among 25 sites) as a predictor and AGB as response ...
1
vote
1
answer
76
views
Noise Removal for Consistent Anomaly Detection in Multi-Dimensional Time Series Using Matrix Profile
In an online anomaly detection task involving multiple time series, I compute the left matrix profile using non-normalized Euclidean distances for each of the time series (Figure 1). However, since ...
1
vote
0
answers
43
views
Linear regression - closed form solution easy described
I would like to understand better the closed-form solution of the linear regression.
If I understood correctly, we are coming from the following equation:
$$ y=w_0 x_0 + w_1 x_1 + ... + w_n x_n = \...
0
votes
0
answers
10
views
Decomposing model volatility with respect to factor contributions
Consider a linear model
$\textbf{y} = \textbf{x}\pmb{\beta} + \pmb{\varepsilon}$
with $\textbf{y}$ a $T \times 1$ vector of random variables, $\pmb{\beta}$ a $K \times 1$ vector and $\textbf{x}$ a $T \...
0
votes
0
answers
16
views
Depicting a Single Equation Error Correction Model in Matrix / Vector notation?
I am trying to express the following single equation error correction model in matrix / vector notation. The original model is:
$
\Delta Y = y_{t-1} \delta_0 + \sum_{i=1}^{k}z_{i,t-1} \delta_k + \...
4
votes
2
answers
169
views
How do we interpret the covariance matrices $\textbf{U}$ and $\textbf{V}$ in the Matrix Variate Normal Distribution?
Consider the Matrix Normal Distribution. My first question is: how do we interpret the entries $\textbf{X}_{ij}$ of the random matrix $\textbf{X}(n\times p)$? My second question is: how do we ...
0
votes
0
answers
11
views
How to measure the difference in outcomes across 32 dimensions in a time-series study?
I have a dataset that recorded the contact patterns for each participant during three waves.
For example:
matrix_base_1 means that Participant 1 met with one person aged over 70 at location two, and ...
0
votes
0
answers
44
views
Solving for the variance in specified equation
At the moment, I have a task which includes solving for the variance in the following equation (denoted 'sigma' in the expression below, equation 10).
However, given the nature of the equation, I ...
1
vote
1
answer
22
views
Finding a design matrix
I am trying to understand how a design matrix was obtained in this problem below.
Consider the one sample problem:
$Y_i \sim N(\mu, \sigma^2), 1 \le i \le n$. with the $Y_i's$ i.i.d. The MLE is:
$\hat\...
1
vote
0
answers
63
views
Is this regression problem solvable? [closed]
I have a random vector $\pmb{x}=(X_1,...,X_p)^T\in \mathbb{R}^p$, a symmetric matrix
$$\Theta = \left(\begin{matrix}0 & \theta_{12} & \theta_{13} & \cdots & \theta_{1p}\\
\theta_{12} &...
0
votes
0
answers
25
views
Proving how scaling of predictor variable in linear regression, affects the fitted coefficient [duplicate]
In linear regression the OLS solution is given by:
$$
\hat{\beta} = (X^TX)^{-1}X^TY
$$
I want to show that if you scale the $i$th predictor variable by a constant, then the corresponding $i$th ...
0
votes
1
answer
78
views
In a linear model, why do we have $-2X^T \vec{y} + 2X^T X \vec{\beta}=0$? [duplicate]
When we derive the estimates of $\vec{\beta}$ such that they minimize the sum of squared error ($SSE$) we begin with $\sum_{i=1}^{n} (y_i - (\beta_0 + \beta_1x_1 + ... + \beta_kx_k))^2$. This is ...
1
vote
1
answer
68
views
How can we think about linear regression geometrically?
The simple linear regression model is given by $y_i = \beta_0 + \beta_1x_1 + e$
It is my understanding that it can be rewritten in matrix vector form as $\vec{y} = X\vec{\beta} + \vec{e}$ where $X$ is ...
0
votes
0
answers
71
views
Similarity and Prevalence in Binary Vectors
Let's say I have N vectors, all of length L. Each vector is binary, such that they comprise of 0s and 1s whereby a 0 represents an 'absence' and 1 represents a 'presence' of an element denoted by its ...
0
votes
0
answers
50
views
How do we prove that the rows or columns of a hat matrix sum up to 1, when mean function includes an intercept? [duplicate]
Every textbook I encounter tells me that this is simply a meaningful relationship of a hat matrix, without explaining why:
If H is the hat (projection) matrix, and our X matrix has full rank and a ...
0
votes
0
answers
34
views
Calculate multivariate betas using correlations and standard deviations [duplicate]
In a simple regression context:
$$
y = \alpha + \beta x + e
$$
We can estimate beta from:
$$
\hat{\beta} = \frac{cov(x,y)}{var(x)} = \rho_{xy} \frac{\sigma_y}{\sigma_x}
$$
This last decomposition is ...
2
votes
1
answer
125
views
multicollinearity and categorical variables
When performing regression with categorical variables, in order to avoid multicollinearity, it is necessary to drop one level. This is clear in fact:
Let's assume I have a binary categorical variable (...
11
votes
2
answers
720
views
Frobenius norm of a product of Gaussian matrices
Suppose $$C_n=X_1 X_2\cdots X_n,$$ where $X_i$ is $d\times d$ matrix with IID entries normally distributed with mean 0 and variance $\frac{1}{d}$.
The following appears to be true for large $d$, why?
$...
0
votes
0
answers
19
views
Which dissimilarity index to use with categorical ecological data [duplicate]
I am currently working on data representing the abundance of microorganisms in a categorical way, like 0 = no organisms; 1 = 1-5 organisms; 2 = 6-10 and so on (5 being the highest number).
And i am ...
0
votes
0
answers
27
views
How would you deal with sparse and scattered 2d data in a way that makes physical sense?
I am currently analyzing rainfall data which is in longitude/latitude/value format i.e. a 2d matrix. That is, I have a series of values x,y,z such that ...
0
votes
0
answers
100
views
Smoothing a transition matrix
I have a dataset containing observations at time t and t+1 of ratings A (best) to E (worst) and Default. I want to use transition matrices to predict future ratings t+2, t+3, etc
The transition matrix ...
1
vote
0
answers
46
views
Are there any statistical tests that are implemented in R for testing whether a matrix is positive semi-definite and of the right rank?
I'm working on utility functions for discrete choice modelling, preferences are often modelled using quadratic preferences, which look like $$u(z) = a + q'z - z'rz$$ where $z$ are a vector of ...
2
votes
1
answer
99
views
What is the fourth moment of a Euclidean Norm?
Let $X=\lVert M^\top p\rVert_2$, where $M$ is an $n\times n$ non-random matrix and $p\sim N(0,I_{n\times n})$ is an $n\times 1$ vector, and$\lVert \cdot\rVert_2$ is the Euclidean norm.
Using some ...
0
votes
0
answers
28
views
Betas from precision matrix?
This is really 2 questions.
I would like to do a linear multi-regression on a large quantity of data, so large that I cannot really store it (it’s about 1e10 observations across 2500 features). Hence ...
0
votes
0
answers
18
views
Measuring the level of centrality of a matrix
I have simulated the moving and clustering of actors through Netlogo. I colour actors with a score higher than 60 as red, lower than 40 as green, and others as blue. Now I need a measurement of the ...
0
votes
0
answers
16
views
Expectation of constant matrix sandwiched between two random matrices
I have a $N\times P$ random matrix $X$ with i.i.d. coefficients from a standard normalized Gaussian $\mathcal{N}(0, 1)$. The corresponding Wishart matrix is
$$W = \frac{1}{P}X X^{\top}$$
Calculating ...
1
vote
1
answer
54
views
Distinguishing between $\epsilon$ and $e$ in interaction with residual maker matrix $M$
I've hit a small snag in working out some of the implications of the residual maker matrix $M$.
Through previous posts I've been able to understand the difference between the use of $e$ and $\epsilon$,...
2
votes
1
answer
84
views
Is it possible to perform a meta-analysis of multiple outcomes and multiple predictors?
I have a pool of 20-ish quantitative studies that report odds ratios for a particular outcome (e.g. homelessness) but most studies will also report a few more outcomes. All of these studies report the ...
3
votes
1
answer
2k
views
Approximate the Fisher information matrix of a multivariate normal distribution
For $d\geq 2$, consider the d-dimensional multivariate normal distribution $\mathcal N(x|\mu,\Sigma)$ whose the log of density is given by
$$
l(x;\mu,\Sigma)=-\frac{d}{2}\log(2\pi)-\frac{1}{2}\log|\...
3
votes
2
answers
171
views
Why is $\beta^{T}X_{c}^{T}X_{c}\beta$ divided by $(k-1)\sigma^{2}$ in multiple regression?
In single linear regression mmodel, to find expectation of regression, we use the following formula:
$$E[MSR] = \sigma^{2}+\hat \beta^{2}(X-\bar X)^{2}.$$
$MSR = \frac{\sum_{i=0}^n (\hat y-\bar y)^{2}}...
1
vote
0
answers
21
views
Entries of the matrix variate generalized inverse Gaussian
I'm currently dealing with a Gibbs sampler of the matrix variate generalized inverse Gaussian distribution. In order to check the correctness of the Gibbs sampler, I'd like to know what are the ...
1
vote
1
answer
40
views
Geometric meaning of cross product of a design matrix and model coefficients
I am trying to understand more about the geometry of linear modeling. Take for example an experiment with one categorical predictor having two levels and a numerical response. If two data points are ...
2
votes
2
answers
112
views
PCA Derivation with maximizing projection length
I was reading a post about deriving PCA, So it considered an arbitrary row datum, $x_i$ and tried to maximize projection length for each row of data matrix, $X \in \mathbb{R}^{N\times D}$:
$$\sum_{i=1}...
0
votes
0
answers
44
views
Calculus versus matrix representation in OLS
In the Wikipedia article Ordinary Linear Squares there is an example for finding the estimators $\beta_i$ for a linear model of the sort:
$$y_i = \beta_0 + x_1\beta_1 + x_2\beta_2 + \ldots$$
In the ...
1
vote
0
answers
76
views
Gradient of Gaussian Process Regressor
I have a data ((x,y),f) that I am fitting using Gaussian Process Regression in Python's sklearn package. The posterior mean of the GP is essentially my output with an associated error. Based on either ...