全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1052 0
2012-05-14
The mixed distribution model can be thought as region switch model. Here is a MLE for a two normal mixed distribution.


data tmp;
   do i = 1 to 5000;
       x1=rannor(123); x2=4+1.5*rannor(123);
       s=ranuni(123)<0.3;
       y=s*x1+(1-s)*x2;
       output;
    end;
run;

   proc nlmixed data=tmp;
      parms  c0=1  s1 s2=2 prob=0.5 ;
      bounds s1 s2 >0,0<prob<1;

      pdf1=( 1/( s1*sqrt(2*constant('pi')) ) *exp(-0.5*( (y)/s1) **2) );
      pdf2=( 1/( s2*sqrt(2*constant('pi')) ) *exp(-0.5*( (y-c0)/s2) **2) );

      ll= prob *  pdf1 + (1-prob)*pdf2;

      loglik=log(ll);

      model y ~ general(loglik);
run;
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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