Skip to main content
LAPACK, mathjax, code formatting
Source Link
Anton Menshov
  • 8.7k
  • 7
  • 41
  • 94

Short Answer: LAPACK's dsytf2 dsytf2 (for symmetric full) and dsptrf dsptrf (for symmetric packed, which is the same layout that Bierman uses in its Kalman filter subroutines) actually computes UDU' decompostion$UDU'$ decomposition as it is used in estimation community.

Longer Version:

Cholesky decomposition routines of lapackLAPACK (such as dpotrfdpotrf) computescompute only LL'$LL'$ and U'U $U'U$ (not UU'$UU'$). It is interesting to note until version 3.6 of lapackLAPACK, the documentation of lapackLAPACK wrongfully stated that when the UPLO='U'UPLO='U', the Cholesky decomposition returns UU'$UU'$ decomposition. But, that wrong statement was fixed after 3.6. Currently (as of 3.12), lapack'sLAPACK Cholesky decomposition routines can only return U'U$U'U$ or LL'$LL'$ decomposition based on UPLOUPLO argument (same as matlab's chol function).

On the other hand, LDL$LDL$ decomposition routines of lapackLAPACK actually computes UDU'compute $UDU'$ when the UPLOUPLO is set to 'U''U' in the arguments. This fact is also explicitly stated in these functionsfunctions' documentation.

However, one should also note that lapackLAPACK LDL routines executesexecute much more complicated algorithms as the LDL routines are designed for indefinite matrices. In estimation algorithms, we generally set the row/col to zero when the pivot is zero and continue to decompose the rest of the matrix as it is known that the input (the covariance matrix) is not indefinite. However, LDL routines of lapackLAPACK, performsperform row/col rooks in such cases. Therefore, one may need to use syconvsyconv routine to convert permutated LDL'$LDL'$/UDU'$UDU'$ matrices into unpermutated forms.

Short Answer: LAPACK's dsytf2 (for symmetric full) and dsptrf (for symmetric packed, which is the same layout that Bierman uses in its Kalman filter subroutines) actually computes UDU' decompostion as it is used in estimation community.

Longer Version:

Cholesky decomposition routines of lapack (such as dpotrf) computes only LL' and U'U (not UU'). It is interesting to note until version 3.6 of lapack, the documentation of lapack wrongfully stated that when the UPLO='U', the Cholesky decomposition returns UU' decomposition. But, that wrong statement was fixed after 3.6. Currently (as of 3.12), lapack's Cholesky decomposition routines can only return U'U or LL' decomposition based on UPLO argument (same as matlab's chol function).

On the other hand, LDL decomposition routines of lapack actually computes UDU' when the UPLO is set to 'U' in the arguments. This fact is also explicitly stated in these functions documentation.

However, one should also note that lapack LDL routines executes much more complicated algorithms as the LDL routines are designed for indefinite matrices. In estimation algorithms, we generally set the row/col to zero when the pivot is zero and continue to decompose the rest of the matrix as it is known that the input (the covariance matrix) is not indefinite. However, LDL routines of lapack, performs row/col rooks in such cases. Therefore, one may need to use syconv routine to convert permutated LDL'/UDU' matrices into unpermutated forms.

Short Answer: LAPACK's dsytf2 (for symmetric full) and dsptrf (for symmetric packed, which is the same layout that Bierman uses in its Kalman filter subroutines) actually computes $UDU'$ decomposition as it is used in estimation community.

Longer Version:

