亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fit_model_hier_hmm_maineffects.m

?? The BNL toolbox is a set of Matlab functions for defining and estimating the parameters of a Bayesi
?? M
字號:
%main file for estimation prob graphical models
%here, the hierarchical hidden markov model with time interval as a covariate for transitions between signals is taken as an example
%see the examples in the example map for other specific models
%or define your own model
%to be done for each model
    %1.load data 
    %2.define bayes net (model structure)
    %3.define equivalence sets of nodes, and link function and design
        %matrix for each equivalent set
    %4. estimation, automatic after speciofication of 1-3
    %5. postestimation: compute standard errors, save results 

%%%%%
%1.load data
%%%%%
    %obs_variables: the observed variables that are nodes in the
    %graphical model
    %obs_variables is structure :
        %obs_variables.names: cell array of names (does not have to be
        %defined)
        %obs_variables.datamatrix: 'wide' format datamatrix, there is a
            %separate row for each independent case (e.g. two repeated
            %measurements defines two separate variables)
            %missings are coded by the value -1
        
    %matlab import wizard can be used to import data from e.g. excel
    obs_variables=loadtimesamplingdata; %function to read the time sampling data of Rijmen, vansteelandt, De Boeck
    
    %covariates: the covariates, variables that vary over cases
    %but that are themselves not included as separate nodes in the network
    %covariates.names: cell array of names
    %covariates.matrix: again 'wide' format.
    %covariates=struct([]); %default
    covariates=loadtime; %function to read the time covariate of Rijmen, vansteelandt, De Boeck
        
%%%%%       
%2.define bayes net (model structure)
%%%%%

    %specify bayes net using one of the construct_bnet functions or use your own
        %here: the hierarchical latent
        %markov model with multiple indicators of rijmen et al, 2005
    %specifications of options for the construct_bnet function that is used. 
    S_signal=2;% number of latent states at signal level
    S_day=2; %number of latent states at day-level
    B=9; %number of signals in day
    D=7; %number of days
    M=12; %number of items at each measurement occasion
    S_item=2;%number of response categories for items
    N=size(obs_variables.datamatrix,1); %number of cases
    %bnet construction
    [bnet,evidence_nodes,partial_evidence_nodes,terminal_merged_nodes,hid_nodes,gausskwadnodes,...
    names,onames,order,inv_o]=...
    construct_bnet_hier_hmm(B,S_day,S_signal,D,M,S_item,obs_variables.datamatrix);

    %convert bnet object from BNT (Murphy) into what we need 
    [parents,child,node_sizes,postorder,preorder,cliquetable,septable,clq_ass_to_node,pot_to_CPT]= franks_from_BNT(bnet,size(obs_variables.datamatrix,1));
    

%%%%
%3.define equivalence sets of nodes, link function,  design
    %matrix and restrictions on parameters for each equivalent (parameter) set
