math domain error (linalg) in statsmodels.tsa.api.VAR <p>I am trying to use Vector Auto Regression (VAR), but I got this error: ValueError: math domain error</p> <p>Here is my code: (and also I don't know how to give it only one dimensional data)</p> <pre><code> Y = [data[0,:] , data[1,:]] import statsmodels.tsa.api Vmodel = statsmodels.tsa.api.VAR(Y) results = Vmodel.fit(2) results.summary() results.plot() results.plot_acorr() </code></pre> <p>Here is the Error message:</p> <pre><code>Traceback: \AppData\Local\Continuum\Anaconda\myproj\mainProg.py", line 190, in AR results = Vmodel.fit(4) \AppData\Local\Continuum\Anaconda\lib\site-packages\statsmodels\tsa\vector_ar\var_model.py", line 443, in fit return self._estimate_var(lags, trend=trend) \AppData\Local\Continuum\Anaconda\lib\site-packages\numpy\linalg\linalg.py", line 1837, in lstsq nlvl = max( 0, int( math.log( float(min(m, n))/2. ) ) + 1 ) </code></pre> <p>My data type is numpy array of floats.</p> <p>Thanks for your help.</p> <p>Update: Solved by transposing the input data!</p>