Michi

Michi commited on 2012-06-03 17:10:28
Zeige 1 geänderte Dateien mit 20 Einfügungen und 2 Löschungen.

... ...
@@ -230,7 +230,25 @@ contour(Omegam_vec_A,M_vec_A,posterior_A,drawlabels=FALSE,xlab='Omegam',ylab='M'
230 230
 contour(Omegam_vec_B,M_vec_B,integration_B,add = TRUE)
231 231
 
232 232
 # Marginalize over M
233
-pOmarg=function(Oi) {I=integrate(posterior,13.0,18.0,Omegam=Oi)
234
-    return(I$value)
233
+
234
+
235
+give_function_MA=function(i) f=splinefun(M_vec_A, posterior_A[i,])
236
+give_function_MB=function(i,ii) f=splinefun(M_vec_B, posterior_B[i,,ii])
237
+
238
+
239
+integration_MA=array(0, c(values_A+1))
240
+for (i in (1:values_A)){
241
+		I=Myintegrate(give_function_MA(i),15.5,16.5)
242
+		integration_MA[i]=I
235 243
 	}
236 244
 
245
+integration_MB=array(0, c(values_B+1, values_B+1))
246
+for (i in (1:values_B)){
247
+	for (ii in (1:values_B)){
248
+		I=Myintegrate(give_function_MB(i,ii),15.5,16.5)
249
+		integration_MB[i,ii]=I
250
+	}
251
+}
252
+
253
+plto(w_vec,integration_MA)
254
+
237 255