SUBROUTINE CDSVDV ( * * inputs * : V, MA, NP, W, TMP, NCVM, * * outputs * : CVM) * * Module number: * * Module name: * * Keyphrase: * ---------- * To evaluate the covariance matrix of the sigular value decomposition (SVD) fit * * Description: * ------------ * adapted from Numerical Recipes by William Press et. al., p. 519, (1986) * subroutine SVDVAR with double precision * * calculate the covariance matrix by using the matrix V and vector W returned * from a SVD fitting routine (e. g. SVDFIT in p. 518, ibid.) * * FORTRAN name: CDSVDV.FOR * * Keywords of accessed files and tables: * -------------------------------------- * Name I/O Description / Comments * * Subroutines Called: * ------------------- * CDBS: * none * SDAS: * none * Others: * None * * History: * -------- * Version Date Author Description * 1 12-07-88 J.-C. HSU coding *------------------------------------------------------------------------------- * *== input: * --number of fitted parameters INTEGER MA, * --physical dimensions of the matrix V, * --and the vector W : NP, * --physical dimension of the covariance * --matrix CVM : NCVM * --component matrices DOUBLE PRECISION W(NP), V(NP,NP), * --working array : TMP(NP) * *== output: * --output covariance matrix DOUBLE PRECISION CVM(NCVM, NCVM) * *== local: * --array indices INTEGER I, J, K DOUBLE PRECISION SUM *------------------------------------------------------------------------------ * DO 10 I = 1, MA TMP(I) = 0.D0 IF (W(I) .NE. 0.D0) TMP(I) = 1. / (W(I) * W(I)) 10 CONTINUE * DO 40 I = 1, MA DO 30 J = 1, I SUM = 0.D0 DO 20 K = 1, MA SUM = SUM + V(I,K) * V(J,K) * TMP(K) 20 CONTINUE * CVM(I,J) = SUM CVM(J,I) = SUM 30 CONTINUE 40 CONTINUE * RETURN END