Closed fastcloud-cho closed 2 years ago
You will receive a singular matrix
error if the data in EMG1
and EMG2
are identical.
Try using the same variable EMG1
twice; you should see the same singular matrix
error when the variables are identical like this:
T2 = spm1d.stats.hotellings_paired(EMG1, EMG1)
To check whether EMG1
and EMG2
are indeed identical, use:
print( np.all(EMG1==EMG2) )
Please note: partly for security reasons we cannot analyze attached or linked data in this forum.
Thank you so much!
Now, I will try to fix the problem.
I prepared three 1d npy files (8 observations, 100 time nodes) for TA,PL, and Soleus EMG. I used np.dstack() command to converge those three files into a single 2d npy file,
EMG1=np.dstack((TA1,PL1,SOL1))
which I attach as an URL below. (EMG1_TAPLSOL.npy)https://drive.google.com/file/d/1oeUCa71lcUbgZvba6-xIyWBeqC3uMnoT/view?usp=sharing And made another 2d npy file, EMG2_TAPLSOL.npy.
But, when I tried Hotelling's T2 test on Jupyter Notebook,
T2 = spm1d.stats.hotellings_paired(EMG1, EMG2)
it returned me an error message; LinAlgError: Singular matrixI think I made wrong 2d npy files.. Could you help me to make proper ones? (FYI, it's been about 10 days since I started practicing spm1d and Python following the online workshop)