Obsidian | Level 7

## Weighting a series with another series

I'm looking for an acceptable way for adjusting a series using another series.  In my case I have paired values of actual and forecast data from which I can calculate MAPE.  I would like to adjust MAPE to take fluctuations in underlying values, let's say fluctuations in actual, into account, such that periods of high values for actual would have more influence than periods of low values for actual over MAPE.  I keep thinking that there's some standard procedure for this, but can't seem to find anything online.

Any suggestions will be appreciated.  Thank you.  -- George

3 REPLIES 3
SAS Super FREQ

## Re: Weighting a series with another series

You might be thinking of the method of reweighted residuals. This is a technique that was a precursor to modern robust regression techniques, and it serves as the basis for the robust technique known as M Estimation.

You might want to use PROC ROBUISTREG to carry out this method. You can use the OUTPUT statement with WEIGHT=MyWtVar to create an output data set that contains the final weights.

Obsidian | Level 7

## Re: Weighting a series with another series

Rick_SAS: This sounds very promising; I'll try it today and get back to you. Thank you very much!
Obsidian | Level 7

## Re: Weighting a series with another series

I ran the following code

proc robustreg data = sasdb.back2 method = m;
model perc_var = actual ;
weight = actual ;
output out=sasdb.myweightds weight = myweight ;
run ;

From the output the blue line is the actual; the brown the forecast from which the MAPE is calculated. Here we see the percent error in red (scale on right side).  Given the differences in exposure levels I wanted to dampen the MAPE in area where the actual was far from the average.  We see the weights in green (scale on right side).  What I want is a weight to adjust the red line by actual such that in the earlier periods of adjusted MAPE would appear above the red line;  in the final periods I would expect the adjusted line to appear below the red line.

It's obvious that I'm not familiar with how to use the weights, even if I'm getting what I need.  Please tell me that I'm on the right track and indicate where I would look for an explanation of how to use what I have here (or tell me that I'm doing not right).

Thanks for your help.  -- George

Discussion stats
• 3 replies
• 730 views
• 0 likes
• 2 in conversation