Beispiel #1
0
def cSpace(d, ce, ue, cmode='istac', clevel=3):
    ceisgrp = type(ce) in [tuple, list]
    ueisgrp = type(ue) in [tuple, list]
    comp = DRMODES[cmode]
    nc = _keys(d, 'c')
    cd = gd.Doc()
    if ceisgrp:
        cea = eqrc([d[n]['_'] for n in ce])
    else:
        cea = d[ce]['_']
    if ueisgrp:
        uea = eqrc([d[n]['_'] for n in ue])
    else:
        uea = d[ue]['_']
    iss = comp(cea, uea, clevel)
    n = len(nc)
    cn = "c%i" % n
    cd[cn + '._'] = iss.transpose()
    if ceisgrp:
        cd[cn + '.primary'] = "union%s" % (str(tuple(ce)),)
    else:
        cd[cn + '.primary'] = ce
    cd[cn + '.method'] = cmode
    cd[cn + '.order'] = clevel
    if ueisgrp:
        cd[cn + '.reference'] = "union%s" % (str(tuple(ue)),)
    else:
        cd[cn + '.reference'] = ue
    return cd
Beispiel #2
0
def cSpaceSet(d, cmode='istac', clevel=3):
    #FIXME: assumes particular structure for D. Should be a transform.
    uc1 = ucse(d['s1'], 10000, LENGTH)
    uc2 = ucse(d['s2'], 10000, LENGTH)
    rc1 = ece(d['s1'], d['evts1'], LENGTH, LEAD)
    rc2 = ece(d['s2'], d['evts2'], LENGTH, LEAD)
    istacs = {}
    istacs['uc'] = comp(uc2, uc1, clevel)
    istacs['rc'] = comp(rc2, rc1, clevel)
    istacs['c1'] = comp(rc1, uc1, clevel)
    istacs['c2'] = comp(rc2, uc2, clevel)
    istacs['j'] = comp(eqrc((rc1, rc2)), np.column_stack([uc1, uc2]), clevel)
    return istacs
Beispiel #3
0
def comp2s(stim1, evts1, stim2, evts2, length=LENGTH, lead=LEAD, compress='no', clevel=0, testprop=TESTPROP,
           bootstrap=BOOTSTRAP, report=None):
    '''
    Like compare, but considers the case where there are two stimuli in
    addition to two response sets
    '''
    rc1 = ece(stim1, evts1, length, lead)
    rc2 = ece(stim2, evts2, length, lead)
    if compress in DRMODES:
        uc = np.column_stack([ucse(stim1, 10000, length),
                              ucse(stim2, 10000, length)])
        ce = eqrc((rc1, rc2))
        cspace = DRMODES[compress](ce, uc, clevel)
        if report:
            report('Using %i components' % cspace.shape[0])
        rc1 = np.dot(cspace, rc1)
        rc2 = np.dot(cspace, rc2)
    return lltest(rc1, rc2, testprop, bootstrap)
Beispiel #4
0
def bigFig(m1, m2, compress='istac', clevel=.85):
    stim = gwn.getstim('bl')
    uc = ucse(stim)
    rcse = evalSystem(m1, True, cid=0)
    rcse2 = evalSystem(m2, True, cid=1)
    rc = eqrc((rcse, rcse2))
    iss = DRMODES[compress](rc, uc, clevel)
    report('Using %i components' % iss.shape[0])
    plt.figure(3)
    plt.clf()
    ll = lltest(rcse, rcse2)
    _prow(rcse, rcse2, 0, 3, True, ll)
    rc1 = np.dot(iss, rcse)
    rc2 = np.dot(iss, rcse2)
    ll = lltest(rc1, rc2)
    _prow(rc1, rc2, 1, 3, True, ll)
    rcb1 = np.dot(iss.transpose(), rc1)
    rcb2 = np.dot(iss.transpose(), rc2)
    #ll = lltest(rcb1, rcb2)
    _prow(rcb1, rcb2, 2, 3, True, ll)
    f = plt.figure(3)
    f.subplots_adjust(left=.04, right=.99, bottom=.05, top=.99, wspace=.05, hspace=.05)
    f.canvas.draw()