topic >>Why did you change your in Intel® Fortran Compiler
https://community.intel.com/t5/Intel-Fortran-Compiler/IMSL-Conversions/m-p/1167649#M144924
<P>>><EM>Why did you change your picture, although this one is quite nice.</EM></P><P>Perhaps to show Schrödinger's cat, when out of the box, is alive and well.</P><P>Jim Dempsey</P>Fri, 30 Nov 2018 15:20:39 GMTjimdempseyatthecove2018-11-30T15:20:39ZIMSL Conversions
https://community.intel.com/t5/Intel-Fortran-Compiler/IMSL-Conversions/m-p/1167646#M144921
<P>I stumbled across an interesting program, which is however based on ISML Routines. </P>
<PRE class="brush:fortran; class-name:dark;">
XTR = Transpose(X)
XTX = matmul(XTR, X)
! XTXinv = .i.XTX
! Bhat = XTXinv.xt.X.x.Y
! call make_vec(Bhat,Q,P,betaHat)
!! SS = (Y-(X.x.Bhat)).tx.(Y-(X.x.Bhat))
! SSinv = .i.SS</PRE>
<P>The .I. inverts the matrix XTX, but I was wondering what is the best method in MKL to do these steps. XTX is in the test case a 2 by 2 matrix with only non-zero diagonal. I tried getri but kept getting access code violations.</P>
<P>Thanks</P>
<P>John</P>
<P> </P>Fri, 30 Nov 2018 03:22:42 GMThttps://community.intel.com/t5/Intel-Fortran-Compiler/IMSL-Conversions/m-p/1167646#M144921JohnNichols2018-11-30T03:22:42ZDoes your question relate to
https://community.intel.com/t5/Intel-Fortran-Compiler/IMSL-Conversions/m-p/1167647#M144922
<P>Does your question relate to fitting a model to data and then obtaining the covariance matrix? There is a simple solution in Lapack/MKL for doing the first part: <STRONG>?gels()</STRONG>. Regarding following up with calculating the covariance matrix using Lapack routines in MKL, see http://icl.cs.utk.edu/lapack-forum/archives/lapack/msg00367.html . </P><P>An alternative is to use the VSL routines in MKL, which were never part of Lapack; see https://software.intel.com/en-us/articles/overview-of-summary-statistics-ss-in-intel-mkl-v103 .</P><P>The MKL forum ( https://software.intel.com/en-us/forums/intel-math-kernel-library ) is a better place for questions of this type. </P>Fri, 30 Nov 2018 12:38:00 GMThttps://community.intel.com/t5/Intel-Fortran-Compiler/IMSL-Conversions/m-p/1167647#M144922mecej42018-11-30T12:38:00ZDear mecej4:
https://community.intel.com/t5/Intel-Fortran-Compiler/IMSL-Conversions/m-p/1167648#M144923
<P>Dear mecej4:</P><P>Thank you for your response. I forgot about the forum -- old age is catching up. </P><P>Yes I am trying to work out what the heck the algorithm is in the code, it is very messy code and the ISML routines make it an interesting challenge. </P><P>Why did you change your picture, although this one is quite nice.</P><P>John</P>Fri, 30 Nov 2018 15:01:36 GMThttps://community.intel.com/t5/Intel-Fortran-Compiler/IMSL-Conversions/m-p/1167648#M144923JohnNichols2018-11-30T15:01:36Z>>Why did you change your
https://community.intel.com/t5/Intel-Fortran-Compiler/IMSL-Conversions/m-p/1167649#M144924
<P>>><EM>Why did you change your picture, although this one is quite nice.</EM></P><P>Perhaps to show Schrödinger's cat, when out of the box, is alive and well.</P><P>Jim Dempsey</P>Fri, 30 Nov 2018 15:20:39 GMThttps://community.intel.com/t5/Intel-Fortran-Compiler/IMSL-Conversions/m-p/1167649#M144924jimdempseyatthecove2018-11-30T15:20:39ZIn general, a majority of the
https://community.intel.com/t5/Intel-Fortran-Compiler/IMSL-Conversions/m-p/1167650#M144925
<P>In general, a majority of the numerical routines for linear algebra in IMSL can be replaced by the LAPACK routines in MKL. In your code, the recommended procedure would be to use the routines under orthogonal decomposition. See "LAPACK Least Squares and Eigenvalue Problem Routines" and "Orthogonal Factorizations: LAPACK Computational Routines".</P><P>The first step is to decompose X = QR where Q is orthogonal and R is upper triangular. Use DGEQRF or DGEQPF. Then X'X = (QR)'(QR) = R'Q'QR = R'R since Q'Q = I. Then inv(R'R) = inv(R)*inv(R'). Hence, the problem reduces to finding the inverse of an upper triangular matrix, which is simply a matter of backsubstitution and for which MKL routines are available. Almost all of the steps involving transpose of X, formation of (X'X) and its inverse or the hat matrix are thus eliminated. In certain cases, the inverse of R need not be formed either.</P><P>The solution philosophy above follows the general rule of numerical analysis: the inverse of a matrix is rarely, if ever, needed in explicit form for practical applications.</P>Fri, 30 Nov 2018 20:29:55 GMThttps://community.intel.com/t5/Intel-Fortran-Compiler/IMSL-Conversions/m-p/1167650#M144925avinashs2018-11-30T20:29:55Z