Question
Write a function forecast_data with the following parameters. X: the list of n numbers that contains our data. X0,X1,...,Xn1X0,X1,...,Xn1 alpha: the tuning paramerter for the
Write a function forecast_data with the following parameters. X: the list of n numbers that contains our data. X0,X1,...,Xn1X0,X1,...,Xn1 alpha: the tuning paramerter for the baseline response. beta: the tuning paramerter for the trend. gamma: the tuning parameter for the seasonality. L: the length of the seasonality. The function should return a tuple of (S, T, C, forecasts). S - list of baseline values for the model. StSt for all t=0,1,...,n1t=0,1,...,n1 T - list of trend values for the model. TtTt for all t=0,1,...,n1t=0,1,...,n1 C - list of seasonality factors for the model. CtCt for all t=0,1,...,n1t=0,1,...,n1 forecasts - the list of forecasted values from time period L to n. HINT 1: When calling triple_es for time periods t=0,1,...,L1t=0,1,...,L1, you can use 1 as the prev_c parameter. For tLtL you must use CtLCtL. HINT 2: S, T, and C should have the same length as X. HINT 3: forecasts will have the length of n - L. This is because the forecast function needs values for Ct+1LCt+1L, so it cannot create forecasts for the first L time periods.
def forecast_data(X, alpha, beta, gamma, L): assert type(X) == list assert_numbers(X) assert_numbers([alpha, beta, gamma]) assert type(L) == int # # YOUR CODE HERE #
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started