-1

I am doing harmonic prediction in R and prediction did not work. I have data for 186 months and I want to do prediction for next three months. My code for harmonic regression:

t<-1:186
t2<-t*t
sez<-lm(exhangeRate~t+t2+cost+sint)

And then I am doing prediction:

timeR<-(1:189)*0.05
predik<-predict(sez, list(t=timeR, t2=timeR*timeR))
predik

But it is not working, predik has still 186 values, not 189. Any help?

Cherry
  • 1
  • 1
  • What are `cost` and `sint`? What is `exchangeRate`? Without sample data that reproduces the problem, we can only guess at what your variables are and why you are getting unexpected results I'm afraid. – Allan Cameron May 30 '22 at 14:41
  • I think [this](https://stackoverflow.com/questions/9028662/predict-maybe-im-not-understanding-it) should answer your question. I can't mark this as a duplicate as I've already voted to close. – Limey May 30 '22 at 17:44

0 Answers0