%%%%
    %equivalent nodes are nodes with the same design matrix, the same link and governed by the same set of parameters 
    %param_equivalent nodes are nodes with a differnetn design matrix, but
    %the same link and governed by the same set of parameters
    [equiv_class,param_equiv_class,link]=equiv_classes_hier_hmm(onames,B,D);
    
    %design matrix for all equiv classes
        %first, define pred_mat which is a cell array. each cell contains
        %the design matrix of the
        %variable(s) in a node without modelling the parents. e.g. 
        %for a four-category variable, a 3*3 design matrix
        %case covariates are not yet included here 
        %default is an identity matrix
        pred_mat=construct_predmat(equiv_class,evidence_nodes,partial_evidence_nodes,terminal_merged_nodes,hid_nodes,gausskwadnodes);
        % item design matrices can be incorporated here as follows (here i use an
        % identity matrix as design matrix because i do not want restrictions)
            %first find the class of equivalent nodes that contain the observed variables
            %n=strmatch('Y',onames);
            %n=n(1);
            %eclass=equiv_class(n);
            %then input design matrix
            %design=eye(M);
            %pred_mat{eclass}=design;
        
        %second, define the structure of the linear predictor for each node (no restrictions, only main effects for parents etc)    
        lin_pred_struct=define_lin_pred_struct_hier_hmm_main(equiv_class,parents,terminal_merged_nodes.nodenrs);
        %third, construct design matrix for each node based on its pred_mat and  linear
        %predictor
        % no covariates yet
        design=construct_design_mats(parents,node_sizes,equiv_class,lin_pred_struct,pred_mat,gausskwadnodes);
        
        %fourth, inclusion of case covariates, makes design three dimensional, last
        %dimension represents cases

            %specify which covariates belong to which equivalent sets of
            %nodes
            %cov_nodes is cell array that contains as rows a pair of
            %equiv_class number,column numbers of the covariate matrix
            cov_nodes={};%default
            %cov_nodes=link_covariates_to_nodes_hier_hmm_time(equiv_class,covariates.names,onames,B,D);
            %specify main and or interaction effects of the
            %covariates
            %default: interactions at highest level (covariates have different effect 
            %for each category of the dependent variable and combination of the parents    
            %lin_pred_struct_cov=define_lin_pred_struct_cov_default(cov_nodes);
            %include covariates in design matrices
            %design=cov_into_design(covariates.matrix,cov_nodes,lin_pred_struct_cov,design,evidence_nodes,partial_evidence_nodes,terminal_merged_nodes,hid_nodes,gausskwadnodes,equiv_class);
            
       %fifth, further changes to design matrices can be done manually or
       %with code provided by user
       %example: the model in rijmen et al, where there are main
       %effects of items, and interactions between positive vs
       %negative emotions and latent states, design{4} is the appropriate design matrix
       %first four pos emotions, then 8 neg emotions
        aa=[ [ones(4,1);zeros(8,1)] [zeros(4,1); ones(8,1)]];
        aa=[kron([0 0 1 1]',aa) kron([0 1 0 1]',aa)];
        design{4}=[aa design{4}(:,3:end)];
   
   %define restrictions on parameters
   restparms=cell(max(param_equiv_class),1);
   %default =0, no restrictions (1 =restricted at fixed value)
   for i=1:max(param_equiv_class);
       node_nr=find(param_equiv_class==i,1);
       restparms{i}=zeros(size(design{equiv_class(node_nr)},2),1);
   end
   
%%%%
%4. estimation, automatic after specification of 1-3
%%%%
    %estimation with EM
    %can be altered: number of runs, starting values, convergence criteria

    %number of runs
    nr=1; 
    for run=1:nr
        loglikelihood=-1e10;
        v=Inf;
        it=1;
        %starting values   (here: random start)
        [parms,restparms]=gen_random_start(design,parents,equiv_class,param_equiv_class,gausskwadnodes,link);
        loglikelihood=-1/eps;
        logl_diff=1;
        logl_avg=1;
        %EM loop
        while (v>.000000001 && logl_diff/logl_avg>.000000001 )
            %1 iteration
            parms_old=parms;
            loglikelihood_old=loglikelihood;
            [parms, restparms, loglikelihood ]=EM_iteration(link,parms,restparms,design,parents,node_sizes...
            ,equiv_class,param_equiv_class,evidence_nodes,partial_evidence_nodes,terminal_merged_nodes,hid_nodes,...
            gausskwadnodes,preorder, postorder ,cliquetable, septable,pot_to_CPT,N);    
            %check convergence
            v=0;
            for i=1:max(param_equiv_class)
                vvec=abs(parms_old{i}-parms{i});
                v=[v max(vvec)];
                v=max(v);
            end
            v
            it=it+1;
            logl_diff=loglikelihood-loglikelihood_old;
            if logl_diff<-.0001
                disp('decrease in loglikelihood. press any key to continue');
                pause;
            end
            logl_avg=(abs(loglikelihood)+abs(loglikelihood_old))/2
        end
%%%%
%5. postestimation: compute standard errors, save results ?
%%%%

        %compute final CPTs?
    	lin_pred=construct_lin_pred(parms,design,parents,node_sizes,equiv_class,param_equiv_class,terminal_merged_nodes,N);
        equiv_class_CPTs=construct_equiv_class_CPT(link,lin_pred,N);
    
        %save?
        %eval(['save D:\f\mijnmatlabfuncties\bayesnetfullgraph\kristof\test\beepitem_main_posneg2_tijd_juist_run',int2str(run),'_personstate',int2str(S_person),'_beepstate',int2str(S_beep),' parms loglikelihood equiv_class_CPTs ']);

        %compute standard errors?
        %info=num_infomatrix_anal_score(link,parms,restparms,design,parents,node_sizes,equiv_class,...
        %postorder,septable, cliquetable,preorder,param_equiv_class,clq_ass_to_node,evidence_nodes,...
        %partial_evidence_nodes,terminal_merged_nodes,hid_nodes,gausskwadnodes,N,.000001);
    end


    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合天天视频在线观看| 国产精品综合一区二区| 中文字幕在线不卡视频| 欧美激情在线免费观看| 久久久久久久久免费| 日韩欧美一级二级| 日韩视频在线永久播放| 精品久久久久久无| 国产日韩在线不卡| 中文字幕一区二区不卡| 亚洲色大成网站www久久九九| 一色桃子久久精品亚洲| 亚洲精品视频在线观看免费| 亚洲一二三级电影| 日本不卡的三区四区五区| 麻豆极品一区二区三区| 粉嫩aⅴ一区二区三区四区 | 色诱亚洲精品久久久久久| 91国偷自产一区二区开放时间 | 激情成人午夜视频| 国产成人一区在线| 欧美在线观看一区| 日韩一区二区三区观看| 国产无遮挡一区二区三区毛片日本| 国产日韩精品一区二区浪潮av | 精品一区二区三区在线播放视频 | 国产麻豆精品95视频| 99久久99久久精品国产片果冻| 日本丶国产丶欧美色综合| 欧美精品一二三| 国产日韩欧美a| 亚洲成a人v欧美综合天堂下载| 美女一区二区久久| 91免费国产视频网站| 日韩欧美一级在线播放| 综合亚洲深深色噜噜狠狠网站| 五月激情综合婷婷| eeuss鲁片一区二区三区在线看| 91精品国产一区二区三区蜜臀| 国产精品亲子伦对白| 日韩影院精彩在线| 波多野洁衣一区| 欧美精品一区二区在线播放| 亚洲精品福利视频网站| 国产精品影视在线| 日韩一区二区在线看| 亚洲精品乱码久久久久| 国产99久久久久| 欧美一级专区免费大片| 一区二区三区在线视频免费| 国产高清精品在线| 日韩一区二区影院| 亚洲成在人线在线播放| 91丝袜美女网| 国产精品传媒视频| 国产美女精品在线| 精品福利一二区| 日韩精品免费专区| 91福利精品视频| 亚洲色图清纯唯美| 成人av网站免费| 国产丝袜在线精品| 国产精品1区二区.| 久久综合九色欧美综合狠狠| 日韩和欧美的一区| 欧美高清www午色夜在线视频| 亚洲免费在线看| 99精品欧美一区二区三区小说| 久久久不卡影院| 国产在线视频不卡二| 精品国产91亚洲一区二区三区婷婷| 青青国产91久久久久久| 欧洲另类一二三四区| 一区二区三区久久久| 91女厕偷拍女厕偷拍高清| 亚洲色图在线播放| 91成人网在线| 视频一区二区中文字幕| 7777精品久久久大香线蕉 | 中文字幕一区二区三区蜜月 | 国产精品1024久久| 久久久精品tv| 成人h动漫精品一区二区| 国产精品伦理在线| 99久久精品免费看国产| 亚洲男人的天堂一区二区| 在线观看日韩av先锋影音电影院| 亚洲少妇30p| 欧美美女一区二区三区| 日本特黄久久久高潮| 精品sm捆绑视频| 高清国产午夜精品久久久久久| 中文字幕一区二区三区视频| 欧美亚洲日本国产| 青青草国产成人av片免费 | 91麻豆国产精品久久| 亚洲一区二区三区自拍| 在线电影一区二区三区| 精品一区二区在线观看| 日本一区二区视频在线观看| 91麻豆精东视频| 久久精品国产亚洲高清剧情介绍| 久久网站最新地址| 色欲综合视频天天天| 免费在线看一区| 亚洲欧美影音先锋| 91精品欧美一区二区三区综合在 | 久久久一区二区| 日本高清不卡在线观看| 美日韩黄色大片| 综合久久久久综合| 日韩一区二区精品在线观看| 成人av影院在线| 麻豆精品视频在线观看免费| 亚洲欧美日韩国产成人精品影院| 91精品免费观看| 91丨porny丨蝌蚪视频| 麻豆成人免费电影| 亚洲欧美偷拍三级| 久久免费国产精品 | 久久99精品久久久久婷婷| 中文字幕中文在线不卡住| 欧美一二三在线| 91激情五月电影| 成人精品国产免费网站| 日本亚洲一区二区| 亚洲精选一二三| 中文字幕久久午夜不卡| 精品精品国产高清a毛片牛牛 | 国产情人综合久久777777| 欧美乱熟臀69xxxxxx| 93久久精品日日躁夜夜躁欧美| 国产在线精品国自产拍免费| 日本在线观看不卡视频| 伊人性伊人情综合网| 国产精品第一页第二页第三页 | 色综合色狠狠综合色| 国产精品一区二区三区四区| 久久福利视频一区二区| 午夜久久电影网| 亚洲综合精品自拍| 亚洲美女视频在线| 中文字幕一区二区三区不卡在线| 国产日产欧美一区| 久久免费电影网| 国产偷国产偷亚洲高清人白洁| 精品久久一区二区三区| 欧美成人精品二区三区99精品| 91精品国产入口在线| 88在线观看91蜜桃国自产| 精品污污网站免费看| 欧美色视频在线| 欧美日韩国产小视频| 制服丝袜在线91| 日韩欧美精品在线视频| 91麻豆精品国产91久久久久| 91精品国产欧美一区二区成人| 欧美三片在线视频观看| 欧美日韩二区三区| 日韩欧美国产一区二区三区| 久久嫩草精品久久久精品| 久久精品欧美日韩| 最新久久zyz资源站| 亚洲欧美另类久久久精品2019| 亚洲综合丁香婷婷六月香| 午夜精品久久久久久久久| 日韩国产欧美一区二区三区| 美国三级日本三级久久99| 精品亚洲成a人在线观看| 国产精品亚洲第一区在线暖暖韩国| 国产自产2019最新不卡| 成人激情午夜影院| 欧美中文字幕一区二区三区亚洲| 欧美精品三级在线观看| 欧美成人a在线| 国产精品免费免费| 亚洲午夜成aⅴ人片| 另类的小说在线视频另类成人小视频在线| 免费高清视频精品| 成人av网站大全| 欧美一区二区三区视频免费播放 | 日日骚欧美日韩| 国产老妇另类xxxxx| 色综合天天视频在线观看| 91精品国产综合久久精品图片| 国产视频一区在线播放| 亚洲成人先锋电影| 国产成人在线观看免费网站| 欧美色视频在线| 国产精品女主播av| 喷水一区二区三区| 91免费精品国自产拍在线不卡| 日韩欧美精品三级| 夜夜嗨av一区二区三区| 国产真实乱对白精彩久久| 欧美美女直播网站| 亚洲色图19p| 国产成人精品aa毛片| 91精品国产欧美日韩| 亚洲欧美区自拍先锋|