Skip to content

v1.1.0 Release to CRAN 2024 November 4

Latest
Compare
Choose a tag to compare
@matthewwolak matthewwolak released this 07 Nov 16:18

NEW

  • added c++ (and R) code to use the Takahashi et al. algorithm for obtaining the partial inverse of the coefficient matrix

    • This switch means almost a 20-fold speedup (for c++ routines) when using analytical first derivatives (i.e., need to calculate "trace" terms)
    • Speedup comes from only calculating elements of inverse matrix (C-inverse) following the non-zero pattern determined for the Cholesky decomposition of the C matrix.
    • follows the SuiteSparse Matlab_Tools sparseinv by Tim Davis, but sparseinv works on LDL' factorization of C whereas I changed this to work on LL' factorization of C.
      • Takahashi, Fagan, & Chin. 1973. Formation of a sparse bus impedance matrix and its application to short circuit study. 8th PICA Conference Proceedings, Minneapolis, MN.
    • gremlinR() now uses far less RAM per iteration of the model (previously was forming the entire C-inverse)
  • add finite difference algorithm to obtain first derivatives of likelihood function

    • introduced a parameter (h) inside gremlinControl() to set the "difference" or amount to alter parameters to calculate change in log-likelihood.
  • created a REML function inside the c++ code (reml) to calculate log-likelihood

    • moved log-likelihood calculation out of main program and reduced amount of repeated code.
    • also facilitated finite difference functions (which are just repeated log-likelihood evaluations)

Minor Changes

  • Removed error() in c++

    • now issues with matrix singularities etc. do not stop code without returning model so far
    • should now be possible to use update() to get "through" trouble spots
    • also allows for user interruptions to c++ code from terminal
  • Changed default parameterization so lambda transformation is no longer the default

  • Changed default convergence check criteria (cctol)

    • Models using previous values tended to only improve precision of estimates well beyond what was meaningful.