hi Author,thank you for sharing your code!
i tried to apply this code using my own dataset and it was multivariate,but the fitted curve not behave well but loss curve seems good,look like

and the fitted curve

can i have your suggestions?thanks a lot !