def funcO5(self, val): Pared_val = np.hstack( (self.Data_Grid[:, 2].reshape(-1, 1), val.reshape(-1, 1))) bivariate_distribution_s = cond.ot_copula_fit(Pared_val) conditioned_dist_t = cond.ot_compute_conditional( val, self.bivariate_distribution_data, self.Data_Grid) conditioned_dist_s = cond.ot_compute_conditional( val, bivariate_distribution_s, self.Data_Grid) O5 = np.sum((conditioned_dist_s - conditioned_dist_t)**2) return O5
print("Bivariate Distributions from DATA: ") print("----------------------------------------------------------------------") print("Marginal for Ip(data_grid) =", marginal_data[0]) print("Marginal for Phit(Var) =", marginal_data[1]) print("Copula for marginals =", copula_data) print("----------------------------------------------------------------------") print("Simulate Bivariate Distributions information: ") print("----------------------------------------------------------------------") print("Estimate marginal for Ip(data_grid) =", marginal_s[0]) print("Estimate marginal for Phit(Var) =", marginal_s[1]) print("Estimate copula for marginals =", copula_s) print("----------------------------------------------------------------------") #Conditional_PDF# conditioned_pdf_s = cond.ot_compute_conditional(Phits, bivariate_distribution_s, Data_Grid) conditioned_pdf = cond.ot_compute_conditional(Phits, bivariate_distribution_data, Data_Grid) graf.Scater(Phits, conditioned_pdf_s, conditioned_pdf, limit_x=limit_Phit) #Conditional_CDF# conditioned_cdf_s = cond.ot_compute_conditional_cdf(Phits, bivariate_distribution_s, Data_Grid) conditioned_cdf = cond.ot_compute_conditional_cdf(Phits, bivariate_distribution_data, Data_Grid) graf.Scater(Phits, conditioned_cdf_s,