get-substitution function

Helper functions used only internally to estimate substitution model