Ejemplo n.º 1
0
def model_fit(model, ds, bold_transient=10000, fc=True, fcd=False):
    result = {}
    if fc:
        result["fc_scores"] = [
            func.matrix_correlation(
                func.fc(model.BOLD.BOLD[:,
                                        model.BOLD.t_BOLD > bold_transient]),
                fc) for i, fc in enumerate(ds.FCs)
        ]
        result["mean_fc_score"] = np.mean(result["fc_scores"])

    if fcd:
        fcd_sim = func.fcd(model.BOLD.BOLD[:,
                                           model.BOLD.t_BOLD > bold_transient])
        # if the FCD dataset is already computed, use it
        if hasattr(ds, "FCDs"):
            fcd_scores = [
                func.matrix_kolmogorov(
                    fcd_sim,
                    fcd_emp,
                ) for fcd_emp in ds.FCDs
            ]
        else:
            fcd_scores = [
                func.ts_kolmogorov(
                    model.BOLD.BOLD[:, model.BOLD.t_BOLD > bold_transient],
                    bold) for bold in ds.BOLDs
            ]
        fcd_meanScore = np.mean(fcd_scores)

        result["fcd"] = fcd_scores
        result["mean_fcd"] = fcd_meanScore

    return result
Ejemplo n.º 2
0
 def test_matrix_kolmogorov(self):
     func.matrix_kolmogorov(func.fc(self.model.rates_exc[::20, :]),
                            func.fc(self.model.rates_exc[::20, :]))