# Ceteris Lab downloadable Python script
# Course: Fundamentals of Python for Financial Econometrics

import matplotlib.pyplot as plt
import pandas as pd

series = pd.Series([1.2, 1.4, 1.3, 1.6], index=pd.date_range("2026-01-01", periods=4, freq="MS"))
fig, ax = plt.subplots()
ax.plot(series.index, series.values, marker="o")
ax.set(title="Illustrative Monthly Index", xlabel="Month", ylabel="Index points")
fig.tight_layout()
plt.close(fig)
print(len(series))

import numpy as np
import matplotlib.pyplot as plt

rng = np.random.default_rng(12)
values = rng.standard_t(df=5, size=1_000)
fig, ax = plt.subplots()
ax.hist(values, bins=35, density=True)
ax.set(title="Heavy-tailed simulated observations", xlabel="Value", ylabel="Density")
plt.close(fig)
print(round(values.std(), 3))

import matplotlib.pyplot as plt
import pandas as pd
fig, ax = plt.subplots()
ax.plot(series.index, series.values, marker="o")
ax.set(title="Illustrative Monthly Index", xlabel="Month", ylabel="Index points")
fig.tight_layout()
