<div dir="ltr"><div>Hi, </div><div><br></div><div>Thank you for the quick response. I did infact have condition_attr=['targets', 'chunks'], sorry about the typo. Have been trying to debug this for too long ...</div><div><br></div><div>Regarding the even definitions. Please see below the event definitions according to. </div><div>onsets = []</div><div>targets = []</div><div>chunks = []</div><div>for ev in events:</div><div>    onsets.append(ev['onset'])</div><div>    targets.append(ev['targets'])</div><div>    chunks.append(ev['chunks'])</div><div><br></div><div>>>> targets</div><div>['csA', 'csX_j_1', 'csB', 'csY_n_1', 'csA', 'csX_j_1', 'csB', 'csY_n_1', 'csA', 'csX_j_1', 'csB', 'csY_n_1', 'csA', 'csX_j_1', 'csB', 'csY_n_1', 'csB', 'csA', 'csX_j_1', 'csB', 'csY_n_1', 'csA', 'csX_j_1', 'csB',\</div><div> 'csY_n_1', 'csA', 'csX_j_1', 'csB', 'csY_n_1', 'csA', 'csX_j_1', 'csB', 'csY_n_1', 'csA', 'csX_j_1', 'csB', 'csB', 'csY_n_1', 'csA', 'csA', 'csX_j_1', 'csB', 'csY_n_1', 'csB', 'csA', 'csX_j_1', 'csA', 'csX_j_1',\</div><div> 'csB', 'csY_n_1', 'csA', 'csB', 'csY_n_1', 'csA', 'csC', 'csX_n_1', 'csD', 'csY_j_1', 'csD', 'csY_j_1', 'csC', 'csX_n_1', 'csD', 'csY_j_1', 'csC', 'csX_n_1', 'csD', 'csY_j_1', 'csC', 'csX_n_1', 'csD', 'csY_j_1',\</div><div> 'csC', 'csC', 'csX_n_1', 'csC', 'csX_n_1', 'csD', 'csY_j_1', 'csC', 'csX_n_1', 'csC', 'csC', 'csX_n_1', 'csD', 'csD', 'csY_j_1', 'csC', 'csX_n_1', 'csD', 'csY_j_1', 'csC', 'csX_n_1', 'csD', 'csY_j_1', 'csD', 'cs\</div><div>D', 'csY_j_1', 'csC', 'csX_n_1', 'csD', 'csY_j_1', 'csC', 'csD', 'csY_j_1', 'csD', 'csC', 'csX_n_1', 'csE', 'csX_j_2', 'csE', 'csX_j_2', 'csE', 'csX_j_2', 'csF', 'csY_n_2', 'csE', 'csX_j_2', 'csF', 'csY_n_2', 'cs\</div><div>E', 'csX_j_2', 'csF', 'csY_n_2', 'csE', 'csX_j_2', 'csF', 'csY_n_2', 'csF', 'csF', 'csY_n_2', 'csE', 'csX_j_2', 'csF', 'csY_n_2', 'csE', 'csF', 'csY_n_2', 'csE', 'csX_j_2', 'csF', 'csY_n_2', 'csE', 'csX_j_2', 'cs\</div><div>F', 'csY_n_2', 'csE', 'csX_j_2', 'csF', 'csY_n_2', 'csE', 'csX_j_2', 'csF', 'csY_n_2', 'csE', 'csF', 'csY_n_2', 'csF', 'csE', 'csF', 'csE', 'csX_j_2', 'csH', 'csY_j_2', 'csH', 'csY_j_2', 'csH', 'csY_j_2', 'csG', \</div><div>'csX_n_2', 'csH', 'csY_j_2', 'csG', 'csX_n_2', 'csH', 'csY_j_2', 'csG', 'csX_n_2', 'csH', 'csY_j_2', 'csG', 'csX_n_2', 'csH', 'csY_j_2', 'csH', 'csH', 'csY_j_2', 'csG', 'csX_n_2', 'csH', 'csY_j_2', 'csG', 'csX_n_\</div><div>2', 'csG', 'csG', 'csX_n_2', 'csH', 'csG', 'csX_n_2', 'csH', 'csY_j_2', 'csG', 'csX_n_2', 'csG', 'csG', 'csX_n_2', 'csH', 'csY_j_2', 'csG', 'csX_n_2', 'csH', 'csY_j_2', 'csH', 'csG', 'csX_n_2', 'csG']</div><div>>>> onsets</div><div>[4.2000001668930054, 7.2000002861022949, 20.400000810623169, 25.200001001358032, 39.600001573562622, 45.600001811981201, 61.800002455711365, 66.600002646446228, 80.40000319480896, 84.000003337860107, 94.800003767\</div><div>01355, 98.400003910064697, 114.000004529953, 117.00000464916229, 127.20000505447388, 132.00000524520874, 144.0000057220459, 162.00000643730164, 166.20000660419464, 178.80000710487366, 184.20000731945038, 199.8000\</div><div>0793933868, 203.40000808238983, 216.00000858306885, 219.60000872612, 230.40000915527344, 235.80000936985016, 249.60000991821289, 254.40001010894775, 270.00001072883606, 275.40001094341278, 291.00001156330109, 295\</div><div>.20001173019409, 306.00001215934753, 310.8000123500824, 327.00001299381256, 346.20001375675201, 351.60001397132874, 367.8000146150589, 386.40001535415649, 392.40001559257507, 409.80001628398895, 415.2000164985656\</div><div>7, 432.60001718997955, 451.80001795291901, 456.00001811981201, 469.20001864433289, 473.40001881122589, 487.80001938343048, 492.60001957416534, 507.00002014636993, 528.00002098083496, 532.80002117156982, 548.40002\</div><div>179145813, 606.60002410411835, 610.80002427101135, 624.00002479553223, 628.80002498626709, 640.20002543926239, 644.4000256061554, 658.20002615451813, 661.80002629756927, 673.80002677440643, 676.80002689361572, 68\</div><div>8.20002734661102, 693.00002753734589, 703.20002794265747, 707.40002810955048, 720.00002861022949, 725.40002882480621, 737.40002930164337, 740.40002942085266, 755.40003001689911, 777.00003087520599, 781.2000310420\</div><div>99, 793.20003151893616, 798.60003173351288, 811.20003223419189, 815.4000324010849, 828.60003292560577, 834.0000331401825, 846.00003361701965, 862.80003428459167, 867.00003445148468, 878.40003490447998, 897.000035\</div><div>64357758, 901.20003581047058, 917.40003645420074, 922.20003664493561, 939.60003733634949, 943.80003750324249, 955.20003795623779, 958.80003809928894, 972.60003864765167, 976.20003879070282, 989.40003931522369, 10\</div><div>08.0000400543213, 1012.2000402212143, 1025.4000407457352, 1030.8000409603119, 1043.4000414609909, 1047.0000416040421, 1062.0000422000885, 1083.0000430345535, 1087.8000432252884, 1100.4000437259674, 1119.000044465\</div><div>065, 1122.0000445842743, 1206.6000479459763, 1210.8000481128693, 1225.8000487089157, 1230.6000488996506, 1243.2000494003296, 1247.4000495672226, 1260.0000500679016, 1266.0000503063202, 1279.8000508546829, 1284.00\</div><div>00510215759, 1299.0000516176224, 1304.4000518321991, 1318.2000523805618, 1323.6000525951385, 1335.6000530719757, 1339.2000532150269, 1354.2000538110733, 1358.4000539779663, 1369.2000544071198, 1374.0000545978546,\</div><div> 1390.2000552415848, 1407.6000559329987, 1412.4000561237335, 1428.0000567436218, 1434.0000569820404, 1448.400057554245, 1453.8000577688217, 1470.0000584125519, 1485.0000590085983, 1488.0000591278076, 1504.8000597\</div><div>953796, 1510.8000600337982, 1523.4000605344772, 1527.6000607013702, 1543.2000613212585, 1547.4000614881516, 1559.4000619649887, 1564.8000621795654, 1579.20006275177, 1584.6000629663467, 1600.200063586235, 1603.20\</div><div>00637054443, 1615.2000641822815, 1618.2000643014908, 1630.8000648021698, 1634.4000649452209, 1647.6000654697418, 1662.0000660419464, 1666.2000662088394, 1679.4000667333603, 1696.2000674009323, 1714.200068116188, \</div><div>1735.2000689506531, 1741.2000691890717, 1806.6000717878342, 1809.6000719070435, 1824.000072479248, 1830.0000727176666, 1842.0000731945038, 1848.0000734329224, 1860.0000739097595, 1865.4000741243362, 1879.80007469\</div><div>65408, 1884.6000748872757, 1900.200075507164, 1904.400075674057, 1919.4000762701035, 1923.0000764131546, 1937.4000769853592, 1943.4000772237778, 1956.0000777244568, 1960.8000779151917, 1974.6000784635544, 1977.60\</div><div>00785827637, 1993.200079202652, 1998.6000794172287, 2011.2000799179077, 2026.2000805139542, 2030.4000806808472, 2042.4000811576843, 2047.800081372261, 2059.8000818490982, 2065.2000820636749, 2077.2000825405121, 2\</div><div>080.8000826835632, 2092.8000831604004, 2107.8000837564468, 2112.6000839471817, 2125.8000844717026, 2140.800085067749, 2145.000085234642, 2158.8000857830048, 2164.2000859975815, 2176.8000864982605, 2179.8000866174\</div><div>698, 2195.4000872373581, 2212.2000879049301, 2217.000088095665, 2232.6000887155533, 2235.6000888347626, 2250.0000894069672, 2254.2000895738602, 2269.8000901937485, 2274.6000903844833, 2289.0000909566879, 2306.400\</div><div>0916481018, 2311.8000918626785, 2322.0000922679901]</div><div>>>> chunks </div><div>[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\</div><div>, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \</div><div>2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,\</div><div> 3, 3, 3, 3]</div><div><br></div><div>This looks correct, no? I am trying to attach the image plot of the design matrix, split into the 4 sessions. </div><div><br></div><div>Best,</div><div><br></div><div>Wolfgang​<br><div class="gmail_chip gmail_drive_chip" style="width:396px;height:18px;max-height:18px;background-color:#f5f5f5;padding:5px;color:#222;font-family:arial;font-style:normal;font-weight:bold;font-size:13px;border:1px solid #ddd;line-height:1"><a href="https://drive.google.com/file/d/0B8RCK2g9WewxWEl5VjlFX1B1M0U/view?usp=drive_web" target="_blank" style="display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:1px 0px;border:none;width:100%"><img style="vertical-align: bottom; border: none;" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span dir="ltr" style="color:#15c;text-decoration:none;vertical-align:bottom">figure_1.png</span></a></div>​</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 9, 2016 at 5:50 PM, Yaroslav Halchenko <span dir="ltr"><<a href="mailto:debian@onerussian.com" target="_blank">debian@onerussian.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On Mon, 09 May 2016, Wolfgang Pauli wrote:<br>
<br>
> Hi,<br>
<br>
> I am trying to perform an mvpa analysis of an experiment in which I have 16<br>
> different trial types and 4 sessions, 4 trial types in each session (run).<br>
> Based on the tutorial, I was getting started by using fit_event_hrf_model,<br>
> like so:<br>
<br>
> evds = fit_event_hrf_model(ds, events, time_attr='time_coords',<br>
> condition_attr=('onset'), return_model=True)<br>
<br>
> where ds is an openfmri dataset (get_model_bold_dataset).<br>
<br>
> I was trying to figure out why I would always get the warning that the<br>
> design matrix was singular, and eventually ended up investigating the<br>
> design matrix of the model.<br>
<br>
> I used matplotlib to plot the design matrix, split it up into the four<br>
> session, and found that the four parts were IDENTICAL. What could I be<br>
> doing wrong? Obviously, it shouldn't be the same, because there are<br>
> different trial types in the four sessions, and the trial order is also<br>
> randomized.<br>
<br>
> Furthermore, the design matrix has 26 regressors. I don't quite understand<br>
> where that number is coming from, as I have 16 unique event types, and 4<br>
> sessions.<br>
<br>
<br>
</span>most probably that events definition was was the same in each of the<br>
chunks... but also note that if you do it in a dataset which has<br>
multiple chunks, you want to have condition_attr=['onset', 'chunks'] if<br>
you want to make a model per each onset x chunk pair as was demoed e.g.<br>
at  <a href="http://www.pymvpa.org/tutorial_eventrelated.html#response-modeling" rel="noreferrer" target="_blank">http://www.pymvpa.org/tutorial_eventrelated.html#response-modeling</a><br>
<br>
if you share your data, and ideally your investigation script then we<br>
could may be look deeper<br>
<span class="HOEnZb"><font color="#888888">--<br>
Yaroslav O. Halchenko<br>
Center for Open Neuroscience     <a href="http://centerforopenneuroscience.org" rel="noreferrer" target="_blank">http://centerforopenneuroscience.org</a><br>
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755<br>
Phone: <a href="tel:%2B1%20%28603%29%20646-9834" value="+16036469834">+1 (603) 646-9834</a>                       Fax: <a href="tel:%2B1%20%28603%29%20646-1419" value="+16036461419">+1 (603) 646-1419</a><br>
WWW:   <a href="http://www.linkedin.com/in/yarik" rel="noreferrer" target="_blank">http://www.linkedin.com/in/yarik</a><br>
<br>
_______________________________________________<br>
Pkg-ExpPsy-PyMVPA mailing list<br>
<a href="mailto:Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org">Pkg-ExpPsy-PyMVPA@lists.alioth.debian.org</a><br>
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa" rel="noreferrer" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa</a><br>
</font></span></blockquote></div><br></div>