OK, now we're going to start using the forecasting tools in power by to attempt to predict future values
and basically we have two line charts here.
They're actually the exact same chart, the exact same data, the exact same period of time, except
the one at the top shows a forecast after the data ends and this chart does not.
But it ends on the exact same time.
So it ends on 12 one and 13 and twelve one twenty thirteen.
The rest of this data here is a forecast.
So what we want to do.
Is to attempt to make the chart the bottom look like the chart on the top by introducing forecasting,
and you can see the first thing that I did to each chart was to add the slider bars.
And you may not be familiar with those, but let's slide and let's bring out visualizations.
If we click on this chart and go to format, we have something called zoom sliders.
And that's what these are.
These are zoom sliders.
And we can turn them off and on on an x axis and y axis basis.
And we can include labels if we want to or not.
And I have the labels turned off, but this allows us to zoom in and out of our chart, which I find
very useful, especially for something like this, where we want to take a look at the forecasted values.
OK, so those are the Zoome sliders now.
In order to get this chart to look like this chart, I need to turn on forecasting now.
One thing to keep in mind with forecasting is that it only works with Time series data.
So your X axis has to contain Time series data.
If your X axis contains something like period one and period to period three or colores or whatever,
we are not going to be able to use forecasting.
All right.
So it's got to be ideally, it's got to be some sort of date value along the X axis, which is what
we have here.
We have daily dates and then sales along the Y axis.
Now, the first thing that we want to do or the next thing we want to do is to come over here to this
analytics tab and click it.
And if we come down to the bottom or close to the bottom, we have something called forecast.
Now, let's take a look at this and we want to add a forecast.
All right.
Now, the first thing it's going to ask us is how many points do we want to use now in this case?
Each point represents a day.
And I think I selected it looks like I selected about 60 days worth of data.
So I want to say 60.
And instead of just seeing points, I know that their days, so I want to say days.
All right, so now we have 60 days that we want to forecast out into the future beyond the last date
that we have data.
I'm going to ignore this ignore or I'm going to ignore the ignore last days.
For now, I'm going to come back to that because this is called hindsight forecasting.
And we're going to come back to that in just a minute.
And then we have a confidence interval.
I'm going to come back to that.
And then we have seasonality now, seasonality.
If we enter a value seasonality, what the power of the visual will do is to attempt to find seasonal
patterns in your data.
Now, Microsoft recommends that at least a quarter of your data gets represented in this seasonality
points.
All right.
So each point is a day.
We've got roughly four years worth of data.
So I'm going to say 300, let's say.
Well, let's just say a whole year.
Three hundred and sixty five.
That's roughly twenty five percent of forty.
Well, it is.
It's one year of four years of data.
So I'm going to enter three hundred and sixty five now actually I think I entered more up here.
So I'm going to adjust this up here when we're done so we get the same, the same look.
So we're going to go back three hundred and sixty five days and power by is going to look for seasonal
patterns in the data.
Now we come to this thing called the confidence interval, and I don't think I did in the first lecture
earn the prior lecture, I don't think I did a very good job in explaining this confidence interval.
And I didn't really want to get into I kind of stumbled around it because I didn't want to get into
a statistical deep dive.
But basically, it means that it's a range in which we're ninety five percent confident that a value
is going to fall in between.
Let's take a look at this and set it.
Ninety five percent.
I'm going to click apply now.
We have.
A forecast here and let's come over here, you know what, I want to change this because I'm pretty
sure I've got this set for.
Yeah, I've got it set for two years, let's do three hundred and sixty five.
OK.
And let's zoom in just a little bit.
Like so.
And like so.
And now both charts are largely the same.
Now, let's come back to this this confidence interval, because it really plays an important role.
And again, very simply, it means now look at this line here.
This is where these are all the data points that have that power buy is projecting sales to be for the
given date.
So let's look at this data right here, 12, 12 December 12th, 2013.
The forecasted value is fifty seven thousand to six.
For the lower bound is forty thousand.
The upper bound is seventy four thousand.
That is the confidence interval.
So what this means is that we're ninety five percent confident that the forecasted value is going to
fall within the range of forty thousand to seventy four thousand dollars in sales.
And this shaded area is actually the confidence interval bound between the upper bound and the lower
bound.
And generally these data points are roughly not always, but roughly in the middle of this confidence
interval.
Now.
What do you suppose will happen if we increase the confidence level from ninety five percent to ninety
nine?
OK, what do you think is going to happen to the range, the upper and lower bound?
Well, since we need to be more confident that the data points are going to fall within that range,
we have to expand the range itself.
The lower bound gets lower, the higher bound gets higher.
Let's set this to ninety nine and watch what happens.
Oh, we just did it up here.
OK, well, let me come down here and let's change this to ninety nine.
Appli.
Now you see this range expand, it has to because we're we're asking the visual to be more confident
and in order to be more confident, the range has to expand.
All right.
I suppose 100 percent, not even an option.
But if we were if we if we could select 100, this entire area would be shaded because we have to be
absolutely certain that sales are going to fall within the maximum sales level and the minimum sales
level.
OK, now what do you think is going to happen if we lower the confidence level from ninety five to,
let's say seventy five?
OK, we're down here in the bottom graph and we've lowered this to seventy five.
I haven't clicked apply yet.
We are less we don't need to be so confident about our confidence interval, about this range.
So naturally it can shrink because we don't need to be so confident and we're going to see that if we
click apply.
You can see it really shrunk up here because we can afford to be less confident, at least in our case
or in this particular case, it really depends on what you're trying to accomplish and your data and
understanding your data.
So naturally, a lower confidence level is going to result in a narrower range of values and a higher
confidence level is going to increase it.
Most people keep this at ninety five percent.
And so we can look at this.
And you could if your boss were to ask you, Mr. Analyst, what do the next 60 days look like?
Where do you anticipate our sales being?
You could generate this report.
And in fact, what you could do is you could export this.
Better yet, let's show it as a table.
Let's show this as a table and you can see when we come down to the bottom of the table.
We have.
OK, so total sales ads on twelve one twenty thirteen.
Now we start forecasting with our confidence, high bound and confidence low bounce.
So you could export this and say, OK, here we go, boss.
The forecasted value for December 2nd is fifty to four to six and then fifty nine.
And we expect it to be within a range of thirty six to sixty eight.
OK, and that's what this forecasting is all about.
Now, before we wrap this up, we have to ask the question, how do we know how good this forecast is?
OK, well, I guess we'll find out once December 2nd comes and December 15th and January 1st and February
1st and so on.
But there's a way that we can take the current data and see how well our model would have done.
And that's called hind casting.
So hind casting and adjusting the confidence intervals are two good ways to evaluate the quality of
the forecast.
Now, when you hindcast, we're basically setting this thing ignore last.
Let's set this to 60 days, the last three months.
It's one way to test whether the model is doing a good job.
If the observed value matches what the actual value or what the observed value, how close it comes
to the predicted value.
Now, more often than not, it's not going to be an exact match, but that doesn't mean that the forecast
is all wrong.
Instead, we need to consider both the amount of variation and the direction of the trend line.
You know, in reality, these predictions, these forecasts are just a matter of probability and estimation.
I mean, that's what's going on under the hood.
So if the predicted value is fairly close to but not exactly the same as the real value, it would be
a good indicator of the quality of the prediction that the forecast is making.
Now, this, to me is really fascinating because we have set the forecast length, the 60 are the ignore
last 60 days and I clicked apply.
Now look what it does.
So the last data point we have is December 1st of what do we have, 20, December 1st of twenty thirteen.
Now we're going back 60 days.
The Green Line obviously is what the data point actually was.
The black dot is what was projected to be.
Now look how closely in some cases like tooltip is kind of a pain.
But look, as we go across here, in other words, it forecasted a drop here and we had a drop, although
the drop was more severe than it predicted a rise.
And we actually had a rise.
It predicted a drop and there was a little bit of a drop that predicted a rise.
But the rise didn't really happen.
But you can see for the most part here that we're not really that far off.
We are kind of far off here.
We had a spike here.
We might want to do some anomaly detection to determine why we had a spike here and perhaps why we had
a spike here and a big fall off here.
But I am fairly impressed with how well this hindcast work.
So for the most part, the forecasted model, not in every case we have a gap here, OK, but we're
pretty close through here.
We're pretty close through here a little bit.
We're off here, but we're pretty close through here and maybe off a little bit here.
So anyway, you can use what's called this hindcast thing to go back in time and see how well your data
points fits the forecasted model.