Question: # Calculate the Covariance for discrete random variables # Input X and Y are in a table with corresponding probabilities value_x = np.array([1, 2,

# Calculate the Covariance for discrete random variables # Input X and

# Calculate the Covariance for discrete random variables # Input X and Y are in a table with corresponding probabilities value_x = np.array([1, 2, 3]) value y = np.array([1, 2, 3, 4]) # Covariance matrix # the first dimension is for varaiable x # the second dimension is for varaiable y prob_matrix = np.array([[0.12, 0.08, 0.07, 0.05], [0.08, 0.15, 0.21, 0.13], [0.01, 0.01, 0.02, 0.07]]) # Expectation of x exp_x = print("Expectation of x: ", exp_x) # Expectation of y exp_y = print("Expectation of y: ", exp_y) # Variance of x var_x = print("Variance of x: ", var_x) # Variance of y var y = print("Variance of y: ", var_y) # Covariance cov = _print("Covariance: ", cov)

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 Algorithms Questions!