Forecasting analysis in R


I am working with a database that contains information about the amount of room reservations on a given farm. I will insert the database below (df database)

As you can see, there are room reservation dates, a field that specifies what type of room was rented (Standard, Master, Luxury, Super Luxury and Deluxe) and the DR to DR9 columns that refer to the sales history. I'll explain the variables below:

DR refers to the actual amount of reservations for the specified day. For example, the amount of reservations made on the 16/08 for the Super category was 25. This value is seen in the system one day later. In this case, on 17/08.

DR0 refers to the amount of reservations on the same day the system is checked. For example, if you consider the previous example, the DR0 = 19. This means that on 16/8 when the system was checked early, total reservations for 16/8 was 19 rooms.

DR1 refers to checking the system 1 day before occupancy of the room. Again, if you consider the previous example, DR1=19. Therefore, it means that on the 15/08 when the system was checked, the total booked for 16/08 was 19 rooms.

DR2 refers to checking the system 2 days prior to occupancy of the room. Again, if you consider the previous example, DR2=23. So it means that on the 14/08 when we checked the system, the total booked for 16/08 was 23 rooms.

And so on.

This spreadsheet was generated today, that is, 18/08.

As you can see, there are past dates, that is, they are the days prior to the 18/08. Therefore, they can be used as a history for future prediction. And there are also some future dates, that is, they are the days after the 18/08, that is, 19, 20, 21 and 22/08.

I would like to use some forecasting analysis in R to calculate the total future room reservations for each date 60 days after this generation. Every help is welcome.

I apologize if this question does not fit this forum, if it is not appropriate I delete this question.

df1 <- structure(
list(date = c("14-08-2021","14-08-2021","14-08-2021","14-08-2021","14-08-2021","15-08-2021","15-08-2021",
Room = c("Standard","Master","Luxury","Super","Deluxe","Standard","Master","Luxury","Super","Deluxe",
class = "data.frame", row.names = c(NA, -45L))

I can highly recommend Forecasting: Principles and Practice by Rob Hyndman and George Athanasopoulos, which I use in my forecasting class. It is free online at Forecasting: Principles and Practice (3rd ed)

Forecasting 60 days into the future with patterns estimated from just 9 days of data will probably not be very accurate. With five years of daily data you could reliably estimate seasonal patterns, trends and inertia effects (where the occupancy rate each day affects occupancy the next day, which happens when a known percentage of people stay more than one night).

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.