1
$\begingroup$

I'm currently doing a time-series forecasting project for the agriculture sector. Basically i'm trying to make predictions about fruit future prices. I've been doing well so far, but now I'm stuck. I would like to have a 14-day forecast horizon with a margin error of 15 cents in our price, but here is where the problems start: I'm shifting prediction column by (-14) from target to see if there is a trend, but the error just explodes to 0.59€ per kilo.

I recently tried to make predictions through LinearRegression and RandomForestRegressor, but the error is almost the same.

Any idea of what I can do to improve my model or where I should look instead of trying just a bunch of random things? (As you may see, I'm not too experienced, just gaining knowledge.).

Below in the image, I get a very clear seasonal pattern (for a two-week period), and I think it would be wise to focus on my approach here.

What do you think?

enter image description here

$\endgroup$

1 Answer 1

1
$\begingroup$

From the information provided, it appears as though you are attempting to forecast a 14-day price horizon using two months worth of data.

Before we consider the model itself, you should consider that even though a seasonal pattern is apparent across those two months - you should have at least a year of data to establish this definitively. For instance, the time series in this case covers January and February. Price fluctuations in the summer months could have a different seasonal pattern, or indeed none at all.

In this regard, no matter what model you are trying to use - whether it be a purely time series forecasting model such as ARIMA, or indeed LinearRegression and RandomForestRegressor as you propose above - the fact that you are only working with two months of data is an issue.

I would recommend 1) obtaining at least one year's worth of data if possible (though the longer, the better) and then 2) running an autocorrelation function on the time series to determine if a seasonal factor is indeed present. If it is not, then attempting to forecast future fruit prices using time series methods is likely to prove unsuccessful - prices for many commodities are subject to a strong degree of stochasticity (randomness) and this may be no exception.

Additionally, you are likely to find that forecasting error will be larger over shorter-term horizons given randomness. For instance, you might find that training the model on 12 months of data and then forecasting one month ahead is subject to less error than attempting to forecast using daily data.

$\endgroup$
1
  • $\begingroup$ Thanks for the answer, Michael. I have more than 5 years of data; in the image I posted, I was just testing the data. Yes, I recently searched for forecasting courses and papers, and I found that autocorrelation is very important to compare the same data on different timelines. I think I'm going to do what you're saying: train the model for 12 months and then forecast one month ahead. I will upload future updates. Thank you again! $\endgroup$
    – L1rola
    Commented Mar 8 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.