Ask Question
13 August, 07:56

Write Python code that produces an array called epsilon of length 10000 for which plt. acorr (epsilon), the plot of correlation between values, produces a plot with a correlation above 0.25 at lags 0,1 and 2, and has a correlation below 0.05 for lags strictly larger than 2. Hand in your code and your plot.

+3
Answers (1)
  1. 13 August, 08:23
    0
    Check the explanation

    Explanation:

    acorr () is function in matplotlib module in python. acorr () in full meaning is Auto-Correlation function (). and it it generally used to find out Auto-Correlation of array of x element.

    matplotlib. pyplot. acorr ()

    # Implementation acorr ()

    import matplotlib. pyplot as plt

    import numpy as np

    epsilon = np. random. randn (1000)

    plt. title ("Autocorrelation")

    plt. acorr (epsilon, usevlines = True,

    normed = True, maxlags = 2,

    lw = 3)

    plt. grid (True)

    plt. show ()

    also i have created the exmaple for both Auto as well as cross correlation as below

    import matplotlib. pyplot as plt

    import numpy as np

    np. random. seed (10**3)

    x, y = np. random. randn (2, 1000)

    fig, [ax1, ax2] = plt. subplots (2, 1, sharex=True)

    ax2. acorr (x, usevlines=True, normed=True, maxlags=50, lw=2)

    ax2. grid (True)

    ax1. xcorr (x, y, usevlines=True, maxlags=50, normed=True, lw=2)

    ax1. grid (True)

    plt. show ()
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write Python code that produces an array called epsilon of length 10000 for which plt. acorr (epsilon), the plot of correlation between ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers