作者weiching0323 (許惟妮)
看板FJU-STAT95B
標題[專業] 5/4無母數課堂筆記15:40-16:30
時間Tue May 4 15:53:52 2010
================================從以下開始複製=================================
#include <C:\devcpp\all.h>
int main()
{
long int i, j;
srand((unsigned)time(NULL));
cout.setf(ios::fixed); cout.precision(10);
// $$$$$$$$ Start your program here $$$$$$$$$$$$$$$$$$$$$
double x[12] = {0,1,1,0,-2,6,7,7,4,-3,9,14};
Univar X(12,x);
double ind[12] = {1,1,1,1,1,0,0,0,0,0,0,0};
Univar IND(12,ind);
IND.print(0);
double C = 0.0;
Univar T1;
do
{
T1.push_back( X * IND );
C++;
}while(prev_permutation(IND.begin(),IND.end()));
cout << "number of permutation is " << C << endl;
cout << exp(ln_comb(12,5)) << endl;
T1.freq_dist();
cout << "P_value = " << endl;
cout.precision(4);
cout << 2.0*T1.emp_CDF(0) << endl;
Univar T2;
for(i=0; i < 10000; i++)
{
IND.shuffle();
T2.push_back( X * IND );
}
T2.freq_dist();
Univar t = time_axis(-4,43,1);
multi_dis G(t);
G.push_freq_dist(T1.freq_dist());
G.push_freq_dist(T2.freq_dist());
// G.print_to_file("c:\\devcpp\\G.dat",5);
cout << "Monte Carlo P_value = " << endl;
cout.precision(5);
cout << 2.0*T2.emp_CDF(0) << endl;
// $$$$$$$ End of your program $$$$$$$$$$$$$$$$$$$$$$$$$
==================================複製結束====================================
上色是新的
請繼續follow^_<
又要開EXCLE 畫圖了
**今天畫圖不要用平滑線**
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.136.161.83
推 ww770829:揪甘心 05/04 16:02
※ 編輯: weiching0323 來自: 140.136.161.83 (05/04 16:04)
→ weiching0323:今天的問題好難喔ˊˋ 05/04 16:10
噓 seankevin:一樓交大哥快回答 05/04 16:17
→ seankevin:等等補推 05/04 16:17
推 seankevin:我補 05/04 16:20
推 ww770829:讓政大跟成大的來吧ˊˋ 05/04 16:22