Question: Write a program that will do the following in R. Include your codes and necessary outputs to demonstrate your work. a) Generate 100000 random numbers
Write a program that will do the following in R. Include your codes and necessary outputs to demonstrate your work. a) Generate 100000 random numbers from an exponential distribution with rate=0.5 and store these numbers in a vector called aVector. Report a histogram of the numbers you just generated. b) Convert aVector into a matrix of 100 columns and assign it to an object called AMatrix. Report the dimension of AMatrix. c) Compute the column means of AMatrix. Report a histogram of those column means. d) Explain why the two histograms you have created in questions (a) and (c) are different in shapes.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
