Pythonfiles

This commit is contained in:
2025-12-09 10:49:25 +01:00
parent 2a4fa83c47
commit 2f80cf34c9
2 changed files with 54 additions and 54 deletions

View File

@@ -0,0 +1,26 @@
import sympy as sp
#für Varianzkomponentenschätzung
MAX_ITER = 10
TOL = 1e-3 # 0.1%.
for loop in range(MAX_ITER):
Q_ll, P = modell.aufstellen_Qll_P()
N = A.T * P * A
n_vec = A.T * P * l
dx = N.LUsolve(n_vec)
v = l - A * dx
sigma_hat = modell.varianzkomponenten(v, A)
print(f"Iteration {loop+1}, σ̂² Gruppen:", sigma_hat)
# Prüfen: ist jede Komponente ≈ 1?
if all(abs(val - 1) < TOL for val in sigma_hat.values()):
print("Konvergenz erreicht ✔")
break
modell.update_sigma(sigma_hat)