scripts/models.py
def cov_used(mode, behav_tuple):
    """
    Create the used covariates list for different models
    """
    resamples = behav_tuple[0].shape[0]
    hd_t, w_t, s_t, x_t, y_t, time_t = behav_tuple
    
    if mode == 'hd':
        covariates = [hd_t]
        
    elif mode == 'w':
        covariates = [w_t]
        
    elif mode == 'hd_w' or mode == 'hdTw':
        covariates = [hd_t, w_t]
        
    elif mode == 'hd_w_s' or mode == 'hd_wTs':
        covariates = [hd_t, w_t, s_t]
        
    elif mode == 'hd_w_s_t':
        covariates = [hd_t, w_t, s_t, time_t]
        
    elif mode == 'hd_w_s_t_R1':
        covariates = [
            hd_t, w_t, s_t, time_t, 
            [np.random.randn(resamples, 1)*0.1, np.ones((resamples, 1))*0.01]
        ]
        
    elif mode == 'hd_w_s_pos_t':
        covariates = [hd_t, w_t, s_t, x_t, y_t, time_t]
        
    elif mode == 'hd_w_s_pos_t_R1':
        covariates = [
            hd_t, w_t, s_t, x_t, y_t, time_t, 
            [np.random.randn(resamples, 1)*0.1, np.ones((resamples, 1))*0.01]
        ]
        
    elif mode == 'hd_w_s_pos_t_R2':
        covariates = [
            hd_t, w_t, s_t, x_t, y_t, time_t, 
            [np.random.randn(resamples, 2)*0.1, np.ones((resamples, 2))*0.01]
        ]
        
    elif mode == 'hd_w_s_pos_t_R3':
        covariates = [
            hd_t, w_t, s_t, x_t, y_t, time_t, 
            [np.random.randn(resamples, 3)*0.1, np.ones((resamples, 3))*0.01]
        ]
        
    elif mode == 'hd_w_s_pos_t_R4':
        covariates = [
            hd_t, w_t, s_t, x_t, y_t, time_t, 
            [np.random.randn(resamples, 4)*0.1, np.ones((resamples, 4))*0.01]
        ]
        
    elif mode == 'hd_w_s_pos' or mode == 'hd_w_sTpos' or mode == 'hd_wTsTpos':
        covariates = [hd_t, w_t, s_t, x_t, y_t]
        
    elif mode == 'hd_t':
        covariates = [hd_t, time_t]
        
    elif mode == 'hd_w_t':
        covariates = [hd_t, w_t, time_t]
        
    elif mode == 'hdxR1':
        covariates = [
            hd_t, 
            [np.random.randn(resamples, 1)*0.1, np.ones((resamples, 1))*0.01]
        ]
        
    elif mode == 'T1xR1':   
        covariates = [
            [np.random.rand(resamples, 1)*2*np.pi, np.ones((resamples, 1))*0.01], 
            [np.random.randn(resamples, 1)*0.1, np.ones((resamples, 1))*0.01]
        ]
        
    elif mode == 'T1xt':
        covariates = [
            [np.random.rand(resamples, 1)*2*np.pi, np.ones((resamples, 1))*0.01], 
            time_t
        ]

    elif mode == 'T1': #hd_t[:, None] np.random.rand(resamples, 1)*2*np.pi
        covariates = [
            [np.random.rand(resamples, 1)*2*np.pi, np.ones((resamples, 1))*0.1]
        ]
        
    elif mode == 'R1':
        covariates = [
            [np.random.randn(resamples, 1)*0.1, np.ones((resamples, 1))*0.01]
        ]
        
    elif mode == 'R2':
        covariates = [
            [np.random.randn(resamples, 2)*0.1, np.ones((resamples, 2))*0.01]
        ]

    elif mode is None:
        covariates = []
        
    else:
        raise ValueError
        
    return covariates

    Create the used covariates list for different models
    
Create the used covariates list for different models
Create the used covariates list for different models
def cov_used(mode, behav_tuple):
    resamples = behav_tuple[0].shape[0]
    hd_t, w_t, s_t, x_t, y_t, time_t = behav_tuple
    if mode == 'hd':
        covariates = [hd_t]
    elif mode == 'w':
        covariates = [w_t]
    elif mode == 'hd_w' or mode == 'hdTw':
        covariates = [hd_t, w_t]
    elif mode == 'hd_w_s' or mode == 'hd_wTs':
        covariates = [hd_t, w_t, s_t]
    elif mode == 'hd_w_s_t':
        covariates = [hd_t, w_t, s_t, time_t]
    elif mode == 'hd_w_s_t_R1':
        covariates = [
            hd_t, w_t, s_t, time_t, 
            [np.random.randn(resamples, 1)*0.1, np.ones((resamples, 1))*0.01]
        ]
    elif mode == 'hd_w_s_pos_t':
        covariates = [hd_t, w_t, s_t, x_t, y_t, time_t]
    elif mode == 'hd_w_s_pos_t_R1':
        covariates = [
            hd_t, w_t, s_t, x_t, y_t, time_t, 
            [np.random.randn(resamples, 1)*0.1, np.ones((resamples, 1))*0.01]
        ]
    elif mode == 'hd_w_s_pos_t_R2':
        covariates = [
            hd_t, w_t, s_t, x_t, y_t, time_t, 
            [np.random.randn(resamples, 2)*0.1, np.ones((resamples, 2))*0.01]
        ]
    elif mode == 'hd_w_s_pos_t_R3':
        covariates = [
            hd_t, w_t, s_t, x_t, y_t, time_t, 
            [np.random.randn(resamples, 3)*0.1, np.ones((resamples, 3))*0.01]
        ]
    elif mode == 'hd_w_s_pos_t_R4':
        covariates = [
            hd_t, w_t, s_t, x_t, y_t, time_t, 
            [np.random.randn(resamples, 4)*0.1, np.ones((resamples, 4))*0.01]
        ]
    elif mode == 'hd_w_s_pos' or mode == 'hd_w_sTpos' or mode == 'hd_wTsTpos':
        covariates = [hd_t, w_t, s_t, x_t, y_t]
    elif mode == 'hd_t':
        covariates = [hd_t, time_t]
    elif mode == 'hd_w_t':
        covariates = [hd_t, w_t, time_t]
    elif mode == 'hdxR1':
        covariates = [
            hd_t, 
            [np.random.randn(resamples, 1)*0.1, np.ones((resamples, 1))*0.01]
        ]
    elif mode == 'T1xR1':   
        covariates = [
            [np.random.rand(resamples, 1)*2*np.pi, np.ones((resamples, 1))*0.01], 
            [np.random.randn(resamples, 1)*0.1, np.ones((resamples, 1))*0.01]
        ]
    elif mode == 'T1xt':
        covariates = [
            [np.random.rand(resamples, 1)*2*np.pi, np.ones((resamples, 1))*0.01], 
            time_t
        ]
    elif mode == 'T1': 
        covariates = [
            [np.random.rand(resamples, 1)*2*np.pi, np.ones((resamples, 1))*0.1]
        ]
    elif mode == 'R1':
        covariates = [
            [np.random.randn(resamples, 1)*0.1, np.ones((resamples, 1))*0.01]
        ]
    elif mode == 'R2':
        covariates = [
            [np.random.randn(resamples, 2)*0.1, np.ones((resamples, 2))*0.01]
        ]
    elif mode is None:
        covariates = []
    else:
        raise ValueError
    return covariates
