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 n_results.update(merge_results( 'bold:'+bold_name + '_' + 'model:'+model_name, model, smo, df=savedf, stato=stato, other=rlpars )) results.update({str(n) : n_results}) write_hdf(results, str(args.name))
# Hypoth 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 and update store savedf = None if args.save_behave: savedf = df_pred n_results.update( merge_results('_'.join([ bold_name, str(alpha_bold), model_name, str(alpha_pred) ]), model, smo, df=savedf, stato=stato, other=None)) # Upate iter store results.update({str(n): n_results}) # Write results at the end (only) write_hdf(results, str(args.name))
# Hypoth 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 and update store savedf = None if args.save_behave: savedf = df_pred n_results.update(merge_results( '_'.join([ bold_name, str(alpha_bold), model_name, str(alpha_pred)] ), model, smo, df=savedf, stato=stato, other=None )) # Upate iter store results.update({str(n) : n_results}) # Write results at the end (only) write_hdf(results, str(args.name))
# 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 savedf = None if args.save_behave: savedf = df n_results.update(merge_results( bold_name + '_' + model_name, model, smo, df=savedf, stato=stato, other=rlpars )) results.update({str(n) : n_results}) write_hdf(results, str(args.name))