Autocorrelation
Do rent prices tend to show a similar pattern when compared year-over-year? If you take the rent prices in Los Angeles and compare them to rent prices one year in the past, will you see a significant relationship? In other words, do rent prices in Los Angeles demonstrate autocorrelation?
A NumPy array of rents has been loaded for Los Angeles (la_rents
), as well as the dates
associated with each measurement, have been loaded for you. The packages pandas as pd
, NumPy as np
, Matplotlib as plt
, and the stats
package from SciPy have all been loaded as well.
Cet exercice fait partie du cours
Foundations of Inference in Python
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Select all but the first twelve rents
la_rents_initial = ____
# Select all but the last twelve rents (12 month lag)
la_rents_lag = ____
# Compute the correlation between the initial values and the lagged values
____
# Check if the p-value is significant at the 5% level
____