# MASE and handling nan-values

I'd like to ask advice on how to correctly compute Mean Absolute Scaled Error (2006, Hyndman, Rob J., and Anne B. Koehler.) over the following example:

y_hat = [1, 2, 3, 4, 0, 0, 0, 0, 9]
y_true = [1, 2, 3, 4, np.nan, 5, 6, 7, 9]


Should I delete NaN and look at two separate non-nan subsets averaging their MASE scores? As far as I get from this discussion and post by Dr. Hyndman MASE represents simple MAE, divided by the mean absolute error of the one-step "naive forecast method" (i.e. some constant to scale MAE error). So I face situation where I have 2 choices:

y_hat = [1, 2, 3, 4, 0, 0, 0, 9]
y_true = [1, 2, 3, 4, 5, 6, 7, 9]


vs

y_hat_1 = [1, 2, 3, 4], y_hat_2 = [0, 0, 0, 9]
y_true_1 = [1, 2, 3, 4], y_true_2 = [5, 6, 7, 9]


where MASE = (MASE(y_hat_1, y_true_1) + MASE(y_hat_2, y_true_2)).mean()

What is correct way to compute MASE here?

• For the MAE in your example, I would simply discard the missing value, along with its forecast. We get an MAE of $$\frac{5+6+7}{8}=2.25$$ as the numerator.
• For the denominator, you would use the in-sample random walk MAE in the original formulation. If you want to use the random walk MAE for the actual forecast sample as a benchmark, I would simply remove the missing value and compute the MAE of a forecast [1,2,3,4,5,6,7] for actuals [2,3,4,5,6,7,9], yielding an MAE of $$\frac{8}{7}\approx 1.14$$.
The MASE would then be $$\frac{2.25}{1.12}\approx 1.97$$.