Pa [p]가 ASN [P]를 숫자 값으로 출력하려면 어떻게해야합니까? 코드가 아래와 같습니다. 뿌리, PA2 [p] 및 ANS2 [p]는 i 색인을 사용하여 으로 작성됩니다.다중 인덱스를 사용한 수학 인쇄
MMA CODE : ****************
Clear[x, y, p];
x := BinomialDistribution[n1, p];
y := BinomialDistribution[n2, p];
Pa[p_] := CDF[x, c1] + Sum[PDF[x, j]*CDF[y, c2 - j], {j, c1 + 1, c2}];
Print[TableForm[Table[{p, Pa[p]}, {p, .01, .1, .01}],
TableHeadings -> {None, {"p", "Pa[p]"}}]];
ASN[p_] := n1*1 + n2* CDF[x, c2] - CDF[x, c1];
Print[TableForm[Table[{p, ASN[p]}, {p, .01, .1, .01}],
TableHeadings -> {None, {"p", "ASN[p]"}}]];
p = {.01, .02, .03, .04, .05, .06, .07, .08, .09, .1};
Print[TableForm[
Table[ {r2[[i]], p[[i]], Pa[[i]], ASN[[i]], Pa2[[i]],ASN2[[i]] },
{i, 1,10,1}],
TableHeadings -> {None, {"roots", "p", "Pa[p]","ASN[p]","PA2[p]","ASN2[p]"} } ]];
MMA 출력 : *****************
p Pa[p]
0.01 0.980277
0.02 0.817478
0.03 0.555413
0.04 0.327922
0.05 0.177956
0.06 0.0916007
0.07 0.0453877
0.08 0.0217882
0.09 0.0101644
0.1 0.00461704
p ASN[p]
0.01 178.866
0.02 176.136
0.03 167.438
0.04 153.427
0.05 137.505
0.06 122.884
0.07 111.274
0.08 102.986
0.09 97.5368
0.1 94.1847
roots p Pa[p] ASN[p] PA2[p] ASN2[p]
1.17508 0.01 Pa$1660[[1]] ASN$1660[[1]] 0.977398 64.4721
0.472821 0.02 Pa$1660[[2]] ASN$1660[[2]] 0.840606 84.1587
0.000638883 0.03 Pa$1660[[3]] ASN$1660[[3]] 0.583404 89.3915
-0.3770350 0.04 파 1,660 $ 1,660 [4] ASN $ 1,660 [4] 0.340761 79.3716 -0.7039350 .05 파 $으로 [5] ASN $ 1,660 [5] 0.185355 65.0975 - 1. 0.06 Pa $ 1660 [6] ASN $ 1660 [6] 0.1 52.7007 -1.27609 0.07 Pa $ 1660 [[7]] 0.0547126 43.2261 -1.5388 0.08 Pa $ 1660 [[8]] ASN $ 1660 [8] 0.0304681 36.1651 -1.79248 0.09 파를 $ 1,660 [9] ASN $ 1,660 [9] 0.017227 30.8583 -2.04012 0.1 파를 [10] ASN $ 1,660 [10] 0.00985218 26.7938
안녕하세요, 시도했지만 오류가 발생했습니다. BinomialDistribution :: probparm : 매개 변수 {0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1}은 0과 1 사이의 확률이 될 것으로 예상됩니다.> 벡터의 한 요소를 추출합니다. CDF [BinomialDistribution [90, {0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1}], 2] + ... Mary –
표기법을 확인하십시오. 아무 것도 없습니다. 오류. – Timo