Question: b) Data set 2 includes 500 trajectories of 6 time points generated from three distributions. In distribution 1, the outcome is distributed with mean
b) Data set 2 includes 500 trajectories of 6 time points generated from three distributions. In distribution 1, the outcome is distributed with mean that is a linear regression of time, with intercept term 2 and slope 5, and errors that follow a standard normal distribution. In distribution 2, the outcome is distributed with mean that is also a linear function of time with intercept term 5 and slope 7 and errors that follow a standard normal distribution. Similarly, in distribution 3, the outcome is distributed with mean that is also a linear function of time with intercept term 6 and slope 2 and errors that follow a standard normal distribution. Generate the mixture of 500 trajectories assuming an average of 50% of data generated from distribution 1, 30% generated from distribution 2 and 20% generated from distribution 3. Plot the 500 trajectories and color the three groups differently. Include the script and the plot in your write-up.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
