# CS代考程序代写 database Suggested Answer for HW 2

Suggested Answer for HW 2

Question 1 (Interpreting distributions and densities) (1 point)

The Sharpe Pencil Company has a strict quality control monitoring program. As part of that program, it has determined that the distribution of the amount of graphite in each batch of one hundred pencil leads produced is continuous and uniform between one and two grams. That is, f(y) = 1 for y in [1,2], and zero otherwise, where y is the graphite content per batch of one hundred leads.

1. Is y a discrete or continuous random variable? (0.2 points)

Continuous.

2. Is f(y) a probability distribution or a density? (0.2 points) Density.

3. What is the probability that y is between 1 and 2? Between 1 and 1.3? Exactly equal to 1.67? (0.3 points)

1.00, 0.30, 0.00

4. For high-quality pencils, the desired graphite content per batch is 1.8 grams, with low variation across batches. With that in mind, discuss the nature of the density f(y). (0.3 points)

f(y) is unfortunately centered at 1.5, not 1.8. Moreover,f(y) unfortunately shows rather high dispersion.

Question 2 (Conditional mean and variance) (1 point)

Given the regression model,

find the mean and variance of yt conditional upon xt = x∗t and zt = zt∗ . Does the conditional mean adapt to the conditioning information? Does the conditional variance adapt to the conditioning information?

The conditional mean is

E(yt|xt =x∗t,zt =zt∗)=β0 +β1x∗t +β2x∗t2+β3zt∗.

The conditional variance is simply σ2.

yt =β0 +β1xt +β2x2t +β3zt +εt iid 2

εt ∼ (0,σ ), t = 1,··· ,T.

1

Suggested Answer for HW 2

Question 3 (Desired values of regression diagnostic statistics) (1 point)

For each of the diagnostic statistics listed below, indicate whether, other things the same, ”bigger is better,” ”smaller is better,” or neither. Explain your reasoning. (Hint: Be careful, think before you answer, and be sure to qualify your answers as appropriate.)

• t statistic bigger is better

• Probability value of the t statistic smaller is better

• R-squared and Adjusted R-squared bigger is better

• Standard error of the regression smaller is better

• Sum of squared residuals smaller is better

• Durbin-Watson statistic neither – should be near 2

• Akaike information criterion smaller is better

• Schwarz information criterion smaller is better

• F-statistic bigger is better

• Probability-value of the F-statistic smaller is better

Question 4 (Assessing forecasting situations) (1 point)

For each of the following scenarios, discuss the decision environment, the nature of the object to be forecast, the forecast type, the forecast horizon, the loss function, the information set, and what sorts of simple or complex forecasting approaches you might entertain.

1. You work for Airborne Analytics, a highly specialized mutual fund investing exclusively in airline stocks. The stocks held by the fund are chosen based on your recommenda- tions. You learn that a newly rich oil-producing country has requested bids on a huge contract to deliver thirty state-of-the-art fighter planes, but that only two companies submitted bids. The stock of the successful bidder is likely to rise.

2

Suggested Answer for HW 2

2. You work for the Office of Management and Budget in Washington DC and must forecast tax revenues for the upcoming fiscal year. You work for a president who wants to maintain funding for his pilot social programs, and high revenue forecasts ensure that the programs keep their funding. However, if the forecast is too high, and the president runs a large deficit at the end of the year, he will be seen as fiscally irresponsible, which will lessen his probability of reelection. Furthermore, your forecast will be scrutinized by the more conservative members of Congress; if they find fault with your procedures, they might have fiscal grounds to undermine the President’s planned budget.

3. You work for D&D, a major Los Angeles advertising firm, and you must create an ad for a client’s product. The ad must be targeted toward teenagers, because they constitute the primary market for the product. You must (somehow) find out what kids currently think is ”cool,” incorporate that information into your ad, and make your client’s product attractive to the new generation. If your hunch is right, your firm basks in glory, and you can expect multiple future clients from this one advertisement. If you miss, however, and the kids don’t respond to the ad, then your client’s sales fall and the client may reduce or even close its account with you.

(In class discussion.)

Question 5 (Empirical Exercises) (1 point)

In R lab session 3, we use the database was created with records of behavior of the urban traffic of the city of Sao Paulo in Brazil from December 14, 2009 to December 18, 2009 (From Monday to Friday). Registered from 7:00 to 20:00 every 30 minutes. We want to predict the percentage of Slowness in traffic by the attributes in the data set. The performance of the prediction model in our session is not good. In order to find a better prediction model, we run the following regression models:

• Run the regression of Slowness in traffic on Immobilized bus, Broken Truck, Vehicle excess, Accident victim, and Running over.

• Run the regression of Slowness in traffic on Broken Truck, Vehicle excess, Accident victim, Running over, and Fire Vehicles.

• Run the regression of Slowness in traffic on Vehicle excess, Accident victim, Running over, Fire Vehicles, and Occurrence involving freight.

1. Compare the three prediction models above using the following diagnostic statistics:

• Adjusted R-squared

• Standard error of the regression • Durbin-Watson statistic

3

Suggested Answer for HW 2

• Akaike information criterion • Schwarz information criterion

2. Find another way to improve the prediction model and show your prediction results. (Please submit the R codes you wrote for this question.)

Check the R codes for R lab Session3.

4