bool isMAInvertible(List<double> theta) { final poly = <double>[1.0, ...theta]; final roots = polyRoots(poly); for (final r in roots) { if (r.abs() <= 1.000001) return false; } return true; }