Question: 8.2 SORTING BY COUNTING Distribution Counting Algorithm: //Input: Array A[0..n-1] of integers between / and u (1u) //Output: Array S[0..n-1] of A's elements sorted
![8.2 SORTING BY COUNTING Distribution Counting Algorithm: //Input: Array A[0..n-1] of integers](https://s3.amazonaws.com/si.experts.images/answers/2024/05/6647a93901e6c_4086647a938d3ce0.jpg)
![between / and u (1u) //Output: Array S[0..n-1] of A's elements sorted](https://s3.amazonaws.com/si.experts.images/answers/2024/05/6647a939b1e9d_4096647a9398ddd0.jpg)
8.2 SORTING BY COUNTING Distribution Counting Algorithm: //Input: Array A[0..n-1] of integers between / and u (1u) //Output: Array S[0..n-1] of A's elements sorted in non-decreasing order. DistributionCounting(A[0..n-1]) for (j=0; j Question 2 Naive Bayes: Consider the following data (30 points) Target variable is Return. Attributes: Open Interest, Trading volume. Open Interest Trading Volume Return Low High Up High Low Down Low High Up High High Up Low High Down Low Low Down High High Down Low High Down Low Low Down High High Up a. Generate the table of probabilities (with all condition probabilities) for the Naive Bayes Model (See slide 28 in "Supervised Machine learning algorithms Part 2 classification Lecture 5) SHOW ALL WORK PCClass 1) P(Class 2) Conditional Probability (open interest) Conditional Probability (tradition Volume) b. Predict the RETURN for the following data point using the table in Part A: Open interest Low Trading Volume Low Wind PLC and Cloud PLC are two listed firms with the following possible payoffs: Probability Stock return of Wind Stock return of Cloud (%) State (%) Depression 0.10 Recession 0.40 Normal 0.40 Boom 0.10 15 10 5 -2 -2 5 10 15 (a) Calculate the expected return and standard deviation of each stock. (8 marks) (b) Compute the covariance of each stock and the correlation between the two stocks. (8 marks) (c) What are the expected return and standard deviation of an equally-weighted portfolio? (9 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
