www.gusucode.com > mbcmodels 工具箱 matlab 源码程序 > mbcmodels/@localmulti/allparameters.m

    function p= allparameters(L)
%ALLPARAMETERS all parameters for localmulti 
%
% p= allparameters(L)

%  Copyright 2006-2015 The MathWorks, Inc. and Ford Global Technologies, Inc.


n= get(L.xregmulti,'currentindex');
mdls = get(L.xregmulti,'models');
Rng = getcode(mdls{n});
bc= [get(mdls{n},'boxcox'); NaN; NaN];
select= L.SelectionStatistic;
if isempty(select)
    select= NaN(length(mdls),1);
end
if length(select)<length(mdls)
   select = [select(:);NaN(length(mdls)-length(select),1)];  
end

ExtraParams= [Rng(:) ; bc ; select(:)];

params = cell(1,length(mdls));
wts = get(L,'weights');
for i=1:length(mdls)
    if wts(i)>0
        pm= allparameters(mdls{i});
        params{i}= [length(pm);pm];
    else
        % model not fitted
        params{i}= NaN;
    end
end
if L.version==2
    % old style
    p = [n;params{n};ExtraParams];
else
    % store parameters from all alternatives
    p = [n;Inf; ExtraParams; vertcat(params{:})];
end