A versatile stochastic model of a function of unknown and time varying form