|
20 | 20 | }
|
21 | 21 | ],
|
22 | 22 | "source": [
|
23 |
| - "from pymc_extras.statespace import structural as st\n", |
24 |
| - "from pymc_extras.statespace.utils.constants import SHORT_NAME_TO_LONG\n", |
| 23 | + "import warnings\n", |
| 24 | + "\n", |
| 25 | + "import arviz as az\n", |
25 | 26 | "import matplotlib.pyplot as plt\n",
|
| 27 | + "import numpy as np\n", |
| 28 | + "import pandas as pd\n", |
| 29 | + "import preliz as pz\n", |
26 | 30 | "import pymc as pm\n",
|
27 |
| - "import arviz as az\n", |
28 | 31 | "import pytensor.tensor as pt\n",
|
29 |
| - "import preliz as pz\n", |
30 | 32 | "\n",
|
31 |
| - "import numpy as np\n", |
32 |
| - "import pandas as pd\n", |
33 | 33 | "from patsy import dmatrix\n",
|
34 |
| - "import warnings\n", |
| 34 | + "\n", |
| 35 | + "from pymc_extras.statespace import structural as st\n", |
| 36 | + "from pymc_extras.statespace.utils.constants import SHORT_NAME_TO_LONG\n", |
35 | 37 | "\n",
|
36 | 38 | "warnings.filterwarnings(\"ignore\", category=UserWarning, message=\"The RandomType SharedVariables\")\n",
|
37 | 39 | "\n",
|
|
76 | 78 | },
|
77 | 79 | "outputs": [],
|
78 | 80 | "source": [
|
79 |
| - "from pymc_extras.statespace.filters.distributions import LinearGaussianStateSpace\n", |
80 | 81 | "from pymc.pytensorf import inputvars\n",
|
81 | 82 | "\n",
|
| 83 | + "from pymc_extras.statespace.filters.distributions import LinearGaussianStateSpace\n", |
| 84 | + "\n", |
82 | 85 | "\n",
|
83 | 86 | "def make_numpy_function(mod):\n",
|
84 | 87 | " mod = mod.build(verbose=False)\n",
|
85 |
| - " data = pt.matrix(\"data\", shape=(None, 1))\n", |
| 88 | + " pt.matrix(\"data\", shape=(None, 1))\n", |
86 | 89 | " steps = pt.iscalar(\"steps\")\n",
|
87 | 90 | " x0, _, c, d, T, Z, R, H, Q = mod._unpack_statespace_with_placeholders()\n",
|
88 | 91 | " sequence_names = [x.name for x in [c, d] if x.ndim == 2]\n",
|
|
3113 | 3116 | },
|
3114 | 3117 | "outputs": [],
|
3115 | 3118 | "source": [
|
3116 |
| - "from nutpie import transform_adapter\n", |
3117 | 3119 | "import nutpie as ntp\n",
|
3118 | 3120 | "\n",
|
3119 | 3121 | "# Uncomment to see arguments for with_transform_adapt\n",
|
|
0 commit comments