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.

learn more… | top users | synonyms

1
vote
0answers
24 views

Vectorizing code to calculate (squared) Mahalanobis Distiance [migrated]

Say I want to to calculate the squared Mahalanobis distance between two vectors $\vec{x}$ and $\vec{y}$ with covariance matrix $\mathbf{S}$. This is a fairly simple function defined by $$M^2(\vec{x} ...
0
votes
1answer
22 views

How does the Proxy::dist package for r compute cross-distance matrix between two matrices?

I am trying to understand how a cross-distance matrix between two matrices is computed. Can anyone help? Maybe a simple example would help, two matrices having nrow observations of ncol variables ...
0
votes
0answers
5 views

“Tucker decomposition often assumes Gaussian noises”. Are the noises here input or output?

I saw in some papers saying " Tucker decomposition methods have implicitly or explicitly assumed the noises are Gaussian" in ...
0
votes
0answers
11 views

Quickest distance computation between two large vectors in R [migrated]

I wish to calculate the distance between each element in one vector and each element in another vector in the quickest possible way in R. A small example is: ...
0
votes
0answers
18 views

Covariance Matrix vs. Pairwise Covariance Matrix?

I found this equation here to calculate a covariance matrix of any number of variables using matrix algebra. $1/N(X - 1\bar{x})^T(X - 1\bar{x}^T)$ For a given matrix $X$ with $N$ samples. The ...
0
votes
2answers
40 views

Working with expected value of a matrix

If I have two matrices $C$ and $D$ of the same size. If I know that the expected value of $C$, denoted by $E(C)$, is equal to $D$. So $E(C)=D$. In this case, $E(diag(C))$ will be equal to $diag(D)$, ...
1
vote
2answers
23 views

Multivariate normal - matrix multiplication

i am trying to refresh my knowledge of the multivariate normal distribution. the standard formula as per below i would normally think of x as a tall and slim matrix of the covariate values (rows ...
1
vote
0answers
25 views

Is there a way to smooth cohort demography data in R? [closed]

I have a set of mortality data that I'd like to smooth so that I can run it through a Lee-Carter model for forecasting. The set of data focuses on the cohorts of aged 1-11 people for the years of ...
1
vote
2answers
23 views

Low rank approximation of binary valued matrix

How does one get the low rank approximation of binary matrix? Is the low rank approximation also a binary matrix? Note - Here binary matrix just means that any entry of the matrix can either be 0 or ...
1
vote
0answers
30 views

Given two correlations in a 3 by 3 correlation matrix, what are allowed values for the third correlation? [duplicate]

For a random number experiment, I want to simulate from a trivariate Normal distribution with correlation matrix. ...
1
vote
1answer
55 views

Calculating Cosine Similarity with Matrix Decomposition (matrix multiplication with normalized columns)

To calculate the column cosine similarity of $\mathbf{R} \in \mathbb{R}^{m \times n}$, $\mathbf{R}$ is normalized by Norm2 of their columns, then the cosine similarity is calculated as ...
0
votes
0answers
31 views

How to get Linear discriminant analysis projection matrix in Matlab

I didn't find anything about projection matrix in fitcdiscr help page. Is it possible to extract projection matrix from a model? If not, do you know some matlab LDA implementation that outputs this ...
0
votes
0answers
27 views

Is it possible (and if yes how) to retain a sparse matrix after normalization?

I was wondering whether given a sparse matrix it is possible to retain a sparse matrix after removing certain global effects. Let me demonstrate the following: Given a data set $X$ with dimensions $m ...
2
votes
2answers
56 views

Solve $X^TX b = a$ for $b$ using $XX^T$ for a short and wide matrix $X$

I have a matrix $X$ of dimensions $n \times p$ and a fixed $p$-dimensional vector $a$, with $p \gg n$. How can I efficiently solve a problem of the following form? $$X^TXb = a$$ Perhaps using the $n ...
0
votes
0answers
19 views

Getting VAR parameters from research paper

Many econometrics papers provide the parameters used in their VAR model. If I notate my VAR model as $$z_{t+1} = c + B z_{t} + \Sigma \epsilon_{t+1}$$ where $\epsilon \sim N(0, I)$, then I need to ...
1
vote
0answers
19 views

Shrinkage of Schafer and Strimmer

As we all know that the sample covariance matrix $(S = (s_{ij}))$ is postive definite when the number of observations is smaller than the number of samples, that is n>p. But, the sample covariance ...
1
vote
0answers
17 views

Is it possible to derive Leverage figures without a Hat Matrix?

I ran into an impasse while attempting to write code for Cook's Distance: when a regression model reaches only a moderate size, I can't derive a Hat Matrix through my normal matrix math routines ...
1
vote
1answer
58 views

A maxdet problem with three variables - maximum likelihood estimation in Mathlab/Mata/R

Problem Given $n$ known vectors $y_j = (y_1, y_2, ..., y_{K_j})', \forall j=1,n$ and a constant $K$; determine three vectors ($\alpha, \beta, \theta^2)$ that maximise: $$ \text{T} (\alpha, \beta, ...
3
votes
1answer
218 views

Model Matrices for Mixed Effects Models

In the lmer function within lme4 in R there is a call for constructing a model matrix of ...
0
votes
0answers
11 views

Analysis of PValues Matrix

in clinical environment I'm setting up a model to identify fraudolent behaviours from specific sites, calculating for each site some aspects that could lead to a p-value (this approach is based on a ...
1
vote
0answers
11 views

Distribution of correlation coefficient in compound symmetric covariance model

Suppose $X_i \overset{iid}{\sim} N_m(0, \Sigma)$ for $i=1, \dots, n$ for the case that $$\Sigma = \sigma^2((1-\rho)I_m + \rho \mathcal{1}\mathcal{1}^\prime),$$ where $\mathcal{1} \in \mathbb{R}^m$ is ...
0
votes
1answer
23 views

Clustering matrices with “2d interpretation”

I am not sure if I can formulate this such that it is clear. :) I have around 700 80x80 matrices, where each matrix shows some weather event (a matrix has continuous entries from 0 to 60). Now I ...
4
votes
1answer
32 views

How to find factor that is making matrix singular

I have a 300+ column data.frame, and no matter how I break it up I get this error every time: ...
1
vote
1answer
38 views

What is this theorem used in proving canonical correlation model?

I am watching a video about canonical correlation that proves the canonical correlation model. In the prof's proof of the canonical correlation model, a theorem from matrix analysis is used. That is ...
1
vote
2answers
39 views

reasons for a non-invertible matrix

I am trying to factor analyze a matrix in R and I keep getting errors that lead me to believe my matrix is non-invertible. What are the reasons a matrix could be non-invertible? The only one I found ...
4
votes
1answer
43 views

Does rank of observation matrix tell anything useful when applying machine learning?

Suppose I have an observation matrix of size $N \times M$ where $N$ is the number of samples and $M$ is the number of variables. If the rank of the observation matrix is $R<M$, does it tell ...
3
votes
1answer
49 views

Generating a matrix for regression from long form data

I'm having some difficulty interpreting how to correctly create a matrix input for regression from a long form data source. I have table containing marketing data where each row represents a view of ...
0
votes
0answers
15 views

commonalities and differences among groups in a matrix (based on features)

I have a (rather sparse) matrix with 7 columns and 66 rows. Each column represents a user group, each row represents a feature, and each cell represents a weighted value (see note below). I'd like to ...
0
votes
0answers
34 views

Correlation operations in R

I need som help using correlation matrix in R. Let's assume I have simulated 10 year of forecasted rental income for a property. The simulation parametar is accumulated income growth and my R code ...
3
votes
1answer
131 views

What is the intuitive (geometric?) meaning of minimizing the log determinant of a matrix?

I have come across optimization problems which seek a positive semi-definite matrix $A$ that minimizes some possibly non-convex function that includes the addition of $1/(\text{dimension}) * \log \det ...
0
votes
0answers
71 views

Calculating correlation between two different gene set of different size using R

From my previous post, I got the idea of generating correlation matrix and subsequent filtering the values for an input matrix. A problem arise is :I have a list of 8000 genes and would like to ...
1
vote
0answers
19 views

Looking for a principled/systematic procedure for discarding features

I have a collection of $M_i \times N$ matrices $X_i$ whose rows are (raw) feature vectors (from a common $N$-dimensional feature space). MATLAB reports that most of the covariance matrices $C_i := ...
1
vote
1answer
84 views

Matrix Multiplication to find Correlation Matrix

In this book on matrix factorizations: http://lnfm1.sai.msu.ru/~rastor/Books/Skillicorn-Understanding_complex_datasets_data_mining_with_matrix_decompositions.pdf The author states the following ...
1
vote
0answers
12 views

Finding possible interval for correlation coefficient under a certain correlation structure

I want to determine the interval for possible values of the correlation coefficient under certain correlation structures (eg. Compound Symmetry, Autoregressive and Banded Toeplitz). I can do it by ...
1
vote
1answer
34 views

Rewriting RegressionSS

I am having troubles in deriving the RHS of this formula: $$RSS= \hat{\beta}^{T}Z^{T}y-n\bar{y}^{2}$$ where $Z$ is the design matrix I am given ${y}^{T}y$ (what exactly does ${y}^{T}y$ stand for and ...
0
votes
0answers
25 views

Least Angle Regression - How do I extract the coefficients from the prediction vector?

I am looking into Least Angle Regression. At each step of the algorithm, we update the prediction vector, $\hat u$. I want to extract from this the coefficient vector $\hat \beta$. I know the ...
0
votes
1answer
34 views

Ordinal Logistic Regression Predicted Probabilities

I'm looking for a way to produce a matrix of predicted probabilities on data that went through SPSS's logistic regression test. I only use two ordinal variables with a range of 1-4 and 1-10 ...
0
votes
0answers
44 views

Posterior Conditional on Beta in Bayesian Linear Regression with Factor Analysis

This should be an easy question if you're familiar with the terms involved. I am performing some research using a hierarchical Bayesian regression model that incorporates factor analysis into the Beta ...
0
votes
0answers
40 views

How to figure out whether PCA can be performed on a data set or not?

I do have idea on the way PCA works but I do not know how to figure out whether a high dimensional data set is suited for PCA compression. I googled for some algorithms but could find any. Are there ...
15
votes
4answers
216 views

Textbooks on Matrix Calculus?

See this question on Math SE. Short story: I read The Elements of Statistical Learning and got frustrated when I was trying to verify some of the results, e.g., given $$\text{RSS}(\beta) = ...
3
votes
1answer
44 views

Is a covariance matrix composed of matrixes derived from separate samples guaranteed to be positive definitive?

I have two samples that partially overlap on the variables they describe. The samples are taken from more or less the same population, and show similar values on the overlapping variables. Based on ...
0
votes
1answer
41 views

Markov Process-Variance of time until jump

A Markov process on E = {1, 2} is constructed according to holding time parameters λ1 = 2 and λ2 = 4; the defining Markov chain has transition probabilities p11 = p12 = 0.5 and p21 = 1. How do I ...
0
votes
1answer
29 views

I need a matrix in order to calculate g-inverse of it [closed]

I want to calculate g-inverse of a matrix, which has 4 rows and not a square matrix and has no inverse. Please help me find such a sound (good) matrix. I only need a matrix. You can suggest a book or ...
1
vote
0answers
49 views

Correlation between two quadratic forms of Gaussian random vectors

I want to approximately calculate the correlation between two quadratic forms of two Gaussian random vecotrs (of course these are in fact non-Gaussian densities). Does anyone know the derivation of ...
1
vote
0answers
30 views

Prove that minimum of the matrix norm is achieved on certain parameters

Given matrix $A\in R^{n\times m}$ prove that minimum of the $||A-xy^T||$, $||B||=tr(B^TB)$, is achieved when $x$ is an eigenvector of $AA^T$, corresponding to its greatest eigenvalue, and $y$ is an ...
1
vote
0answers
23 views

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} ...
1
vote
0answers
29 views

Matrices F and c for F test?

In $\mathcal{F}$ test, the hypotheses involve multiple regression coefficients with the $\mathcal{F}_{0}$ test statistic: \begin{equation} z_{j} = \beta_{0} + \beta_{1} x_{1} + \beta_{2} x_{2} + ... + ...
1
vote
0answers
26 views

List of statistical test where correlation matrix is an important part

I wondered where all the correlation matrix forms an integral part of statistical test. Standalone also it is important (though there is no correlation-matrix tag for posts on this forum). It is ...
2
votes
0answers
46 views

Why the principal components correspond to the eigenvalues? [duplicate]

Suppose ${\bf{X}} = ({X_1},{X_2},\ldots,{X_n})$ are the original components (also random variables) and ${{\bf{w}}_j} = ({\omega _1},{\omega _2},\ldots,{\omega _n})$ are loadings for the $j$th ...
1
vote
0answers
41 views

Validating Neural Network

I have a relatively large set of labelled data which I am using to verify how well-trained a neural-network I wrote is. The network uses a competitive learning technique. It has N output neurons, each ...