Error with futr_exog_list in NHITS
# neural-forecast
I'm attempting to modify the code here ( to also use a known covariate. To test, I modified the example code to have a random feature:
Copy code
Y_df['noise'] = np.random.rand(len(Y_df))

# split to train and test
Y_train_df = Y_df[:-horizon]
Y_test_df = Y_df[-horizon:]
# Instantiate HINT
# BaseNetwork + Distribution + Reconciliation
nhits = NHITS(h=horizon,
           loss=GMM(n_components=10, level=level),

model = HINT(h=horizon, S=S_df.values,
         model=nhits,  reconciliation='BottomUp')

# Fit and Predict
nf = NeuralForecast(models=[model], freq='MS'), val_size=12)
Y_hat_df = nf.predict(Y_test_df)
When I run this code, I receive the error: "RuntimeError: normal expects all elements of std >= 0.0" Has this been seen before? Not sure exactly what's going on. Everything works fine when I comment out futr_exog_list
Hey @BWBarger, We added a numerical protection for the case when series dataset are completely zeros, some reconciliation methods make divisions using standard deviations. Here is an example where we add some minor noise to make the algorithms work:
Copy code
# MinT along other methods require a positive definite covariance matrix
# for the residuals, when dealing with 0s as residuals the methods break
# data is augmented with minimal normal noise to avoid this error.
Y_df['y'] = Y_df['y'] + np.random.normal(loc=0.0, scale=0.01, size=len(Y_df))
I still see this error with the small noise added to y. As I mentioned before, I only see this error when I try to include futr_exog_list
Wanted to check if this has been looked into further. I'm experiencing this issue in the google colab environment ( as well, so I don't think it has anything to do with my personal setup. Are there any full samples of NHITS working with future exogenous features? Do we need to create an issue in github?