Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tweak_initial_estimates: matrix handling #656

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

barrettk
Copy link
Collaborator

@barrettk barrettk commented Feb 8, 2024

Handling for matrix-type records. Specifically check for positive-definiteness and include handling for different formats of OMEGA and SIGMA matrices, such as:

  • VARIANCE (default) or STANDARD controls whether diagonals are taken as variance or standard deviation, respectively
  • COVARIANCE (default) or CORRELATION controls whether the off-diagonals are taken as covariance or correlations, respectively
  • CHOLESKY representations
  • handling for SAME blocks and records defined like the one below:
    $OMEGA BLOCK(6)
    0.1
    0.01 0.1
    (0.01)x2 0.1
    (0.01)x3 0.1
    (0.01)x4 0.1
    (0.01)x5 0.1
    • Unclear if this will be supported vs error out at the moment.

closes #640

 - matrix types are still not set up
 - support for diagonal vs block records
 - support for correlation vs covariance on off-diagonals
 - support for standard deviation vs variance on diagonals

TODO:
 - look into supporting SAME blocks and other types
 - unsupported types will need to error out
 - add tests for all new matrix handling features
 - add test that confirms `mod_matrix()` is working as intended thus far
 - add more clarity to matrix helpers. There may be interest in exporting a function similar to `mod_matrix` at some point down the line.
 - as referred to in `nmrec`: 'vpair' subtypes, or when parameter options represent `VALUES(diag,odiag)`
 - 'values' subtypes, or when parameter options contain the form `(0.01)x2 0.1`

This change pulls in a few internal `nmrec` functions (`matrix_is_vpair`, `param_options`, and a modified version of `param_x`). These functions are pretty simple, and I probably would have developed similar ones on my own if I didnt think to grab them from `nmrec`. That being said, I imagine we will want to pull out some of the functionality `get_matrix_opts` is responsible for, and move it to the `nmrec` side.

As of this commit, all concerns mentioned in #640 have been addressed. Additional tests are needed, and the `nmrec`/`bbr` refactor I mentioned above will likely come beforehand.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tweak_initial_estimates: Matrix handling
1 participant