Question: Please submit code in MATLAB, and if possible include pictures of final outcome. 1.6 (24 pts) Write a function that generates independent and identically distributed

Please submit code in MATLAB, and if possible include pictures of final outcome.

Please submit code in MATLAB, and if possible include pictures of final

1.6 (24 pts) Write a function that generates independent and identically distributed samples given class-specific parameters. The class conditional densities are normal distributions accepting class dependent means , and covariances i. The function should also accept arbitrary class priors P(wi). Be sure to test your function with some simple cases to validate that it is working correctly. Here are the specifications for the function: function [data, classIndex generateGaussianSamples(mu, sigma, nSam- ples, prior) One way to write this function would be to first sample the class and then sample the data point from the respective class conditional density. Generate samples according to the parameters given below and produce two-dimensional scatter plots with the simulated datasets (six plots in total): (a) nSamples 400, 0,0,sigmaI, (with I being the identity matrix), and mu{2) = [3.31, sigma(2) = 1. Use equal priors. (b) Same as (a), but now sigmasigma{2)3,1;1,0.8.Use (c) nSamples 400.1 (d) Same as (a), but make the P(0.05. ual priors. sigmat1) 12u2) Use equal priors 2,2], sigma21.9-1.95) (e) Same as (b), but make the P(w0.05. (f) Same as (c), but make the P(w) =0.05. The plots must have a legend to indicate what class the samples belong to. Make sure the plots are correctly labeled (axis, titles, legend, etc) and that the fonts are legible when printed. 1.6 (24 pts) Write a function that generates independent and identically distributed samples given class-specific parameters. The class conditional densities are normal distributions accepting class dependent means , and covariances i. The function should also accept arbitrary class priors P(wi). Be sure to test your function with some simple cases to validate that it is working correctly. Here are the specifications for the function: function [data, classIndex generateGaussianSamples(mu, sigma, nSam- ples, prior) One way to write this function would be to first sample the class and then sample the data point from the respective class conditional density. Generate samples according to the parameters given below and produce two-dimensional scatter plots with the simulated datasets (six plots in total): (a) nSamples 400, 0,0,sigmaI, (with I being the identity matrix), and mu{2) = [3.31, sigma(2) = 1. Use equal priors. (b) Same as (a), but now sigmasigma{2)3,1;1,0.8.Use (c) nSamples 400.1 (d) Same as (a), but make the P(0.05. ual priors. sigmat1) 12u2) Use equal priors 2,2], sigma21.9-1.95) (e) Same as (b), but make the P(w0.05. (f) Same as (c), but make the P(w) =0.05. The plots must have a legend to indicate what class the samples belong to. Make sure the plots are correctly labeled (axis, titles, legend, etc) and that the fonts are legible when printed

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!