EM                    package:RM2                    R Documentation

_U_n_c_o_n_s_t_r_a_i_n _t_h_e _d_e_m_a_n_d _u_s_i_n_g _t_h_e _E_x_p_e_c_t_a_t_i_o_n-_M_a_x_i_m_i_z_a_t_i_o_n _a_l_g_o_r_i_t_h_m

_D_e_s_c_r_i_p_t_i_o_n:

     'EM' unconstrains demand data in quantity-based revenue
     management.

_U_s_a_g_e:

     EM(demand = demand, eps = 0.005)

_A_r_g_u_m_e_n_t_s:

  demand: demand vector with constrained and unconstrained entries. A 0
          in the name of an entry means that the corresponding demand
          is unconstrained. Conversely, a 1 in the name of an entry
          suggests that the corresponding demand is constrained. 

     eps: small number used as the stopping criterion. The default
          value is 0.005.

_D_e_t_a_i_l_s:

     'EM' unconstrains demand data in quantity-based revenue
     management. The observed demand entries, some of which are
     constrained because the product class was closed, are assumed to
     be realizations from an underlying normal distribution with mean
     mu and standard deviation sigma. The objective is to find the
     parameters mu and sigma of this underlying demand distribution.

_V_a_l_u_e:

   param: parameters of demand distribution 

   niter: number of iterations 

  demand: unconstrained demand vector

 history: parameter convergence history 

_A_u_t_h_o_r(_s):

     Tudor Bodea tudor.bodea@ihg.com 
       Dev Koushik dev.koushik@ihg.com 
      Mark Ferguson mark.ferguson@mgt.gatech.edu

_R_e_f_e_r_e_n_c_e_s:

     Talluri, K. T. and Van Ryzin, G. (2004) _The Theory and Practice
     of Revenue Management_. New York, NY: Springer Science + Business
     Media, Inc. (Pages 474-477).

_E_x_a_m_p_l_e_s:

     # SPECIFY THE SEED
     set.seed(333)
     # SPECIFY REAL PARAMETERS OF THE DEMAND DISTRIBUTION
     rmean <- 20
     rsd <- 4
     nrn <- 20
     # GENERATE REAL DEMAND
     rdemand <- round(rnorm(nrn, rmean, rsd))
     # GENERATE BOOKING LIMITS
     bl <- round(rnorm(nrn, rmean, rsd))
     # GENERATE OBSERVED DEMAND
     demand <- rdemand * (rdemand <= bl) + bl * (rdemand > bl)
     # IDENTIFIED PERIODS WITH CONSTRAINED DEMAND: 1 - CONSTRAINED DEMAND
     names(demand) <- as.character(as.numeric(rdemand>bl))
     demand
     # UNTRUNCATE DEMAND
     EM(demand)
     EM(demand, eps=0.005)
     EM(demand, eps=0.00005)
     # MODIFY DEMAND VECTOR - NO CONSTRAINED INSTANCES ARE OBSERVED
     names(demand) <- rep(0, length(demand))
     # ATTEMPT TO UNTRUNCATE THE DEMAND
     EM(demand, eps=0.005)

