rapidsai / cuml

cuML - RAPIDS Machine Learning Library
https://docs.rapids.ai/api/cuml/stable/
Apache License 2.0
4.24k stars 532 forks source link

[BUG] S-ARIMA: NaN log-likelihood when sar.L1 is very close to 1 #2154

Open Nyrio opened 4 years ago

Nyrio commented 4 years ago

Describe the bug With seasonal models, when sar.L1 is very close to 1, the log-likelihood can take the value nan.

Details:

Steps/Code to reproduce bug

from cuml.tsa.arima import ARIMA

import numpy as np
import pandas as pd

def load_dataset(name, max_batch=4):
    import os
    pdf = pd.read_csv(os.path.join("python", "cuml", "test", "ts_datasets",
                                   "%s.csv" % name))
    return pdf[pdf.columns[1:]].astype(np.float64).to_numpy()

y = load_dataset("guest_nights_by_region")

model = ARIMA(y, (0,1,0), (1,1,0,12), 0)
model.unpack(np.tile([0.9999997, 1.0], model.batch_size))

print(np.count_nonzero(np.isnan(model.llf)))

This outputs 12 (the batch size), meaning that the log-likelihood is nan accross the batch.

Note: the bug can be assigned to me

github-actions[bot] commented 3 years ago

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

github-actions[bot] commented 3 years ago

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.