analisi ben fatta del caso dinamico

This commit is contained in:
2026-04-05 22:04:06 +02:00
parent a0c29b1ae4
commit 84e88fd6e6
6 changed files with 6001 additions and 1241 deletions

View File

@@ -18,7 +18,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 58,
"id": "f34c5b88",
"metadata": {},
"outputs": [],
@@ -51,7 +51,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 59,
"id": "08efb2be",
"metadata": {},
"outputs": [],
@@ -86,7 +86,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 60,
"id": "5494409f",
"metadata": {},
"outputs": [
@@ -215,7 +215,7 @@
"4 168.53 0.002887 "
]
},
"execution_count": 3,
"execution_count": 60,
"metadata": {},
"output_type": "execute_result"
}
@@ -226,7 +226,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 61,
"id": "976d5531",
"metadata": {},
"outputs": [
@@ -282,7 +282,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 62,
"id": "2ad19283",
"metadata": {},
"outputs": [
@@ -311,7 +311,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 63,
"id": "5f59d6c9",
"metadata": {},
"outputs": [
@@ -360,7 +360,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 64,
"id": "7e75ec05",
"metadata": {},
"outputs": [],
@@ -387,7 +387,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 65,
"id": "aefe7756",
"metadata": {},
"outputs": [
@@ -400,8 +400,8 @@
"Dep. Variable: y R-squared: 1.000\n",
"Model: OLS Adj. R-squared: 1.000\n",
"Method: Least Squares F-statistic: 2.238e+04\n",
"Date: Fri, 03 Apr 2026 Prob (F-statistic): 4.46e-15\n",
"Time: 15:28:32 Log-Likelihood: -27.238\n",
"Date: Sat, 04 Apr 2026 Prob (F-statistic): 4.46e-15\n",
"Time: 19:37:55 Log-Likelihood: -27.238\n",
"No. Observations: 10 AIC: 58.48\n",
"Df Residuals: 8 BIC: 59.08\n",
"Df Model: 1 \n",
@@ -449,7 +449,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 66,
"id": "1d42b009",
"metadata": {},
"outputs": [
@@ -515,7 +515,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 67,
"id": "986ff4a6",
"metadata": {},
"outputs": [
@@ -577,7 +577,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 68,
"id": "2d4b7144",
"metadata": {},
"outputs": [
@@ -586,8 +586,8 @@
"output_type": "stream",
"text": [
"Ax + B : \n",
"AC = 24.0474 +- 0.1316\n",
"BC = -1.5698 +- 2.0811\n",
"AC = 24.0474 ± 0.1316\n",
"BC = -1.5698 ± 2.0811\n",
"cov_ABC = -0.246370\n",
"P(0, chi²)= 0.9979\n"
]
@@ -645,15 +645,15 @@
"\n",
"AC, BC, uAC, uBC, covABC, chiC = reg_lin(data[\"x\"], data[\"y\"], data[\"ux\"], data[\"uy\"])\n",
"print(\"Ax + B : \")\n",
"print(f\"AC = {AC:.4f} +- {uAC:.4f}\")\n",
"print(f\"BC = {BC:.4f} +- {uBC:.4f}\")\n",
"print(f\"AC = {AC:.4f} ± {uAC:.4f}\")\n",
"print(f\"BC = {BC:.4f} ± {uBC:.4f}\")\n",
"print(f\"cov_ABC = {covABC:.6f}\")\n",
"print(f\"P(0, chi²)= {chiC:.4f}\")\n"
]
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 69,
"id": "e2407a04",
"metadata": {},
"outputs": [
@@ -722,7 +722,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 70,
"id": "32e9948f",
"metadata": {},
"outputs": [
@@ -785,7 +785,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 71,
"id": "bfb895c6",
"metadata": {},
"outputs": [
@@ -868,7 +868,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 72,
"id": "202de438",
"metadata": {},
"outputs": [
@@ -942,7 +942,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 73,
"id": "caf23dbe",
"metadata": {},
"outputs": [
@@ -950,6 +950,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"RISULTATI senza ERRORE STRUMENTALE INCLUSO:\n",
"Media pesata K = 23.95113 ± 0.05732\n",
"\n",
"RISULTATI REGRESSIONE OLS:\n",
"Aols = 23.96871 ± 0.16022\n",
@@ -969,9 +971,10 @@
}
],
"source": [
"print(\"\")\n",
"print(\"RISULTATI senza ERRORE STRUMENTALE INCLUSO:\")\n",
"print(f\"Media pesata K = {media:.5f} ± {uA:.5f}\")\n",
"\n",
"print(\"RISULTATI REGRESSIONE OLS:\")\n",
"print(\"\\nRISULTATI REGRESSIONE OLS:\")\n",
"print(f\"Aols = {Aols:.5f} ± {uAols:.5f}\")\n",
"print(f\"Bols = {Bols:.5f} ± {uBols:.5f}\")\n",
"print(f\"P(0, chi²)= {Pols:.5f}\")\n",
@@ -997,7 +1000,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 74,
"id": "8f5c8bb7",
"metadata": {},
"outputs": [
@@ -1046,7 +1049,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 75,
"id": "a1dc24c9",
"metadata": {},
"outputs": [],
@@ -1098,7 +1101,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 76,
"id": "c8e264fa",
"metadata": {},
"outputs": [