def rbf(self, data): self.gene_index += 2 return (gauss(data, (self.genes[self.gene_index - 2] + 1) / 2, (self.genes[self.gene_index - 1] + 1) / 2) - 0.5) * 2
def rbf(self, data): self.gene_index += 3 return self.genes[self.gene_index-3] * gauss(data, (self.genes[self.gene_index - 2] + 1) / 2, (self.genes[self.gene_index - 1] + 1) / 2)
def rbf(self, data): self.gene_index += 3 return self.genes[self.gene_index - 3] * gauss( data, (self.genes[self.gene_index - 2] + 1) / 2, (self.genes[self.gene_index - 1] + 1) / 2)
#--- histograma hc, hx_ = np.histogram(ne, bins=50, density=True) hx = 0.5*(hx_[:-1] + hx_[1:]) # `hx` son los valores centrados de c/bin #--- parametros de la red real #N_e = ff.count_essential_nodes(fname_graph, fname_ess) # nodos esenciales N_ie = ff.calc_ne(g=graph, fname_ess=fname_ess) # interacc esenciales alpha_mean = (N_ie - fit_mu)/n_nodes alpha_err = fit_sigma/n_nodes fig = figure(1, figsize=(6,4)) ax = fig.add_subplot(111) ax.plot(hx, hc, '-ob', label='realizaciones') ax.plot(hx, ff.gauss(hx, 1., fit_mu, fit_sigma), '-r', lw=3, alpha=0.6, label='ajuste') ax.axvline(N_ie, ls='--', c='black', lw=3, label='real') ax.grid(True) ax.legend(loc='best') ax.set_xlabel('numero de interacciones entre proteinas esenciales') ax.set_ylabel('densidad de probabilidad') fig.savefig(pa.fname_fig, format='png', dpi=200, bbox_inches='tight') close(fig) print('alpha: %3.2f +- %3.2f'%(100.*alpha_mean, 100.*alpha_err)) #EOF