Add Functional models

Need special treatment for user defined function
foxetal2014 Examples 1 and 2