⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmlprof.src

📁 没有说明
💻 SRC
📖 第 1 页 / 共 2 页
字号:
            errorlog "ERROR: no feasible points left in profile";
        endif;
        retp(x_ret,f_ret,g_ret,h_ret,ret_ret);
    else;
        protplot = real(protplot);
    endif;

#ifunix
    if sysstate(26,0) == 2;
        fonts("simplex simgrma");
        if rows(LnlpmSelect) == 1;
            oaw = WinGetActive;
            vv = { 100,100,640,480,40,80,1,6,15,0,0,2,2 };
            call WinSetActive(WinOpenPQG(vv,"Coefficient 1","ProPlot"));
            xy(ctp,protplot);
            call WinSetActive(oaw);
            retp(x_ret,f_ret,g_ret,h_ret,ret_ret);
        endif;
        oaw = WinGetActive;
        vv = { 100,100,640,480,40,80,1,6,15,0,0,2,2 };
        i = 1;
        do until i > rows(LnlpmSelect);
            is = LnlpmSelect[i];
            if Lnlpactv[is] == 0;
                i = i + 1;
                continue;
            endif;
            stri = ftos(is,"%*.*lf",1,0);
            call WinSetActive(WinOpenPQG(vv,stri,"ProPlot"));
            ylabel("\202\116\034\081\118");
            xlabel("\201Coefficient "$+stri);
            _pframe = 1;
            _paxes = 1;
            title("\201Profile T Plot");
            call xy(ctp[.,i],protplot[.,i]);
            vv[1:2] = vv[1:2] + 20;
            i = i + 1;
        endo;
        call WinSetActive(oaw);
    else;
        if not trapchk(4);
            errorlog "CMLProfile:  graph not produced - not in windows"\
                " environment";
        endif;
    endif;
#else

    if rows(LnlpmSelect) == 1;
        xy(ctp,protplot);
        retp(x_ret,f_ret,g_ret,h_ret,ret_ret);
    endif;
#endif

    i = 2;
    do until i > rows(LnlpmSelect);
        is = LnlpmSelect[i];
        if Lnlpactv[is] == 0;
            i = i + 1;
            continue;
        endif;

        stri = ftos(is,"%*.*lf",1,0);
        tt0 = ftos(_cml_NumCat,"%0*.*lf",1,0);
        j = 1;
        do while j < i;
            js = LnlpmSelect[j];
            if Lnlpactv[js] == 0;
                j = j + 1;
                continue;
            endif;

            strj = ftos(js,"%- *.*lf",1,0);
            actv = ones(rows(x),1);
            actv[is] = 0;
            if not(Lnlpactv == 1);
                actv = Lnlpactv .* actv;
            endif;
            tt1 = 1;
            k = 1;
            do until k > _cml_NumCat;

                start = x;
                start[is] = ctp[k,i];
                title0 = __title $+ " - likelihood trace - " $+ ftos(tt1,"%"\
                    "0*.*lf",1,0) $+ " of " $+ tt0 $+ " -";
                tt1 = tt1 + 1;

                if _pf_feasible(start);

                    { x1,L1,L1,L1,ret1,L1,L1,L1,L1,L1,L1 } = _CML(dataset,
                        var,lfct,start, _cml_Algorithm, 0, _cml_Delta,
                        _cml_Extrap, _cml_GradMethod, _cml_GradProc,
                        _cml_DirTol, _cml_HessProc, _cml_Interp, _cml_Key,
                        _cml_Lag, _cml_MaxIters, _cml_MaxTime, _cml_MaxTry,
                        _cml_NumObs, _cml_ParNames,
                        _cml_LineSearch, _cml_Options, _cml_UserSearch,
                        _cml_UserNumGrad, _cml_UserNumHess, actv,
                        _cml_GradStep, _cml_GradCheckTol, __altnam, LLoutput,
                        __row, title0, __weight );

                    if ret1 == 0;
                        proLikeTr[k,1] = x1[js];
                    endif;
                endif;
                k = k + 1;
            endo;

            actv = ones(rows(x),1);
            actv[js] = 0;
            if not(Lnlpactv == 1);
                actv = Lnlpactv .* actv;
            endif;
            tt1 = 1;
            k = 1;
            do until k > _cml_NumCat;
                start = x;
                start[js] = ctp[k,j];
                title0 = __title $+ " - Likelihood trace - " $+ ftos(tt1,"%"\
                    "0*.*lf",1,0) $+ " of " $+ tt0 $+ " -";
                tt1 = tt1 + 1;

                if _pf_feasible(start);

                    { x1,L1,L1,L1,ret1,L1,L1,L1,L1,L1,L1 } = _CML(dataset,
                        var,lfct,start, _cml_Algorithm, 0, _cml_Delta,
                        _cml_Extrap, _cml_GradMethod, _cml_GradProc,
                        _cml_DirTol, _cml_HessProc, _cml_Interp, _cml_Key,
                        _cml_Lag, _cml_MaxIters, _cml_MaxTime, _cml_MaxTry,
                        _cml_NumObs, _cml_ParNames,
                        _cml_LineSearch, _cml_Options, _cml_UserSearch,
                        _cml_UserNumGrad, _cml_UserNumHess, actv,
                        _cml_GradStep, _cml_GradCheckTol, __altnam, LLoutput,
                        __row, title0, __weight );

                    if ret1 == 0;
                        proLikeTr[k,2] = x1[is];
                    else;
                        proLikeTr[k,2] = error(0);
                    endif;
                endif;
                k = k + 1;
            endo;

