I have a data in which monthly cash balances are given per account number. However, the number of records or number of months for which data is given for each account id is different say some have 12 months data , some have 24 months data and so on. I have to put all the data in ARIMA model and predict balance for next month. I have notice that ARIMA model doesnt work for uneven periods or it produces unusual results.
Account id Month Balance A Jan2019 $100 A Feb2019 $120 A Mar2019 $135 B Mar2019 $20 C Feb2019 $1700 C Mar2019 $1400
I tried to add the rows for missing months and put zero values against the balances by amending the dataset in excel resulting in all accounts having same number of records and months.
I want to do this manual step through R code. I believe this should be some loop / IF function or Rbind/cbind something but am not that fluent on the code. Please help!
Aucun commentaire:
Enregistrer un commentaire