The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [cholesky]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
19
votes
5answers
25k views

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 ...
16
votes
3answers
6k views

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\...
15
votes
5answers
2k views

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 ...
13
votes
1answer
326 views

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 ...
7
votes
2answers
5k views

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 ...
6
votes
1answer
2k views

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 ( ...
6
votes
1answer
4k views

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 ...
5
votes
2answers
960 views

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: ...
5
votes
1answer
348 views

Generate random variables with predefined correlation structure AND fixing some values

I need to generate 4 random variables that show a predefined correlation structure Sigma AND where certain values of Vars 1-4 are fixed. As an illustrative example, consider the variables: ...
5
votes
1answer
650 views

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

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 ...
4
votes
2answers
2k views

Why use upper triangular Cholesky?

Software packages seem to prefer to work with the upper triangular part of the Cholesky factorization, see for example cholupdate. Why is this? It seems that it is ...
4
votes
1answer
504 views

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 ...
4
votes
1answer
692 views

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$ ...
4
votes
1answer
867 views

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 ...
4
votes
1answer
122 views

How do you translate a density from Cholesky factor to density of the matrix?

Suppose $L$ is a random $p\times p$ lower triangular matrix, with known density, $f(L)$. To compute the density of $C=L L^{\top}$, one needs to use the change of density formula. This is a little bit ...
3
votes
1answer
412 views

Why is computing ridge regression with a Cholesky decomposition much quicker than using SVD?

By my understanding, for a matrix with n samples and p features: Ridge regression using Cholesky decomposition takes O(p^3) time Ridge regression using SVD takes O(p^3) time Computing SVD when only ...
3
votes
1answer
1k views

How to calculate the standard deviation for a Gaussian Process?

I am quite new to Gaussian processes. A Gaussian Process looks like the following: Where the dark blue line denotes the mean, and the filled-area denotes the mean+std and mean-std respectively. ...
3
votes
1answer
973 views

How to do SVD instead of Cholesky for $L^{T}L$?

The Cholesky decomposition can be used to obtain $A$ from $X = AA^{T}$ (lower triangular version) but also $B$ from $Y = B^{T}B$ (upper triangular version). The SVD can be used to do something similar ...
3
votes
1answer
334 views

Compute covariance matrix via rank-1 update to $M^\top M$

I have a large, sparse matrix $M\in\mathbb{R}^{n\times p}$. Centering $M$ to compute the covariance matrix $\Sigma$ would, in general, destroy the "zeros aren't stored" property of sparse matrices. ...
3
votes
2answers
257 views

Direct parametrization of Cholesky decomposition of spatial covariance matrix

In spatial data analysis, a simple way to model the covariance stucture between spatial observations is via a covariance function like $cov(y_i,y_j) = C e^{-rD_{ij}}$, based on some (euclidean) ...
3
votes
0answers
104 views

Mahalanobis distance for highly multivariate random variable

I have to compute the Mahalanobis distance for a $10^6$ dimensional multivariate random variable. What is the best (and fastest) way to do this? I am currently taking cholesky decomposition of the ...
3
votes
0answers
188 views

effects of Box-Cox transformation on covariance

I'm trying to synthesize data for a Monte Carlo simulation. I have a stationary random process $x$ and can readily estimate its covariance matrix $S$. I know that if the increments of the process are ...
2
votes
2answers
2k views

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 ...
2
votes
1answer
1k views

Gaussian Process: Using partitions of a Cholesky decomposition solution for conditional deduction

If I define a GP over observed values, $y$, of a sensor reading over time, $t$, as (for simplicity assuming discrete time series e.g lets say readings after every 5 mins) : $y=f(t)+\epsilon$ where $...
2
votes
1answer
245 views

Residual sum of squares of block matrix with sparse elements

Based on the question Residual Sum of squares in Weighted regression, a fast way to solve for $$(\mathbf{y-X\hat{\boldsymbol\beta}})^{'}\mathbf{C}^{-1}(\mathbf{y-X\hat{\boldsymbol\beta}})$$ is to ...
2
votes
0answers
28 views

Geometric interpretation of Cholesky Decomposition

I understand that a square matrix, say $A$, can be thought of as a linear transformation within the same space. I could be as simple as basis change or some other transformation. In this way of ...
2
votes
0answers
91 views

Eigenvalue decomposition of a covariance matrix using a fast Cholesky decomposition

Let $\mathbf{C}$ be a $n \times n$ covariance matrix and assume that the LDL' Cholesky decomposition can be obtained efficiently. Can we take advantage of this to obtain a fast eigenvalue ...
2
votes
0answers
58 views

Cholesky Decomposition (in lmer from lme4)

When I retrace the implementation of lmer from lme4 I faced a question regarding cholesky decomposition used for solving penalized least squares. Consider a Cholesky decomposition of a matrix M with ...
2
votes
0answers
381 views

IRF function with several exogenous covarites (SVAR model)

How to interpret an IRF function with exogenous covariates. Example: Small open economy which I control for foreign variables (Endogenous variables cannot influence the exogenous variables). The ...
2
votes
0answers
364 views

Constructing a positive definite covariance matrix

I am trying to construct a covariance matrix between a set of demands $t \in T$. The only information I have of the demands are the mean and the standard deviation. I intend to apply Cholesky ...
2
votes
0answers
126 views

Uncorrelating correlated $\chi^2$ distribution

This question is related to my previous question in here So I was trying to simulate correlated $\chi^2(1)$ random variables given the desired co-variance matrix. However, it seems like the only ...
1
vote
1answer
396 views

Simulate Moderated Regression with Cholesky Decomposition

I want to simulate a moderated regression where the slopes are standardized (i.e., can be interpreted like correlations), and I am wondering how to do this with Cholesky decomposition. My initial ...
1
vote
1answer
665 views

R: difference between Generalized Least Square and the Standard Least Squares with Cholesky

According to Wikipedia (source of all truth and knowledge...), http://en.wikipedia.org/wiki/Generalized_least_squares#Properties a weighted least square regression is equivalent to a standard least ...
1
vote
1answer
393 views

Relation of kernels and Cholesky decomposition

I am trying to find an intuition on why we require that kernels are positive semi definite and I have found this: We are given a dataset $X$ of size $n \times d$ where $n$ is the number of samples ...
1
vote
1answer
364 views

Choleski decomposition of the covariance matrix

I have a process described as $r_t = \mu + \Sigma_t^{1/2}z_t$ where $z_t$ is let's say a standard normal distribution residual and $\Sigma_t$ is the conditional covariance matrix. The $t$ stands ...
1
vote
0answers
17 views

Difference between sparse cholesky and cholesky decomposition

I am confused as to the difference between the regular cholesky decomposition and the sparse cholesky decomposition (i.e. that which is performed by LAPACK's CHOLMOD...
1
vote
0answers
25 views

Cholesky decomposition in control variates method (Monte Carlo variance reduction technique)

The control variates method, used as a variance reduction technique for Monte Carlo simulations, takes one new variable $t$, correlated to the random variable $m$ to estimate (using the same notations ...
1
vote
0answers
55 views

A transformation from uniform random variable to Gaussian mixture

I am attempting to describe a prior_transform for a multivariate Gaussian mixture in order to estimate the evidence integral of that prior convolved with another likelihood distribution. This is ...
1
vote
0answers
367 views

Can someone provide a non-technical explanation of how Cholesky Covariance priors work?

I am looking for an explanation of how Cholesky Covariance priors work in the context of mixed effects regression. In particular, when they are applied to the correlations among random effects. What ...
1
vote
0answers
81 views

Simulating data with local correlations

Im writing my thesis, which a monte-carlo study aimed at generating datasets for comparing the performance of various regression models (Neural networks amongst others). And since neural networks can ...
1
vote
0answers
134 views

numpy.linalg.cholesky of correlation matrix with small eigenvalue gives error [duplicate]

When doing a Cholesky decomposition of a covariance matrix with very low eigenvalues, numpy.linalg.cholesky and ...
1
vote
0answers
74 views

Sequential conditional simulation to avoid using a large covariance matrix

I would like to generate $S$ samples of a $T \cdot M$ dimensional vector, where $T$ is the number of time steps and $M$ the number of locations, i.e., the vector is a stack with $T$ values for ...
1
vote
0answers
174 views

Decomposition of a random vector into uncorrelated components

I have a set of random vectors $Y_i$ and their correlation matrix $C_{i,j}$. Each vector can be thought of as a sum of two uncorrelated vectors $Y_i=A_iX+B_iY$, where $X,Y$ are the same vectors for ...
1
vote
0answers
653 views

Trying to use Cholesky decomposition of covariance matrix to sample error ellipsoid

I'm trying to construct an error ellipsoid from a covariance matrix (which exists for a 3D point) and then sample consistent xyz points in this region. In a previous question when I asked about this (...
0
votes
1answer
554 views

How to find unknown correlation coefficients in a correlation matrix from known correlation coefficients? [duplicate]

I have a correlation matrix A given below. Here A should be a positive-definite matrix so that we can perform Cholesky decomposition of A. ...
0
votes
1answer
43 views

How to show that $X = LY$ where $Y\sim N(0,I)$?

Let $X\sim MVN(0,\Sigma)$ denote a random vector having the multivariate normal distribution with mean $0$ and covariance matrix $\Sigma$. Suppose we want to sample from $X\sim MVN(0,\Sigma)$. ...
0
votes
2answers
250 views

Estimating correlation matrix using numeric likelihood maximization

I'm performing maximum likelihood estimation on jointly distributed data and I'm having some issues estimating the correlation terms. I am using an approach based on the Cholesky decomposition, but I ...
0
votes
1answer
569 views

Are VAR and VEC models theoretically neutral?

I have recently been introduced to Vector Autoregression (VAR) and Vector Error Correction (VEC) models in an Econometrics class, where both approaches were presented as a neutral way to test economic ...
0
votes
1answer
619 views

Cholesky Shock - Interpretation of logs in IRF Models

I came across a few articles here and there that conclude: When the data (say variables X, Y) for an impulse response function are on log level, the y-axis depicts the % response of Y to a 1% shock ...
0
votes
0answers
25 views

Showing a useful result for Wisharts and Multivariate Beta random matrices

Let $\mathbf{A} \sim \text{Wishart}_m\left(k_a,\mathbf{V} \right)$ and $\mathbf{B} \sim \text{Wishart}_m\left(k_b,\mathbf{V} \right)$ be two full rank Wishart random matrices. Define $$ \mathbf{S} = \...