Complete one of problems 6, 7, and 8 from Chapter 7 in Kelton.
#create reproducability
set.seed(123)
A small free clinic has a single doctor who sees patients between 8:00 a.m. and noon. She spends 6 to 14 minutes (an average of 10) with each patient and so can theoretically see 6 patients per hour or a total of 24 each day. Staff is currently scheduling patient arrivals every 10 minutes, but have found that ptients arrive as much as 15 minutes early or 30 minutes late, thus causing disruption to other patients. Worse, about 10 percent of patients never show up at all causing the doctor’s time to be wasted and wasting an appointment that could have been used by other sick patients. Staff would like to evaluate alternative scheduling strategies such as scheduling 2-3 arrivals every 20 minutes with the main objective of maximizing the doctors utilization (e.g., she would like to really see 24 patients each day if possible). Assume that the doctor will stay until all scheduled patients are seen, but she is very unhappy if she needs to stay past 12:30. Measure system performance mainly on the number of patients actually seen, but also consider the average patient waiting time, and how late the doctor must typically stay to see all scheduled patients.
Of great concern to emergency-department staff are those patients who on arrival are classified Severe but whose condition before receiveing treatment deteriorates to Urgent, requiring immediate attention and stabilization in the Trauma Rooms. If such deterioration is noticed during the examination stage in 10% of the Severe patients, adjust Model 7-2 to reflect this and compare the impact on waiting times and throughput. What assumptions have you made about ‘immediate attention’?
One issue with this approach is that the priority remains at the Severe patient priority level. Possibly by creating a changeover matrix, this issue could be resolved (after registration the patient receives a priority level of 4), but this was not done in my model because I believe the patient would still follow a lower priority since they were not Urgent at the start, and their condition is likely to not be as urgent as an Urgent patient rushing in.
Not surpisingly, more time is added in the Adjusted Model which accounts for the additional time for those patients who started as Severe but moved to Urgent after Registration (seen explicitly when comparing Sink Destroyed Entities for NormalExit and TraumaExit). Similarly, Utilization increases for Trauma and decreases for non-Urgent patient servers.
Emergency department staff work 8.5 hour shifts according to an ‘ideal’ schedule that includes a one hour meal break each shift – preferably around mid-shift. During meal breaks, services in each section are maintained. One of the “Registration” staff memberes will cover for the “Sign In” officer during her meal break. The minimum staffing capacity of each area is given in Table 7.6. When a new shift arrives there is a 30 minute “briefing period” during which the two shifts team together to share information and handover. Develop a defensible staffing schedule and update example Model 7-2. Re-estimate staff utilization. What assumptions do you make concerning “handover time”?
The Rayleigh density [156, (18.76)] is
\(f(x) = \frac{x}{\sigma^2}e^{-x^2/(2\sigma^2)}\) , \(x \geq 0\), \(\sigma > 0\)
Implement a function to generate samples from a Rayleigh() distribution, using antithetic variables. What is the percent reduction in variance of \(\frac{x+x'}{2}\) compared with \(\frac{x_1+x_2}{2}\) for independent \(X_1\), \(X_2\)?
Rizzo (pg 131)
Rayleigh <- function(x, m = 10000, antithetic=TRUE){
u <- runif(m/2)
if (!antithetic)
v <- runif(m/2)
else
v <- 1 - u
#calculate inv-cdf and varianace
invcdf <- x * sqrt(-2 * log(v))
invcdf
}
set.seed(123)
X1 <- Rayleigh(1.95, antithetic=FALSE)
set.seed(321)
X1prime <- Rayleigh(1.95, antithetic=FALSE)
set.seed(123)
X2 <- Rayleigh(1.95, antithetic=TRUE)
result1 <- (var(X1) - var(X2))/var(X1)
result2 <- (var(X1) - var(X1prime))/var(X1)
The variance reduction between \(X_1\) and \(X_2\) is -0.0150735 and the variance between \(X_1\) and \(X^{prime}_1\) is -0.0260725.
rev1 <- var(X1)/2 + var(X2)/2 + cov(X1, X2)
rev2 <- var(X1)/2 + var(X1prime)/2 + cov(X1, X1prime)
result3 <- (rev1 - rev2)/rev1 * 100
The percent reduction between \(\frac{x+x'}{2}\) and \(\frac{x_1+x_2}{2}\) is 0.2408354%.
Find two importance functions \(f_1\) and \(f_2\) that are supported on (1, \(\infty\)) and are ‘close’ to
\(g(x) = \frac{x^2}{\sqrt{2\pi}}e^{-x^2/2}\), \(x > 1\)
Which of your two importance functions should produce the smaller variance in estimating:
\(\int_1^\infty\frac{x^2}{\sqrt{2\pi}}e^{-x^2/2}dx\)
by importance sampling? Explain.
Obtain a Monte Carlo estimate of
\(\int_1^\infty\frac{x^2}{\sqrt{2\pi}}e^{-x^2/2}dx\)
by importance sampling.