(flat_params)
| 41 | init = np.ones((T, P)) |
| 42 | |
| 43 | def objective(flat_params): |
| 44 | params = flat_params.reshape(T, P) |
| 45 | pred = scaling_law_func(X, params) # (N, T) |
| 46 | mse = np.mean((pred - y2d) ** 2) |
| 47 | return mse |
| 48 | |
| 49 | result = minimize(objective, init.ravel(), method='BFGS') |
| 50 | params_opt = result.x.reshape(T, P) if result.success else init |
nothing calls this directly
no test coverage detected