Cholesky decomposition routines of LAPACK (such as dpotrf) compute only $LL'$ and $U'U$ (not $UU'$). It is interesting to note until version 3.6 of LAPACK, the documentation of LAPACK wrongfully stated that when the UPLO='U', the Cholesky decomposition returns $UU'$ decomposition. But, that wrong statement was fixed after 3.6. Currently (as of 3.12), LAPACK Cholesky decomposition routines can only return $U'U$ or $LL'$ decomposition based on UPLO argument (same as matlab's chol function).

On the other hand, $LDL$ decomposition routines of LAPACK actually compute $UDU'$ when the UPLO is set to 'U' in the arguments. This fact is also explicitly stated in these functions' documentation.

However, one should also note that LAPACK LDL routines execute much more complicated algorithms as the LDL routines are designed for indefinite matrices. In estimation algorithms, we generally set the row/col to zero when the pivot is zero and continue to decompose the rest of the matrix as it is known that the input (the covariance matrix) is not indefinite. However, LDL routines of LAPACK, perform row/col rooks in such cases. Therefore, one may need to use syconv routine to convert permutated $LDL'$/$UDU'$ matrices into unpermutated forms.

improve formatting
Source Link
tantuni
  • 156
  • 2

Short Answer: LAPACK's dsytf2 (for full symmetric full) and dsptrf (for symmetric packed, which is the same layout that Bierman uses in its Kalman filter subroutines) actually computes UDU' decompostion as it is used in estimation community.

Longer Version:

Cholesky decomposition routines of lapack (such as dpotrf) computes only LL' and U'U (not UU'). It is interesting to note until version 3.6 of lapack, the documentation of lapack wrongfully stated that when the UPLO='U', the Cholesky decomposition returns UU' decomposition. But, that wrong statement was fixed after 3.6. Currently (as of 3.12), lapack's Cholesky decomposition routines can only return U'U or LL' decomposition based on UPLO argument (same as matlab's chol function).

On the other hand, LDL decomposition routines of lapack actually computes UDU' when the UPLO is set to 'U' while callingin the functionarguments. This fact is also explicitly stated in these functions documentation.

However, one should also note that lapack LDL routines executes much more complicated algorithms as the LDL routines are designed for indefinite matrices. In estimation algorithms, we generally set the row/colscol to zero when the pivot is zero and continue theto decompose the rest of the matricesmatrix as it is known that the input (the covariance matricesmatrix) is not indefinite. However, LDL routines of lapack, performs row/col rooks in such cases. Therefore, one may need to use syconv routine to convert permutated LDL'/UDU' matrices into unpermutated forms.

Short Answer: LAPACK's dsytf2 (for full symmetric) and dsptrf (for packed) actually computes UDU' decompostion as it is used in estimation community.

Longer Version:

Cholesky decomposition routines of lapack (such as dpotrf) computes only LL' and U'U. It is interesting to note until version 3.6 of lapack, the documentation of lapack wrongfully stated that when the UPLO='U', the Cholesky decomposition returns UU' decomposition. But, that wrong statement was fixed after 3.6. Currently (as of 3.12), lapack's Cholesky decomposition routines can only return U'U or LL' decomposition based on UPLO argument (same as matlab's chol function).

On the other hand, LDL decomposition routines of lapack actually computes UDU' when the UPLO is set to 'U' while calling the function. This fact is also explicitly stated in these functions documentation.

However, one should also note that lapack LDL routines executes much more complicated algorithms as the LDL routines are designed for indefinite matrices. In estimation algorithms, we generally set the row/cols to zero when the pivot is zero and continue the decompose the rest of the matrices as it is known that the input (the covariance matrices) is not indefinite. However, LDL routines of lapack, performs row/col rooks in such cases. Therefore, one may need to use syconv routine to convert permutated LDL'/UDU' matrices into unpermutated forms.

Short Answer: LAPACK's dsytf2 (for symmetric full) and dsptrf (for symmetric packed, which is the same layout that Bierman uses in its Kalman filter subroutines) actually computes UDU' decompostion as it is used in estimation community.

Longer Version:

Cholesky decomposition routines of lapack (such as dpotrf) computes only LL' and U'U (not UU'). It is interesting to note until version 3.6 of lapack, the documentation of lapack wrongfully stated that when the UPLO='U', the Cholesky decomposition returns UU' decomposition. But, that wrong statement was fixed after 3.6. Currently (as of 3.12), lapack's Cholesky decomposition routines can only return U'U or LL' decomposition based on UPLO argument (same as matlab's chol function).

On the other hand, LDL decomposition routines of lapack actually computes UDU' when the UPLO is set to 'U' in the arguments. This fact is also explicitly stated in these functions documentation.

However, one should also note that lapack LDL routines executes much more complicated algorithms as the LDL routines are designed for indefinite matrices. In estimation algorithms, we generally set the row/col to zero when the pivot is zero and continue to decompose the rest of the matrix as it is known that the input (the covariance matrix) is not indefinite. However, LDL routines of lapack, performs row/col rooks in such cases. Therefore, one may need to use syconv routine to convert permutated LDL'/UDU' matrices into unpermutated forms.

Source Link
tantuni
  • 156
  • 2

Short Answer: LAPACK's dsytf2 (for full symmetric) and dsptrf (for packed) actually computes UDU' decompostion as it is used in estimation community.

Longer Version:

Cholesky decomposition routines of lapack (such as dpotrf) computes only LL' and U'U. It is interesting to note until version 3.6 of lapack, the documentation of lapack wrongfully stated that when the UPLO='U', the Cholesky decomposition returns UU' decomposition. But, that wrong statement was fixed after 3.6. Currently (as of 3.12), lapack's Cholesky decomposition routines can only return U'U or LL' decomposition based on UPLO argument (same as matlab's chol function).

On the other hand, LDL decomposition routines of lapack actually computes UDU' when the UPLO is set to 'U' while calling the function. This fact is also explicitly stated in these functions documentation.

However, one should also note that lapack LDL routines executes much more complicated algorithms as the LDL routines are designed for indefinite matrices. In estimation algorithms, we generally set the row/cols to zero when the pivot is zero and continue the decompose the rest of the matrices as it is known that the input (the covariance matrices) is not indefinite. However, LDL routines of lapack, performs row/col rooks in such cases. Therefore, one may need to use syconv routine to convert permutated LDL'/UDU' matrices into unpermutated forms.