Answered step by step
Verified Expert Solution
Question
1 Approved Answer
NEED R CODE FOR 8.!! Test next the reliability of the function ML_rule (obtained in Question 1) through a simulation study. Implement the simulation study
NEED R CODE FOR 8.!!
Test next the reliability of the function ML_rule (obtained in Question 1) through a simulation study. Implement the simulation study by repeating the following two steps 1000 times for i=1,,1000 : (a) Generate 150 observations from a population 1 with normal distribution N(1,2) where 1=1 and 2=1, and 150 observations from a population 2 with normal distribution N(2,2) where 2=2 and variance 2=1. For each iteration, set the seed of the simulations equal to 1+i. (b) Use the function ML_rule 1 to implement the ML rule and obtain the estimated missclassification probabilities p12 and p21 from the simulated data. Compare the distribution of p12 (you can calculate the kernel density from the 1000 values of p12 from the simulations) with the true probability p12, and compare the distribution of p21 with the true probability p21. Note that since the data is generated we can compute the true missclassification probabilities as p12=p21=(212), where () is the cumulative distribution function of the standard normal distribution (i.e. N(0,1) ) Comment on the results
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started