Code 13.1

#Code-13.1

Code 13.2

#Code-13.2

Code 13.3

#Code-13.3
Loading output library...

Code 13.4

#Code-13.4

The code 13.4 and the related comment in the book is particular to R and not relevant for Python.

Code 13.5

#Code-13.5
Loading output library...

Code 13.6 and 13.7

#Code-13.6-and-13.7

Instead of having individual arrays a_cafe and b_cafe, I'll place all these values in a DataFrame for easy manipulation.

Loading output library...

Code 13.9

#Code-13.9

Instead of using confidence region ellipses (Seaborn doesn't have this functionality) we'll be using KDEs. To make the kde smoother we will use a sample size larger than the one vary_effects

Loading output library...

Code 13.10 (Simulate the observations)

#Code-13.10-(Simulate-the-observations)
Loading output library...
Loading output library...

Looks good! The model seems to be able to recover the initial values a, b, rho and sigmas.

Loading output library...
Loading output library...