![In [171: import numpy as np import matplotlib.pyplot as plt x = np . array( [820,775,680,655,750,802,798,689,775] ) def mov_a](https://media.cheggcdn.com/media%2F22e%2F22ecc5b9-2727-4797-a9ce-22c437732e0c%2FphpvQZD6Z.png)
find the best k for moving average forecasting algorithm
In [171: import numpy as np import matplotlib.pyplot as plt x = np . array( [820,775,680,655,750,802,798,689,775] ) def mov_avg(x,k): np . full(x.size , np.nan) cast for t in range(k,x.size): forecastit] np.mean (x(t-k:t]) return forecast def weightedhttp://1ocalhost:8888/notebooks/Untitled. ipynb2kernel_name-pyt hon 3 #-mov-avg ( x , w ) : rnel name kw.size forecast np.full (x.size, np.nan) for t in range(k,x.size): forecast[t] np . sum ( x [ t-k:t)”w) = return forecast def exp
PayPal Gateway not configured
PayPal Gateway not configured