Question: 2.2 Your Tasks 1. (3pt) Create a function called generate. AB. This function has two arguments: (no default value) and c (default value of 0).

2.2 Your Tasks 1. (3pt) Create a function called generate. AB. This function has two arguments: (no default value) and c (default value of 0). This function does the following: It generates n random pairs of (A, B) under the dynamic given by Equations (2.1)-(2.2), with constant c specified via the second argument 'c' of the function. It returns this sample as a matrix of size n x 2 (n rows, 2 columns). The first column is the sample (A,..., An); the second column is the sample (B,..., Bn). Then, use your function to create a scatter plot of a sample (A, B),..., (An, Bn) for n = 2000 and c = 0.08 (the A values should be on the x axis, while the B values should be on the y axis) and briefly comment on the relationship between A and B. Hint: In this question, vectorization is your friend. Remember that a single command like rnorm (n) can generate a vector of n random variables in one go. 2. (2pt) Use a visualisation of your choice to illustrate the relationship between: the correlation p(A

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!