pdf_fun function

Function factory for density functions