validate_formula function

Validate the user provided model