I need to do some forecasting with a not so popular algorithm (GMDH) which essentially is polynomial neural network. I've found the algorithm and the example works fine my problem occurs when I try to apply my own dataset.
so my data is a daily dataset which consist of 7 values (5,5,6,7,8,9,18)and to convert this to time series I use the following code :
ts = ts(test, start=decimal_date(as.Date("2020-01-01")), frequency=365.25)
with test being the df holding the data.
Now when I pass the ts object into the algorithm I get an error which states incorrect number of dimensions upon investigating essentially comparing my dataset to the example data which is the data(cancer)
I see that the ts object I converted differs from the ts object the sample is using as seen below :
I guess my question is how do I convert my initial data to the same format which I'm assuming the algorithm would accept or even perhaps convert or modify my ts object to the same format as the data(cancer). In case you can't see the difference my data seem to be in rows while the cancer data values are all in a column accros..sorry I'm new to r and my terminology isn't great.
The information you requested concerning the data:
dput(head(cancer))
structure(c(100.4, 105.1, 109.4, 110.5, 116.9, 118.2), .Tsp = c(1930,
1935, 1), class = "ts")
dput(head(ts))
structure(c(5L, 5L, 6L, 7L, 8L, 9L), .Dim = c(6L, 1L), .Dimnames = list(
NULL, "V1"), .Tsp = c(2020, 2020.01368925394, 365.25), class = "ts"
I hope this is what you requested again apologies