Forecasting analysis in R

Hi!

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",
"15-08-2021","15-08-2021","15-08-2021","16-08-2021","16-08-2021","16-08-2021","16-08-2021",
"16-08-2021","17-08-2021","17-08-2021","17-08-2021","17-08-2021","17-08-2021","18-08-2021",
"18-08-2021","18-08-2021","18-08-2021","18-08-2021","19-08-2021","19-08-2021","19-08-2021",
"19-08-2021","19-08-2021","20-08-2021","20-08-2021","20-08-2021","20-08-2021","20-08-2021",
"21-08-2021","21-08-2021","21-08-2021","21-08-2021","21-08-2021","22-08-2021","22-08-2021",
"22-08-2021","22-08-2021","22-08-2021"),
Room = c("Standard","Master","Luxury","Super","Deluxe","Standard","Master","Luxury","Super","Deluxe",
"Standard","Master","Luxury","Super","Deluxe","Standard","Master","Luxury","Super","Deluxe",
"Standard","Master","Luxury","Super","Deluxe","Standard","Master","Luxury","Super","Deluxe",
"Standard","Master","Luxury","Super","Deluxe","Standard","Master","Luxury","Super","Deluxe",
"Standard","Master","Luxury","Super","Deluxe"),
DR=c(5,8,13,5,3,4,6,18,14,5,9,9,25,25,10,10,9,24,25,12,10,9,24,25,12,5,3,4,6,18,9,7,24,19,11,12,10,9,24,25,28,25,10,10,9),
DR0=c(5,8,13,6,4,4,6,19,14,7,9,7,25,19,12,10,10,30,27,11,12,9,23,25,12,5,3,4,6,18,9,7,24,19,11,12,10,9,24,25,28,25,10,10,9),
DR1=c(5,8,12,6,3,4,6,19,15,8,9,7,27,19,12,10,8,29,23,11,12,9,23,25,12,5,3,4,6,16,9,7,24,19,14,13,10,7,24,24,28,25,10,10,9),
DR2=c(5,8,12,6,3,4,6,18,15,7,9,7,27,23,16,10,8,31,23,12,12,9,24,25,12,5,3,4,6,18,9,5,22,14,11,12,10,9,24,25,28,25,10,13,9),
DR3=c(5,8,12,6,3,4,6,18,16,7,9,7,24,19,11,10,8,31,29,14,10,9,24,25,12,5,5,3,6,18,6,7,24,19,14,13,12,9,22,25,27,24,9,10,9),
DR4=c(5,8,12,4,3,4,6,18,16,7,9,7,24,18,11,10,8,28,25,10,10,9,23,22,13,4,3,4,6,16,9,7,24,15,11,12,10,7,24,23,28,25,10,14,8),
DR5=c(5,8,12,4,3,4,6,18,15,7,9,7,24,18,11,10,8,28,23,10,10,9,24,25,12,5,4,3,4,18,9,5,23,19,13,12,10,9,24,25,28,25,10,10,9),
DR6=c(5,8,12,4,3,4,6,18,14,7,9,7,23,18,11,10,8,28,23,10,10,9,24,24,12,4,3,4,6,18,7,7,24,14,11,13,14,9,22,23,27,25,9,10,8),
DR7=c(5,8,12,4,3,4,6,18,13,7,9,7,23,16,11,10,8,27,23,12,10,7,24,25,13,5,3,4,7,15,9,7,24,19,15,12,10,7,24,25,28,24,10,10,9),
DR8=c(5,8,12,4,3,4,6,18,13,7,9,7,23,15,11,10,8,27,21,14,10,9,24,23,12,5,3,4,6,19,9,7,23,19,11,12,10,9,24,25,28,25,10,10,9),
DR9=c(5,8,12,4,3,4,6,18,13,7,9,7,23,15,10,10,8,27,20,10,10,9,24,25,12,5,3,4,6,18,9,7,24,19,11,12,10,9,24,25,28,24,10,10,9)),
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.