Questions tagged [cholesky]

The tag has no usage guidance.

16
votes
5answers
24k 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
312 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
1k 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
890 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
337 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
587 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
488 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
618 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
818 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
117 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
332 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
857 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
304 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
250 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
89 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
183 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
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. ...
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
229 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
40 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
37 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
364 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
348 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
123 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
354 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
645 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
331 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
304 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
44 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
276 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
83 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
165 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
637 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
529 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
2answers
175 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
542 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
551 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
40 views

Getting sets of random correlated variables

For the training of a machine learning model I need to add additional features, and these features are correlated. I need to run the model N times adding these features with random values, and for ...
0
votes
0answers
30 views

Add Noise to a Dataset

I've generated a dataset of 100 elements from a 3-variate Gaussian distribution with parameters $\mu = 0$ and $\Sigma = \begin{pmatrix}1 & \rho_1 & \rho_2 \\ \rho_1 & 1 & \rho_1 \\ \...
0
votes
0answers
26 views

Variables estimation with Cholesky decomposition

I have the covariance matrix between log-returns of n variables. I suppose the distribution of the log-returns is normal for all the variables with average=0 but standard deviation in general $\neq$ 1....
0
votes
0answers
16 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 ...
0
votes
1answer
21 views

Conserve correlation with simulate data

let me explain you the process, I have random variables in a matrix $X_1$: $260\times3$. I have my correlation matrix $\rho_1$: $3\times3$ from my matrix $X_1$. Now I use a Cholesky decomposition ...