def cov_used ( mode , behav_tuple ) : resamples = behav_tuple [ 0 ] . shape [ 0 ] hd_t , w_t , s_t , x_t , y_t , time_t = behav_tuple if mode == 'hd' : covariates = [ hd_t ] elif mode == 'w' : covariates = [ w_t ] elif mode == 'hd_w' or mode == 'hdTw' : covariates = [ hd_t , w_t ] elif mode == 'hd_w_s' or mode == 'hd_wTs' : covariates = [ hd_t , w_t , s_t ] elif mode == 'hd_w_s_t' : covariates = [ hd_t , w_t , s_t , time_t ] elif mode == 'hd_w_s_t_R1' : covariates = [ hd_t , w_t , s_t , time_t , [ np . random . randn ( resamples , 1 ) * 0.1 , np . ones ( ( resamples , 1 ) ) * 0.01 ] ] elif mode == 'hd_w_s_pos_t' : covariates = [ hd_t , w_t , s_t , x_t , y_t , time_t ] elif mode == 'hd_w_s_pos_t_R1' : covariates = [ hd_t , w_t , s_t , x_t , y_t , time_t , [ np . random . randn ( resamples , 1 ) * 0.1 , np . ones ( ( resamples , 1 ) ) * 0.01 ] ] elif mode == 'hd_w_s_pos_t_R2' : covariates = [ hd_t , w_t , s_t , x_t , y_t , time_t , [ np . random . randn ( resamples , 2 ) * 0.1 , np . ones ( ( resamples , 2 ) ) * 0.01 ] ] elif mode == 'hd_w_s_pos_t_R3' : covariates = [ hd_t , w_t , s_t , x_t , y_t , time_t , [ np . random . randn ( resamples , 3 ) * 0.1 , np . ones ( ( resamples , 3 ) ) * 0.01 ] ] elif mode == 'hd_w_s_pos_t_R4' : covariates = [ hd_t , w_t , s_t , x_t , y_t , time_t , [ np . random . randn ( resamples , 4 ) * 0.1 , np . ones ( ( resamples , 4 ) ) * 0.01 ] ] elif mode == 'hd_w_s_pos' or mode == 'hd_w_sTpos' or mode == 'hd_wTsTpos' : covariates = [ hd_t , w_t , s_t , x_t , y_t ] elif mode == 'hd_t' : covariates = [ hd_t , time_t ] elif mode == 'hd_w_t' : covariates = [ hd_t , w_t , time_t ] elif mode == 'hdxR1' : covariates = [ hd_t , [ np . random . randn ( resamples , 1 ) * 0.1 , np . ones ( ( resamples , 1 ) ) * 0.01 ] ] elif mode == 'T1xR1' : covariates = [ [ np . random . rand ( resamples , 1 ) * 2 * np . pi , np . ones ( ( resamples , 1 ) ) * 0.01 ] , [ np . random . randn ( resamples , 1 ) * 0.1 , np . ones ( ( resamples , 1 ) ) * 0.01 ] ] elif mode == 'T1xt' : covariates = [ [ np . random . rand ( resamples , 1 ) * 2 * np . pi , np . ones ( ( resamples , 1 ) ) * 0.01 ] , time_t ] elif mode == 'T1' : covariates = [ [ np . random . rand ( resamples , 1 ) * 2 * np . pi , np . ones ( ( resamples , 1 ) ) * 0.1 ] ] elif mode == 'R1' : covariates = [ [ np . random . randn ( resamples , 1 ) * 0.1 , np . ones ( ( resamples , 1 ) ) * 0.01 ] ] elif mode == 'R2' : covariates = [ [ np . random . randn ( resamples , 2 ) * 0.1 , np . ones ( ( resamples , 2 ) ) * 0.01 ] ] elif mode is None : covariates = [ ] else : raise ValueError return covariates
Create the used covariates list for different models
Create the used covariates list for different models
"""
    Create the used covariates list for different models
    """ #hd_t[:, None] np.random.rand(resamples, 1)*2*np.pi
mode
behav_tuple