Title: | Revenue Management Modeling |
---|---|
Description: | The RMM fits Revenue Management Models using the RDE(Robust Demand Estimation) method introduced in the paper by <doi:10.2139/ssrn.3598259>, one of the customer choice-based Revenue Management Model. Furthermore, it is possible to select a multinomial model as well as a conditional logit model as a model of RDE. |
Authors: | Chul Kim [aut, cre], Sanghoon Cho [aut], Jongho Im [aut] |
Maintainer: | Chul Kim <[email protected]> |
License: | GPL (>= 2.0) |
Version: | 0.1.0 |
Built: | 2025-02-12 05:26:17 UTC |
Source: | https://github.com/cran/RMM |
Collects a choice set exposed to individuals. Internal function that users should not call directly.
Choice_Set(df, num_id, uniq_id, idvar)
Choice_Set(df, num_id, uniq_id, idvar)
df |
a long format tibble. |
num_id |
Number of unique Booking_IDs appearing in transaction data |
uniq_id |
Unique Booking_ID in transaction data. |
idvar |
Variable name representing customer id (Booking_ID). |
Returns a list containing the values required for calculation within the rmm_reshape
function.
'Hotel_Long
', a 'Long format', is a preprocessing data of the publicly available 'Hotel 1' data introduced in Bodea et al. (2009).
Hotel_Long
Hotel_Long
'Hotel_Long
': A data frame with 8,318 rows and 11 variables:
ID associated with a booking. Begins at one for each hotel property.
Indicator variable equal to one if the product identified by product ID is purchased, zero otherwise.
Code describing the room type associated with the product ID.
The average nightly rate the customer pays in USD (e.g., $199.99). Note that the average nightly rate will not match the rate of any available product rates if an upsell occurs at time of check-in, if the customer requests a specific discount rate at time of check-in, etc.
Number of adults and children associated with the booking.
Status in rewards program (0—not a member, 1—basic, 2—elevated, 3—premium).
Membership status of a VIP rewards program member (0—not a VIP, 1—basic VIP, 2—premium VIP member).
Date the booking was created (e.g., 20070303 = March 3, 2007).
Check-in date (e.g., 20070307 = March 7, 2007).
Check-out date (e.g., 20070310 = March 10, 2007).
Length of stay/number of nights (e.g., three).
'Hotel 1' data contains information on the available alternatives, i.e.,
choice sets and the associated prices at the time of each customer’s booking decision.
We preprocessed 'Hotel 1' data and provide it in two types of
data format, 'Hotel_Long
' and 'Hotel_Wide
'.
The following are the preprocessing of 'Hotel 1' data.
1. Customers' booking transactions that had only one room type available in their choice set were removed as our methods require at least two different products in each choice set.
2. Duplicate records was removed.
3. Choice sets with less than 30 observations, representing rare case were removed.
'Hotel_Wide
', a 'Wide format', is a preprocessing data of the publicly available 'Hotel 1' data introduced in Bodea et al. (2009).
Hotel_Wide
Hotel_Wide
'Hotel_Wide
': A data frame with 1,100 rows and 22 variables:
ID associated with a booking. Begins at one for each hotel property.
Number of adults and children associated with the booking.
Status in rewards program (0—not a member, 1—basic, 2—elevated, 3—premium).
Membership status of a VIP rewards program member (0—not a VIP, 1—basic VIP, 2—premium VIP member).
Date the booking was created (e.g., 20070303 = March 3, 2007).
Check-in date (e.g., 20070307 = March 7, 2007).
Check-out date (e.g., 20070310 = March 10, 2007).
Length of stay/number of nights (e.g., three).
Code describing the room type associated with the product ID.
Unique number of products associated with room type.
Choice set exposed to individual
Unique number of choice sets associated with Exposed_Choice_Set
The average nightly rate the customer pays in USD (e.g., $199.99). Note that the average nightly rate will not match the rate of any available product rates if an upsell occurs at time of check-in, if the customer requests a specific discount rate at time of check-in, etc.
'Hotel 1' data contains information on the available alternatives, i.e.,
choice sets and the associated prices at the time of each customer’s booking decision.
We preprocessed 'Hotel 1' data and provide it in two types of
data format, 'Hotel_Long
' and 'Hotel_Wide
'.
The following are the preprocessing of 'Hotel 1' data.
1. Customers' booking transactions that had only one room type available in their choice set were removed as our methods require at least two different products in each choice set.
2. Duplicate records was removed.
3. Choice sets with less than 30 observations, representing rare case were removed.
Predicted values based on RMM object
## S3 method for class 'rmm' predict(object, newdata, Rem_Choice_Set, Choice_Set_Code, fixed = TRUE, ...)
## S3 method for class 'rmm' predict(object, newdata, Rem_Choice_Set, Choice_Set_Code, fixed = TRUE, ...)
object |
Object of class inheriting from " |
newdata |
A data frame in which to look for variables with which to predict. |
Rem_Choice_Set |
List of choice sets remaining in the data. |
Choice_Set_Code |
Specifies the choice set of |
fixed |
If fixed=TRUE, the alternative with the highest prediction probability is determined as decision. Otherwise (fixed=FALSE), one of the alternatives is determined in proportion to the predictive probability. |
... |
further arguments passed to or from other methods. |
preict.rmm
produces a list of predictions, which contains decisions and probabilities.
data(Hotel_Long) # Before using the rmm function, the user must first use the rmm_shape function. rst_reshape <- rmm_reshape(data=Hotel_Long, idvar="Booking_ID", alts="Room_Type", asv="Price", resp="Purchase", min_obs=30) # Fitting a model rst_rmm <- rmm(rst_reshape, prop=0.7, model="cl") # Predictions Rem_Choice_Set <- rst_reshape$Rem_Choice_Set newdata1 <- data.frame(Price_1=c(232, 122, 524), Price_3=c(152, 531, 221), Price_4=c(163, 743, 192), Price_5=c(132, 535, 325), Price_7=c(136, 276, 673), Price_8=c(387, 153, 454), Price_9=c(262, 163, 326), Price_10=c(421, 573, 472)) predict(rst_rmm, newdata=newdata1, Rem_Choice_Set=Rem_Choice_Set, Choice_Set_Code=3, fixed=TRUE) newdata2 <- data.frame(Price_1=c(521, 321, 101, 234, 743), Price_5=c(677, 412, 98, 321, 382), Price_8=c(232, 384, 330, 590, 280)) predict(rst_rmm, newdata=newdata2, Rem_Choice_Set=Rem_Choice_Set, Choice_Set_Code=7, fixed=FALSE)
data(Hotel_Long) # Before using the rmm function, the user must first use the rmm_shape function. rst_reshape <- rmm_reshape(data=Hotel_Long, idvar="Booking_ID", alts="Room_Type", asv="Price", resp="Purchase", min_obs=30) # Fitting a model rst_rmm <- rmm(rst_reshape, prop=0.7, model="cl") # Predictions Rem_Choice_Set <- rst_reshape$Rem_Choice_Set newdata1 <- data.frame(Price_1=c(232, 122, 524), Price_3=c(152, 531, 221), Price_4=c(163, 743, 192), Price_5=c(132, 535, 325), Price_7=c(136, 276, 673), Price_8=c(387, 153, 454), Price_9=c(262, 163, 326), Price_10=c(421, 573, 472)) predict(rst_rmm, newdata=newdata1, Rem_Choice_Set=Rem_Choice_Set, Choice_Set_Code=3, fixed=TRUE) newdata2 <- data.frame(Price_1=c(521, 321, 101, 234, 743), Price_5=c(677, 412, 98, 321, 382), Price_8=c(232, 384, 330, 590, 280)) predict(rst_rmm, newdata=newdata2, Rem_Choice_Set=Rem_Choice_Set, Choice_Set_Code=7, fixed=FALSE)
rmm
is used to fit Revenue Management Models. Users can specify
cl (conditional logit model) and ml (multinomial logit model) as RMM model.
rmm(rmm_data, prop = 0.7, model = "cl")
rmm(rmm_data, prop = 0.7, model = "cl")
rmm_data |
an object of class "rmm_data", a output of |
prop |
numeric, user assumed market share. |
model |
character, specify fitting method ("cl" or "ml"). "cl" (default) refers to the Conditional Logit Model, and "ml" refers to the Multinomial Logit Model. |
rmm
returns an object of class inheriting from "rmm".
rmm
fits the model with the RDE method introduced in doi:10.2139/ssrn.3598259.
data(Hotel_Long) # Before using the rmm function, the user must first use the rmm_shape function. rst_reshape <- rmm_reshape(data=Hotel_Long, idvar="Booking_ID", alts="Room_Type", asv="Price", resp="Purchase", min_obs=30) # Fitting a model rst_rmm <- rmm(rst_reshape, prop=0.7, model="cl") print(rst_rmm)
data(Hotel_Long) # Before using the rmm function, the user must first use the rmm_shape function. rst_reshape <- rmm_reshape(data=Hotel_Long, idvar="Booking_ID", alts="Room_Type", asv="Price", resp="Purchase", min_obs=30) # Fitting a model rst_rmm <- rmm(rst_reshape, prop=0.7, model="cl") print(rst_rmm)
This function reshapes a 'Long-Format' data (with the repeated measurements in separate rows) to 'Wide-Format' data (with repeated measurements in separate columns of the same row).
The reshaped 'wide-format' data is an S3 class called 'rmm_data' and contains information for fitting the model with the rmm
function.
Users who want to use the rmm function must first use the rmm_reshape function. The rmm
function receives only S3 class 'rmm_data' as input.
rmm_reshape(data, idvar, resp, alts, asv, min_obs)
rmm_reshape(data, idvar, resp, alts, asv, min_obs)
data |
data frame, a 'Long-Format' transaction data. |
idvar |
character, variable name representing each individual's id in the transaction data. |
resp |
character, variable name representing result of a individual choice. |
alts |
character vector, variable names representing a alternatives. |
asv |
character vector, variable names representing a alternative specific variables. |
min_obs |
numeric, specify the minimum observation for each choice set in the transaction data. |
The 'Wide-Format' data and various information required for the rmm
function.
rmm
for estimating parameters.
data(Hotel_Long) rst_reshape <- rmm_reshape(data=Hotel_Long, idvar="Booking_ID", resp="Purchase", alts="Room_Type", asv="Price", min_obs=30) class(rst_reshape) # "rmm_data" ls(rst_reshape) # "Alts_Code_Desc" "ASV" "asv_name" "data_wide" # "Rem_Choice_Set" "Removed_Choice_Set" rst_reshape$data_wide # reshaped data
data(Hotel_Long) rst_reshape <- rmm_reshape(data=Hotel_Long, idvar="Booking_ID", resp="Purchase", alts="Room_Type", asv="Price", min_obs=30) class(rst_reshape) # "rmm_data" ls(rst_reshape) # "Alts_Code_Desc" "ASV" "asv_name" "data_wide" # "Rem_Choice_Set" "Removed_Choice_Set" rst_reshape$data_wide # reshaped data