Adapt modeling tutorial
"source": [
"## Covariance and parameters errors\n",
"\n",
- "The covariance matrix is attached to the results parameters object:"
+ "The covariance matrix is attached to the results parameters object and can be set to the model:"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "result_minuit.parameters.covariance"
+ "crab_model.covariance = result_minuit.parameters.covariance"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "You can get the error on a specific parameter by index or name: "
+ "You can get the error on a specific parameter by accessing the `.error` attribute:"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "result_minuit.parameters.error(\"alpha\")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Coavariance information and errors are available in the results object, but they are not automatically synchronised with the model objects, you can do it as follow:"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "# set sub-covariance on the input spectral model\n",
- "covar = result_minuit.parameters.get_subcovariance(crab_spectrum.parameters)\n",
- "crab_spectrum.parameters.covariance = covar"
+ "crab_model.spectral_model.alpha.error"
]
},
{
