Skip to content

Commit

Permalink
CircleCI build openturns 18192
Browse files Browse the repository at this point in the history
  • Loading branch information
CircleCI committed Apr 26, 2024
1 parent 22403dc commit 7df8093
Show file tree
Hide file tree
Showing 423 changed files with 12,855 additions and 4,947 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
},
"outputs": [],
"source": [
"result_PLL = factory.buildMethodOfProfileLikelihoodMaximizationEstimator(sample)"
"result_PLL = factory.buildMethodOfXiProfileLikelihoodEstimator(sample)"
]
},
{
Expand Down Expand Up @@ -292,7 +292,7 @@
},
"outputs": [],
"source": [
"constant = ot.SymbolicFunction([\"t\"], [\"1.0\"])\nbasis_lin = ot.Basis([constant, ot.SymbolicFunction([\"t\"], [\"t\"])])\nbasis_cst = ot.Basis([constant])\n# basis for mu, sigma, xi\nbasis_coll = [basis_lin, basis_cst, basis_cst]"
"constant = ot.SymbolicFunction([\"t\"], [\"1.0\"])\nbasis = ot.Basis([constant, ot.SymbolicFunction([\"t\"], [\"t\"])])\n# basis for mu, sigma, xi\nmuIndices = [0, 1] # linear\nsigmaIndices = [0] # stationary\nxiIndices = [0] # stationary"
]
},
{
Expand Down Expand Up @@ -328,7 +328,7 @@
},
"outputs": [],
"source": [
"initiPoint_list = list()\ninitiPoint_list.append(\"Gumbel\")\ninitiPoint_list.append(\"Static\")\nnormMethod_list = list()\nnormMethod_list.append(\"MinMax\")\nnormMethod_list.append(\"CenterReduce\")\nnormMethod_list.append(\"None\")\nprint(\"Linear mu(t) model: \")\nfor normMeth in normMethod_list:\n for initPoint in initiPoint_list:\n print(\"normMeth, initPoint = \", normMeth, initPoint)\n # The ot.Function() is the identity function.\n result = factory.buildTimeVarying(\n sample, timeStamps, basis_coll, ot.Function(), initPoint, normMeth\n )\n beta = result.getOptimalParameter()\n print(\"beta1, beta2, beta3, beta4 = \", beta)\n print(\"Max log-likelihood = \", result.getLogLikelihood())"
"print(\"Linear mu(t) model: \")\nfor normMeth in [\"MinMax\", \"CenterReduce\", \"None\"]:\n for initPoint in [\"Gumbel\", \"Static\"]:\n print(f\"normMeth = {normMeth}, initPoint = {initPoint}\")\n # The ot.Function() is the identity function.\n result = factory.buildTimeVarying(\n sample, timeStamps, basis, muIndices, sigmaIndices, xiIndices,\n ot.Function(), ot.Function(), ot.Function(), initPoint, normMeth\n )\n beta = result.getOptimalParameter()\n print(f\"beta = {beta}\")\n print(f\"Max log-likelihood = {result.getLogLikelihood()}\")"
]
},
{
Expand All @@ -346,7 +346,7 @@
},
"outputs": [],
"source": [
"result_NonStatLL = factory.buildTimeVarying(sample, timeStamps, basis_coll)\nbeta = result_NonStatLL.getOptimalParameter()\nprint(\"beta1, beta2, beta3, beta_4 = \", beta)\nprint(f\"mu(t) = {beta[0]:.4f} + {beta[1]:.4f} * tau\")\nprint(f\"sigma = {beta[2]:.4f}\")\nprint(f\"xi = {beta[3]:.4f}\")"
"result_NonStatLL = factory.buildTimeVarying(sample, timeStamps, basis, muIndices, sigmaIndices, xiIndices)\nbeta = result_NonStatLL.getOptimalParameter()\nprint(f\"beta = {beta}\")\nprint(f\"mu(t) = {beta[0]:.4f} + {beta[1]:.4f} * tau\")\nprint(f\"sigma = {beta[2]:.4f}\")\nprint(f\"xi = {beta[3]:.4f}\")"
]
},
{
Expand Down Expand Up @@ -425,7 +425,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In order to draw some diagnostic plots similar to those drawn in the stationary case, we refer to the\nfollowing result: if $Z_t$ is a non stationary GEV model parametrized by $(\\mu(t), \\sigma(t), \\xi(t))$,\nthen the standardized variables $\\hat{Z}_t$ defined by:\n\n\\begin{align}\\hat{Z}_t = \\dfrac{1}{\\xi(t)} \\log \\left[1+ \\xi(t)\\left( \\dfrac{Z_t-\\mu(t)}{\\sigma(t)} \\right)\\right]\\end{align}\n\nhave the standard Gumbel distribution which is the GEV model with $(\\mu, \\sigma, \\xi) = (0, 1, 0)$.\n\nAs a result, we can validate the inference result thanks the 4 usual diagnostic plots:\n\n- the probability-probability pot,\n- the quantile-quantile pot,\n- the return level plot,\n- the data histogram and the desnity of the fitted model.\n\nusing the transformed data compared to the Gumbel model. We can see that the adequation seems similar to the graph\nof the stationary model.\n\n"
"In order to draw some diagnostic plots similar to those drawn in the stationary case, we refer to the\nfollowing result: if $Z_t$ is a non stationary GEV model parametrized by $(\\mu(t), \\sigma(t), \\xi(t))$,\nthen the standardized variables $\\hat{Z}_t$ defined by:\n\n\\begin{align}\\hat{Z}_t = \\dfrac{1}{\\xi(t)} \\log \\left[1+ \\xi(t)\\left( \\dfrac{Z_t-\\mu(t)}{\\sigma(t)} \\right)\\right]\\end{align}\n\nhave the standard Gumbel distribution which is the GEV model with $(\\mu, \\sigma, \\xi) = (0, 1, 0)$.\n\nAs a result, we can validate the inference result thanks the 4 usual diagnostic plots:\n\n- the probability-probability pot,\n- the quantile-quantile pot,\n- the return level plot,\n- the data histogram and the density of the fitted model.\n\nusing the transformed data compared to the Gumbel model. We can see that the adequation seems similar to the graph\nof the stationary model.\n\n"
]
},
{
Expand Down Expand Up @@ -454,7 +454,7 @@
},
"outputs": [],
"source": [
"graph = ot.Graph(\n r\"Maximum annual sea-levels at Port Pirie - Linear $\\mu(t)$\",\n \"year\",\n \"level (m)\",\n True,\n \"\",\n)\ngraph.setIntegerXTick(True)\n# data\ncloud = ot.Cloud(data[:, :2])\ncloud.setColor(\"red\")\ngraph.add(cloud)\n# mean function\nmeandata = [\n result_NonStatLL.getDistribution(t).getMean()[0] for t in data[:, 0].asPoint()\n]\ncurve_meanPoints = ot.Curve(data[:, 0].asPoint(), meandata)\ngraph.add(curve_meanPoints)\n# quantile function\ngraphQuantile = result_NonStatLL.drawQuantileFunction(0.95)\ndrawQuant = graphQuantile.getDrawable(0)\ndrawQuant = graphQuantile.getDrawable(0)\ndrawQuant.setLineStyle(\"dashed\")\ngraph.add(drawQuant)\ngraph.setLegends([\"data\", \"mean function\", \"quantile 0.95 function\"])\ngraph.setLegendPosition(\"lower right\")\nview = otv.View(graph)"
"graph = ot.Graph(\n r\"Maximum annual sea-levels at Port Pirie - Linear $\\mu(t)$\",\n \"year\",\n \"level (m)\",\n True,\n \"\",\n)\ngraph.setIntegerXTick(True)\n# data\ncloud = ot.Cloud(data[:, :2])\ncloud.setColor(\"red\")\ngraph.add(cloud)\n# mean function\nmeandata = [\n result_NonStatLL.getDistribution(t).getMean()[0] for t in data[:, 0].asPoint()\n]\ncurve_meanPoints = ot.Curve(data[:, 0].asPoint(), meandata)\ngraph.add(curve_meanPoints)\n# quantile function\ngraphQuantile = result_NonStatLL.drawQuantileFunction(0.95)\ndrawQuant = graphQuantile.getDrawable(0)\ndrawQuant = graphQuantile.getDrawable(0)\ndrawQuant.setLineStyle(\"dashed\")\ngraph.add(drawQuant)\ngraph.setLegends([\"data\", \"mean function\", \"quantile 0.95 function\"])\ngraph.setLegendPosition(\"lower right\")\nview = otv.View(graph)"
]
},
{
Expand Down
Binary file not shown.
Loading

0 comments on commit 7df8093

Please sign in to comment.