<commit_before>.. _gmrq:

Model Selection (GMRQ)
======================

GMRQ uses a variational principle to help you select model parameters.

.. todo: write<commit_msg>GMRQ Docs<commit_after>.. _gmrq:

Model Selection using GMRQ
======================

The generalized matrix Rayleigh quotient (GMRQ) is a specific application of
the variational principle (adapted from `quantum mechanics <https://en.wikipedia.org/wiki/Variational_method_(quantum_mechanics)>_`)
for Markov state models and a useful tool for model parameter selection.

The variational principle yields a rigorous way of comparing two different
Markov models for the same underlying stochastic process when using different
state decompositions. Even under the assumption that you have access to
infinite sampling, there is still some error associated with approximating the
true continuous eigenfunctions of your modeled process with the indicator
functions, as is the case with Markov state models. If we interpret the
variational theorem as the measure of the quality of this approximation, the
state decomposition that leads to a Markov model with larger leading dynamical
eigenvalues is consequently the better state decomposition. If you wish to see
the full derivation of this quantity, please refer to [#f1]_.

Using this method, we can generate single scalar-valued scores for a proposed
model given a supplied data set. This allows for the use of separate testing
and training data sets to quantify and avoid statistical overfitting.
This method extends these tools, making it possible to score trained models on
new datasets and to perform hyperparameter selection.


References
----------

.. [#f1] McGibbon, <NAME>., and <NAME>. `Variational cross-validation of slow dynamical modes in molecular kinetics <http://dx.doi.org/10.1063/1.4916292>`_ J. Chem. Phys. 142, 124105 (2015).

.. vim: tw=75
{'fraction_non_alphanumeric': 0.07729211087420043, 'fraction_numerical': 0.01652452025586354, 'mean_word_length': 4.939873417721519, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5672848', 'n_tokens_mistral': 492, 'n_tokens_neox': 436, 'n_words': 248}