Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Exception in AutoRegressiveIntegratedMovingAverage #8039

Open
4 tasks done
AlexCatarino opened this issue May 17, 2024 · 0 comments
Open
4 tasks done

Unhandled Exception in AutoRegressiveIntegratedMovingAverage #8039

AlexCatarino opened this issue May 17, 2024 · 0 comments

Comments

@AlexCatarino
Copy link
Member

Expected Behavior

Ideally, LEAN doesn't throw unhandled exceptions.

Actual Behavior

2024-05-17T09:12:16.0912054Z ERROR:: Extensions.SetRuntimeError(): Extensions.SetRuntimeError(): RuntimeError at 05/16/2024 21:00:00 UTC. Context: Consolidators update System.ArgumentException: Matrix must be positive definite.
   at MathNet.Numerics.Providers.LinearAlgebra.ManagedLinearAlgebraProvider.CholeskyFactor(Double[] a, Int32 order)
   at MathNet.Numerics.LinearAlgebra.Double.Factorization.DenseCholesky.Create(DenseMatrix matrix)
   at MathNet.Numerics.LinearRegression.MultipleRegression.NormalEquations[T](T[][] x, T[] y, Boolean intercept)
   at QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.MovingAverageStep(Double[][] lags, Double[] data, Double errorMa) in /Indicators/AutoRegressiveIntegratedMovingAverage.cs:line 255
   at QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.TwoStepFit(Double[] series) in /Indicators/AutoRegressiveIntegratedMovingAverage.cs:line 230
   at QuantConnect.Indicators.AutoRegressiveIntegratedMovingAverage.ComputeNextValue(IndicatorDataPoint input) in /Indicators/AutoRegressiveIntegratedMovingAverage.cs:line 185

Potential Solution

The AutoRegressiveIntegratedMovingAverage.MovingAverageStep method could not throw an exception if there is a reasonable alternative (return zero?); otherwise, it could raise an exception with the matrix values.

Reproducing the Problem

Coming soon.

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant