全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1772 0
2013-10-07
The pdf , and cdf fuction call is a lot of slower than I thought. Here are bench marks
PDF call vs. a formula
ratio=2.32/1.81=1.28   30% slower

CDF call vs. probnorm call

ratio=3.77/1.62=2.33  133% slower.


2431  data _null_;
2432     do i=1 to 1e7;
2433        x=rannor(123);
2434        pdf=pdf('normal',x);
2435       * pdf2=1/sqrt(2*constant('pi'))*exp(-x**2/2);
2436  /*    put pdf= pdf2=;*/
2437        end;
2438        run;

NOTE: DATA statement used (Total process time):
      real time           2.35 seconds
      cpu time            2.32 seconds


2439
2440  data _null_;
2441     do i=1 to 1e7;
2442        x=rannor(123);
2443        *pdf=pdf('normal',x);
2444        pdf2=1/sqrt(2*constant('pi'))*exp(-x**2/2);
2445  /*    put pdf= pdf2=;*/
2446        end;
2447        run;

NOTE: DATA statement used (Total process time):
      real time           1.81 seconds
      cpu time            1.81 seconds


2448
2449  data _null_;
2450     do i=1 to 1e7;
2451        x=rannor(123);
2452        cdf=cdf('normal',x);
2453  /*      cdf2=probnorm(x);*/
2454  /*    put cdf= cdf2=;*/
2455        end;
2456        run;

NOTE: DATA statement used (Total process time):
      real time           3.78 seconds
      cpu time            3.77 seconds


2457
2458
2459  data _null_;
2460     do i=1 to 1e7;
2461        x=rannor(123);
2462       * cdf=cdf('normal',x);
2463        cdf2=probnorm(x);
2464  /*    put cdf= cdf2=;*/
2465        end;
2466        run;

NOTE: DATA statement used (Total process time):
      real time           1.63 seconds
      cpu time            1.62 seconds


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群