I'm trying to use linear regression from alglib for VB .Net project in VS2010.
Dim LRData(Mins.Count - 1, Maxs.Count - 1) As Double
……………………………………
Dim Info = 0 Dim LM = New XAlglib.linearmodel() Dim LR = New XAlglib.lrreport() XAlglib.lrbuild(LRData, Maxs.Count, Mins.Count, Info, LM, LR)
But => System.IndexOutOfRangeException was unhandled Message=Index was outside the bounds of the array. Source=alglibnet2 StackTrace: at alglib.linreg.lrbuilds(Double[,] xy, Double[] s, Int32 npoints, Int32 nvars, Int32& info, linearmodel lm, lrreport ar) at alglib.linreg.lrbuild(Double[,] xy, Int32 npoints, Int32 nvars, Int32& info, linearmodel lm, lrreport ar) at alglib.lrbuild(Double[,] xy, Int32 npoints, Int32 nvars, Int32& info, linearmodel& lm, lrreport& ar)
May be the problem is that LM and LR constructors didn't initialize array W in XAlglib.linearmodel and arrays C and CVDEFECTS in XAlglib.lrreport? How to setup instances of linearmodel & lrreport before running the lrbuild? Thank you in advance )
|