#ifunix
            if sysstate(26,0) == 2;
                _pframe = 0;
                _paxes = 1;

                ylabel("\201Coefficient "$+stri);
                xlabel("\201Coefficient "$+strj);
                title("Likelihood Profile Trace");
                call WinSetActive(WinOpenPQG(vv,stri$+" by "$+strj,"LikeTr"));
                xy(ctp[.,j]~proLikeTr[.,1],proLikeTr[.,2]~ctp[.,i]);
                call WinSetActive(oaw);
            endif;
#else

            begwind;
            _pmsgstr = "";
            _pmsgctl = 0;
            title("");

            makewind(4.2,3,.2,3.3,0);
            makewind(3.2,3.2,.2,.1,0);
            makewind(3.2,3.2,4.4,.1,0);
            makewind(9,6.855,0,0,1);

            fonts("simplex simgrma");

            _pframe = 0;
            _paxes = 1;

            ylabel("\201Coefficient "$+stri);
            xlabel("\201Coefficient "$+strj);
            title("Likelihood Profile Trace");
            xy(ctp[.,j]~proLikeTr[.,1],proLikeTr[.,2]~ctp[.,i]);

            nextwind;

            ylabel("\202\116\034\081\118");
            xlabel("\201Coefficient "$+stri);
            _pframe = 1;
            _paxes = 1;
            title("\201Profile T Plot");
            call xy(ctp[.,i],protplot[.,i]);

            nextwind;

            ylabel("\202\116\034\081\118");
            xlabel("\201Coefficient "$+strj);
            _pframe = 1;
            _paxes = 1;
            title("\201Profile T Plot");
            call xy(ctp[.,j],protplot[.,j]);

            nextwind;

            ylabel("");
            xlabel("");
            title(title1);
            _pmsgstr = "\201Coefficients\000"$+strj$+" vs. "$+stri;
            _pmsgctl = { 5 5 .3 0 2 15 5, 5.7 4.55 .2 0 2 15 5 };
            _paxes = 0;
            _pframe = 0;

            draw;

            endwind;
#endif
            j = j + 1;
        endo;
        i = i + 1;
    endo;

#ifunix
    if sysstate(26,0) == 2;
        call WinSetActive(oaw);
    endif;
#endif

    retp(x_ret,f_ret,g_ret,h_ret,ret_ret);
endp;

proc _pf_feasible(x);
    local ineqproc;
    if not scalmiss(_cml_C);
        if not((_cml_C*x - _cml_D) >= 0);
            retp(0);
        endif;
    endif;
    if not scalmiss(_cml_IneqProc);
        ineqproc = _cml_IneqProc;
        local ineqproc:proc;
        if not(IneqProc(x) >= 0);
            retp(0);
        endif;
    endif;
    if cols(_cml_Bounds) == 2;
        if not((x - _cml_Bounds[.,1]) >= 0);
            retp(0);
        endif;
        if not((-x + _cml_Bounds[.,2]) >= 0);
            retp(0);
        endif;
    endif;
    retp(1);
endp;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -