Professional Documents
Culture Documents
Forecasting
Good forecasts capture the genuine patterns and relationships which exist in the historical
data, but do not replicate past events that will not occur again.
- Know if there are random fluctuations in past data that must be ignored
- And genuine pattern that should be modelled and extrapolated
Good forecasting model captures the way in which things are changing
- Forecasts rarely assume that the environment is unchanging
- But the forecast assumes that the way the environment is changing will continue in the
future.
The choice of method depends on what data are available and the predictability of the quantity
to be forecasted.
Forecast – common statistical task in business and should be an integral part of business
decision-making.
- Predicting the future as accurately as possible given data and knowledge of future enevts
that might impact the forcasts.
Planning
- Responses to goals and forecast
- Appropriate actions to match forecast with goals
Prediction interval - 80% PI: each future value is expected to lie in the dark region with a
probability of 80%
- Useful way of displaying the uncertainty in forecast
- In the example, forecasts are expected to be accurate, hence the prediction intervals are
quite narrow.
The variation associated with the thing we are forecasting will shrink as the event approaches.
When we obtain a forecast, we are estimating the middle of the range of possible values the
random variable could take.
A forecast is accompanied by a prediction interval giving a range of values the random variable
could take with relatively a high probability.
Example: a 95% PI contains a range of values the random variable could take at a 95%
probability.
The set of values that this random variable could take given their probabilities is known as the
probability distribution. forecast distribution.
When we talk about forecast, we usually mean the average value of the forecast distribution
“hat”. Soooo forecast of y1 is y1 hat (this is the average of the possible values the random
variable can take)
1. Time plots
- For time series data
- Observations are plotted against the time of observation, with consecutive observations
joined by straight lines.
Antidiabetic drug sales time plot – increasing trend, strong seasonal pattern that increases in
size as the level of the series increases.
when choosing a forecasting method, we will first need to identify the time series patterns in
the data andthen choose a method that is able to capture the patterns properly. .
2. seasonal plots
- similar to time plot but instead of time of observation, the data is plotted against the
individual “seasons” in which the data were observed.
3. Scatterplots
- Useful for exploring relationships of variables in a cross sectional data
- Axes are the different variables
- Helps visualize the relationship between variables.
Non-linear relationship: a change is one entity does not correspond to a constant change in
another. ex. There is much less benefit in improving fuel economy from 30 to 40 mpg than
there was in moving from 20 to 30 mpg.
scatterplot matrices
- If there are multiple predictor variables
Ex. -0.97 corr coeff: the value is negative because one var decrease with the increase of
another.
Autocorrelation
- Measures linear relationship between lagged values of a time series.
- Different coefficients depending on lag length
- Plot is known as correlogram
White noise
- Time series that show no autocorrelation
- Autocorr is close to zero. Not exactly close to zero as there is some random variation.
- If there are one or more large spikes outside the bounds (PI) or more than 5% of spikes are
outside, then the series is probably not white noise.
Box-cox transformation
- Family of transformations that includes log and power tranformations
- Depends on the parameter (lambda)
o Log in box cox is always a natural log (base e)
- A good value og lambda is one that makes the size of the seasonal variation about the
same across the whole series, as that makes the forecast model simpler.
#2 calendar adjustments
- Some variation seen in seasonal data may be due to simple calendar effects (remove the
variation) (eg different numbers numbers of days of the month
- Simple patterns are easier to models – which leads to a more accurate forecast.
#3 population adjustments
- Any data that are affected by population changes can be adjusted to give per capita data.
(number of beds per thousand people)
#4 inflation adjustments
- Data that are affected by the value of money are best adjusted before modelling. (financial
time series)
- Use price index!! (z=price index) then adjusted price = y/z
Scale-dependent errors
- Forecast error is equal to e = actual minus forecast
- Accuracy measures that are based on e are sale dependent and cannot be compared to
other error on different scales.
test data set is used to measure how well the model is likely to forecast on new data. (usually
20% of the sample data)
test data set are also called hold-out set == held out for fitting (out sample data)
RESIDUAL DIAGNOSTICS
Residual – difference between the observed value and its forecast (e=y-y hat)
A good forecasting method will yield residuals with the following properties:
- Residuals are uncorrelated.
- Zero mean (if mean is not zero, it is biased)
- Residuals is not a good way of determining which method to use.
*if may mean other thsn zero eg if mean is = m, just add m on all forecast to fix mean
problem (corr problem is harder to fix)
Large values of Q suggest that the autocorr do not come for the white noise series.
PREDICTION INTERVAL
- Gives an interval within which we expect y to lie with a specified probability.
- If there are parameters: sd is larger in the forecast dist. Than the residual’s.
- If no parameter(eg naïve): same lang
- PI increases as the forecast horizon increases the further ahead we forecast, the more
uncertainty we have.
Chapter 6
TIME DECOMPOSITION
- Decomposing time series data into several components to better understand the time
series and improve forecasts.
- We shall think of the time series as comprising of three components: trend-cycle, seasonal,
and remainder
Moving averages
- First step in classical decomposition is to use moving average method to estimate the trend
cycle
The order of the ma determines the smoothness of the trend cycle estimate. Larger order
means smoother curve.
- Order of ma is usually odd para symmetric.
Ma of ma – weighted ma
- To make even order ma symmetric
- 2x4 ma – 4 ma followed by 2 ma
- when a 2 ma follows a ma of even order – it is called “centered moving average of order 4”
- even – even; odd – odd
- when applied to qtrly data, each qtr of the yr is given equal weight as the first and last
terms apply to the same qtr of the consecutive yrs.
CLASSICAL DECOMPOSITION
additive decomp
- 1. Moving ave
- if m is even number, use 2xma
- if odd: m-ma
- 2. Detrend
- y-t (t is equal to trend cycle)
- 3. Estimate seasonal component: ave of detrended values for that month/qtr seasonal
component is obtained by stringing together all the seasonal indices for each year data.
This gives s hat
- 5. Get remainder by subtracting trend cyclend and seasonal component to actual value of
time series
multi decomp
- same with additive but replace subtraction with division
- remainder: e=y/(t)(s)