#2929
ozcanalp
Member

Thank you very much Ding Hao,

When I’ve fitted a model, i got an {“no solution to this system of linear equations”} exception on this line “VARFitting fitting = new VARFitting(X_T, 2);”. How can I fit the model? My code and exception are given below.
any help or advise will be appreciated.

code:

X_T = new MultivariateSimpleTimeSeries(
new double[][]{
new double[]{0, 0},
new double[]{0, 0.008},
new double[]{0, 0.269},
new double[]{0, 0.008},
new double[]{0, 0.009},
new double[]{0, 0.002},
new double[]{0, 0.005},
new double[]{0, 0.009},
new double[]{0.005, 0.008},
new double[]{0.006, 0.003}

});

try
{
VARFitting fitting = new VARFitting(X_T, 2);

VARMAModel varmaModel = fitting.getVARMA();
VARMAForecastOneStep instance = null;

instance = new VARMAForecastOneStep(X_T, varmaModel.getDemeanedModel());
int T = X_T.size();
Vector xTHat = instance.xHat(T + 1);
Matrix V = instance.covariance(T);
Console.Write(“Predictor at time ” + (T+1) + “: ” + xTHat + “, covariance of errors: ” + V);
Console.Write(“\n”);
}catch(Exception e){

Console.WriteLine(“\nStackTrace —\n{0}”, e.StackTrace);

}

Exception :

at com.numericalmethod.suanshu.algebra.linear.matrix.doubles.linearsystem.BackwardSubstitution.new(UpperTriangularMatrix , Vector , Double )
at com.numericalmethod.suanshu.algebra.linear.matrix.doubles.linearsystem.BackwardSubstitution.solve(UpperTriangularMatrix U, Vector b, Double epsilon)
at com.numericalmethod.suanshu.algebra.linear.matrix.doubles.linearsystem.OLSSolverByQR.solve(LSProblem problem)
at com.numericalmethod.suanshu.stats.regression.linear.ols.OLSRegression..ctor(LMProblem problem, Double epsilon)
at com.numericalmethod.suanshu.stats.regression.linear.ols.OLSRegression..ctor(LMProblem problem)
at com.numericalmethod.suanshu.stats.timeseries.linear.multivariate.stationaryprocess.arma.VARFitting.new(MultivariateIntTimeTimeSeries , Int32 )
at com.numericalmethod.suanshu.stats.timeseries.linear.multivariate.stationaryprocess.arma.VARFitting.true(MultivariateIntTimeTimeSeries , Int32 )
at com.numericalmethod.suanshu.stats.timeseries.linear.multivariate.stationaryprocess.arma.VARFitting..ctor(MultivariateIntTimeTimeSeries mts, Int32 p)
at MultivariateTimeSeries.MultiLinearTimeSeries.run() in \Visual Studio 2010\Projects\MultivariateTimeSeries\MultivariateTimeSeries\MultiLinearTimeSeries.cs:line 323