Questions tagged [cholesky-decomposition]

80 questions
22
votes
6 answers

How to use the Cholesky decomposition, or an alternative, for correlated data simulation

I use Cholesky decomposition to simulate correlated random variables given a correlation matrix. The thing is, the result never reproduces the correlation structure as it is given. Here is a small example in Python to illustrate the…
19
votes
3 answers

Cholesky versus eigendecomposition for drawing samples from a multivariate normal distribution

I would like to draw a sample $\mathbf{x} \sim N\left(\mathbf{0}, \mathbf{\Sigma} \right)$. Wikipedia suggests either using a Cholesky or Eigendecomposition, i.e. $ \mathbf{\Sigma} = \mathbf{D}_1\mathbf{D}_1^T $ or $ \mathbf{\Sigma} =…
17
votes
5 answers

Generate normally distributed random numbers with non positive-definite covariance matrix

I estimated the sample covariance matrix $C$ of a sample and get a symmetric matrix. With $C$, I would like to create $n$-variate normal distributed r.n. but therefore I need the Cholesky decomposition of $C$. What should I do if $C$ is not positive…
17
votes
1 answer

Relationship between Cholesky decomposition and matrix inversion?

I've been reviewing Gaussian Processes and, from what I can tell, there's some debate whether the "covariance matrix" (returned by the kernel), which needs to be inverted, should be done so through matrix inversion (expensive and numerically…
13
votes
1 answer

Explain how `eigen` helps inverting a matrix

My question relates to a computation technique exploited in geoR:::.negloglik.GRF or geoR:::solve.geoR. In a linear mixed model setup: $$ Y=X\beta+Zb+e $$ where $\beta$ and $b$ are the fixed and random effects respectively. Also,…
10
votes
2 answers

Can I use the Cholesky-method for generating correlated random variables with given mean?

I want to generate correlated random variables with a given correlation matrix, means, and variances. Does the Cholesky decomposition only work when the initial random variables are iids with the same mean and variance?
kanbhold
  • 755
  • 2
  • 9
  • 18
9
votes
1 answer

Confused about Cholesky and eigen decomposition

I'm looking to generate correlated random variables. I have a symmetric, positive definite matrix. So I know that you can use the Cholesky decomposition, however I keep being told that this only works for Gaussian random variables?! Is that…
7
votes
1 answer

Difference between Cholesky decomposition and log-cholesky Decomposition

Is there any difference between a Cholesky decomposition and a log-cholesky decomposition? If yes, what is the difference? In the paper "An R package for dynamic linear models" by Giovanni Petris ( he refers to the paper "Unconstrained…
6
votes
2 answers

Why can't I simulate variables with negative correlation? How can I fix it?

I would like to simulate data with different correlation matrices, with this method: M = matrix(c(1.0, 0.6, 0.6, 0.6, 0.6, 1.0, -0.2, 0.0, 0.6, -0.2, 1.0, 0.0, 0.6, 0.0, 0.0, 1.0 ), nrow=4,…
user92339
  • 69
  • 2
6
votes
1 answer

Cholesky factorization and forward substitution less accurate than inversion?

I recently asked this question asking for an efficient way to compute the Mahalanobis distance (without calculating the inverse). The accepted solution was to use the Cholesky factorization and forward selection. However, it seems this is less…
5
votes
1 answer

What is the expectation of the Cholesky factor of a Wishart distributed random matrix?

Let a $d-\text{dimensional}$ Wishart random variable with $\nu$ degrees of freedom $\Sigma$ be distributed according to $\mathcal{W}(\Sigma|\Sigma_0, \nu) \propto |\Sigma|^\frac{\nu-d-1}2\exp{(-\frac12\text{tr}\ \Sigma_0^{-1}\Sigma)}$. What is the…
5
votes
2 answers

Why does the resulting matrix from Cholesky decomposition of a covariance matrix when multiplied by its transpose not give back the covariance matrix?

I have a covariance matrix, S, which I use Cholesky decomposition to find A. It is stated that AA'=S, however, I am not recovering S when I do AA'. The example code in R is as follows. S <- matrix(c(1.091385, 1.949606, 1.949606, 4.520746), 2, 2) A…
5
votes
1 answer

For symmetric matrices, is the Cholesky decomposition better than the SVD?

I am inverting a sparse, symmetric, ill-conditioned matrix. I have used both SVD and the LDL decomposition. I find that my results are better with the latter. Why? I understand that LDL decomposition works only on symmetric matrices. But that…
5
votes
1 answer

Mahalanobis distance with LDL decomposition

I've got an extended Kalman filter with innovation covariance defined as $\mathbf{W}=\mathbf{H}\mathbf{P}\mathbf{H}^\textrm{T} + \mathbf{R}$. I want to know the squared Mahalanobis distance $\|z\|^2$ between a (vector) measurement residual…
5
votes
1 answer

Derivative of $x^T A^Ty$ with respect to $\Sigma$ where $A$ is (an upper triangle matrix and ) Cholesky decomposition of $\Sigma$

I would like to evaluate: $$ \frac{ \partial x^T A^Ty}{\partial \Sigma} $$ where $A$ is a Cholesky decomposition of $\Sigma$ and an upper triangle matrix such that $\Sigma = A^T A$, $x$ and $y$ are a vector of length the same as the dimension of the…
1
2 3 4 5 6