For completeness it would perhaps be beneficial to have a function which can free up the memory allocated for the shifts and parameters?