I do not really get this check here.
Only true if name is "mu" or "sigma" or both ???
You should maybe put a comment here why you do this and give a better error message for users. This one might be confusing. Tell them that you only accept certain names (and the one that is given as you already do)