This repository contains the R implementation for the paper "Stochastic ordering tools for continuous-time Markov chains and applications to reaction network models" by Daniele Cappelletti, Giulio Cuniberti, and Paola Siri (https://doi.org/10.48550/arXiv.2604.00756). The code consists of two main scripts:
Examples.RFunctions.R
After sourcing Functions.R, you can use its two main functions:
checks whether Theorem 4.1 can be applied to the reaction network defined by the first two arguments, given the preorder specified by the third argument.
finds all rate inequalities and associated preorders on species counts that enable the application of Theorem 4.1 to the reaction network defined by the arguments.
-
source.complexesandproduct.complexesaren × dmatrices, where:n= number of reactionsd= number of species- row
rinsource.complexesrepresents the source complex of reactionr - row
rinproduct.complexesrepresents the product complex of the same reactionr - column
srefers to the same speciess, in both matrices
-
preorder.matrixis the matrix M from Theorem 4.1
checkOrdering(source.complexes, product.complexes, preorder.matrix) returns a list of 4 objects.
result: 1 or 0, depending on whether the hypotheses of Theorem 4.1 are satisfied or notrate.inequalities: vector whose componentrcorresponds to reactionrand can take the values"="if the rate constants are equal in X and Y"+"if the rate constant of Y is greater or equal than that of X"-"if the rate constant of Y is less or equal than that of X"?"if the rate constants of X and Y are not compared
species.inequalities: vector whose componentscorresponds to speciessand can take the values"="if the molecular counts are equal in X and Y"+"if the molecular count of Y is greater or equal than that of X"-"if the molecular count of Y is less or equal than that of X"?"if the molecular counts of X and Y are not compared
first.fail: whenresult = 0, it specifies the first hypothesis of Theorem 4.1 that failed to be satisfied
findOrderings(source.complexes, product.complexes) returns a list of 2 objects.
preorders: list of all pairs ofrate.inequalitiesandspecies.inequalities(as described for the previous function) that define an admissible preordering structure and for which at least one component ofspecies.inequalitiesis either"+"or"-"equivalences: list of all pairs ofrate.inequalitiesandspecies.inequalities(as described for the previous function) that define the remaining admissible preordering (equivalence) structures
All examples presented in the paper can be reproduced by running Examples.R. This file also serves as a practical guide for using the functions described above.