STA314 – Total marks 40 (Solution)

$ 29.99
Category:

Description

Chapter 4, Q7 on page 170 (with some changes)
1. Suppose that we wish to predict whether a given stock will issue a dividend this year (โ€œYesโ€ or โ€œNoโ€) based on ๐‘‹, last yearโ€™s percent profit. We examine a large number of companies and discover that the mean value of ๐‘‹ for companies that issued a dividend was ๐‘‹ฬ… = 10, while the mean for those that didnโ€™t was ๐‘‹ฬ… = 0. In addition, the variance of ๐‘‹ for these two sets of companies was ๐œŽฬ‚2= 36. Finally, 80% of companies issued dividends. Assuming that ๐‘‹ follows a normal distribution, predict the probability that a company will issue a dividend this year given that its percentage profit was ๐‘ฟ = 4 last year. To answer this, first answer a) to e).
a) Write down what is P(๐‘‹ | Dividend = Yes) (3 marks)
b) Write down what is P(๐‘‹ | Dividend = No) (3 marks)
c) Use dnorm() function in R to calculate conditional probabilities in a) and b) when ๐‘‹ = 4 (4 marks, 2 marks each)
d) What is the value of P( Dividend = Yes)? (2 marks)
e) What is the value of P( Dividend = No)? (2 marks)
f) Now predict the probability that a company will issue a dividend this year given that its percentage profit was ๐‘‹ = 4 last year. Hint: Use Bayesโ€™ rule as we discussed in the class. (6 marks)

Chapter 4, Q 11 on pp 171-172 (with some changes)

2. In this problem, you will develop a model to predict whether a given car gets high or low gas mileage based on the Auto data set.
(b) Which of the continuous features seem most likely to be useful in predicting mpg? Use cor() function in R and consider features with correlation coefficients > 0.6 as useful in predicting. (2 marks)
(c) Split the data into a training set and a test set holding 30% of data for testing. Use sample.split() function in the library โ€˜caToolsโ€™ in R to split the data with the random seed 101. Use set.seed() function in R to assign the random seed. (3 marks)

Reviews

There are no reviews yet.

Be the first to review “STA314 – Total marks 40 (Solution)”

Your email address will not be published. Required fields are marked *