Modify your function from the previous exercise to return the sum of squared errors rather than the forecast of the next observation. Then use the optim() function to nd the optimal values of α and ℓ0. Do you get the same values as the ses() function?
Combine your previous two functions to produce a function which both finds the optimal values of α and ℓ0, and produces a forecast of the next observation in the series.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here