Пример #1
0
    # Convolve with HRF
    df = convolve_hrf(df, dg(), asbold)
    
    # Orth select regressors
    to_orth = [['box', bold] for bold in asbold if bold != 'box']
    for orth in to_orth:
        df[orth[1]+'_o'] = orthogonalize(df, orth)[orth[1]]
    
    # Do the regressions    
    n_results = {}
    for model_name, model, test, hypoth in zip(*model_configs):
        for bold_name in asbold:
            l = df.shape[0]
            noi, prng = white(l, prng=prng)

            df['bold'] = create_bold([df[bold_name].values], None, noi)

            smo = smf.ols(model, data=df).fit()
            print(smo.summary2())
            
            stato = None
            if test == 't':
                stato = smo.t_test(hypoth)
            elif test == 'F':
                stato = smo.f_test(hypoth)
            elif test is not None:
                raise ValueError("Unknown test")
            
            savedf = None
            if args.save_behave: 
                savedf = df 
Пример #2
0
    # creates the BOLD.  The second creates
    # the predictors.
    for alpha_bold in alphas:
        # Create all bold options
        df_bold, _ = reinforce.rescorla_wagner(trials,
                                               acc,
                                               p,
                                               alpha=alpha_bold,
                                               prng=prng)

        # Iter options
        for bold_name in asbold:
            l = df_bold.shape[0]
            noi, prng = white(l, prng=prng)

            df_bold['bold'] = create_bold([df_bold[bold_name].values], dg(),
                                          noi)

            # Create predictor
            for alpha_pred in alphas:
                df_pred, _ = reinforce.rescorla_wagner(trials,
                                                       acc,
                                                       p,
                                                       alpha=alpha_pred,
                                                       prng=prng)

                df_pred = convolve_hrf(df_pred, dg(), asbold)

                # Orth select predictors
                to_orth = [['box', too] for too in asbold if too != 'box']
                for orth in to_orth:
                    df_pred[orth[1] + '_o'] = orthogonalize(df_pred,
Пример #3
0
    # creates the BOLD.  The second creates
    # the predictors.
    for alpha_bold in alphas:            
        # Create all bold options
        df_bold, _ = reinforce.rescorla_wagner(
                trials, acc, p, 
                alpha=alpha_bold, prng=prng
                )
        
        # Iter options
        for bold_name in asbold:
            l = df_bold.shape[0]
            noi, prng = white(l, prng=prng)
            
            df_bold['bold'] = create_bold(
                    [df_bold[bold_name].values], dg(), noi
                    )
            
            # Create predictor
            for alpha_pred in alphas:
                df_pred, _ = reinforce.rescorla_wagner(
                        trials, acc, p, 
                        alpha=alpha_pred, prng=prng
                        )

                df_pred = convolve_hrf(df_pred, dg(), asbold)
                
                # Orth select predictors
                to_orth = [['box', too] for too in asbold if too != 'box']
                for orth in to_orth:
                    df_pred[orth[1]+'_o'] = orthogonalize(
Пример #4
0
    df = convolve_hrf(df, dg(), asbold)
    
    # Orth select regressors
    to_orth = [['box', too] for too in asbold if too != 'box']
    for orth in to_orth:
        df[orth[1]+'_o'] = orthogonalize(df, orth)[orth[1]]
    
    # Do the regressions    
    n_results = {}
    for model_name, model, test, hypoth in zip(*model_configs):
        for bold_name in asbold:
            l = df.shape[0]
            noi, prng = white(l, prng=prng)

            # Make bold
            df['bold'] = create_bold([df[bold_name].values], None, noi)

            # Regress
            smo = smf.ols(model, data=df).fit()
            print(smo.summary2())

            # Hypoth test
            stato = None
            if test == 't':
                stato = smo.t_test(hypoth)
            elif test == 'F':
                stato = smo.f_test(hypoth)
            elif test is not None:
                raise ValueError("Unknown test")

            # Reformat