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

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

?? tucker.m

?? 強大的多維工具箱.應用在Matlab中,可分析多緯數據結構.直接安裝.
?? M
?? 第 1 頁 / 共 3 頁
字號:
function [Factors,G,ExplX,Xm]=tucker(X,Fac,Options,ConstrF,ConstrG,Factors,G);
%TUCKER multi-way tucker model
%
% function [Factors,G,ExplX,Xm]=tucker(X,Fac[,Options[,ConstrF,[ConstrG[,Factors[,G]]]]]);
%
% Change: True LS unimodality now supported.
%
% This algorithm requires access to:
% 'fnipals' 'gsm' 'inituck' 'calcore' 'nmodel' 'nonneg' 'setopts' 'misssum'
% 'missmean' 't3core'
%
% See also:
% 'parafac' 'maxvar3' 'maxdia3' 'maxswd3'
%
% ---------------------------------------------------------           
%             The general N-way Tucker model
% ---------------------------------------------------------
%    
% [Factors,G,ExplX,Xm]=tucker(X,Fac,Options,ConstrF,ConstrG,Factors,G);
% [Factors,G,ExplX,Xm]=tucker(X,Fac);
%
% INPUT
% X        : The multi-way data array.
% Fac      : Row-vector describing the number of factors
%            in each of the N modes. A '-1' (minus one)
%            will tell the algorithm not to estimate factors
%            for this mode, yielding a Tucker2 model.
%            Ex. [3 2 4]
% 
% OPTIONAL INPUT
% Options  : See parafac.
% ConstrF  : Constraints that must apply to 'Factors'.
%            Define a row-vector of size N that describes how
%            each mode should be treated.
%            '0' orthogonality (default)
%            '1' non-negativity
%            '2' unconstrained
%            '4' unimodality and non-negativity.
%            E.g.: [0 2 1] yields ortho in first mode, uncon in the second
%            and non-neg in the third mode.
%            Note: The algorithm uses random values if there are no
%            non-negative components in the iteration intermediates. Thus,
%            if non-negativity is applied, the iterations may be
%            non-monotone in minor sequences.
% ConstrG  : Constraints that must apply to 'G'.
%            '[]' or '0' will not constrain the elements of 'G'.
%            To define what core elements should be allowed, give a core that
%            is 1 (one) on all active positions and zero elsewhere - this boolean
%            core array must have the same dimensions as defined by 'Fac'.
%
% OUTPUT
% Factors  : A row-vector containing the solutions.
% G        : Core array that matches the dimensions defined by 'Fac'.
% ExplX    : Fraction of variation (sums of squares explained)
% Xm       : Xhat (the model of X)
%
% This algorithm applies to the general N-way case, so
% the array X can have any number of dimensions. The
% principles of 'projections' and 'systematic unfolding 
% methodology (SUM)' are used in this algorithm to provide
% a fast approach - also for larger data arrays. This
% algorithm can handle missing values if denoted
% by NaN's. It can also be used to make TUCKER2/1 models by
% properly setting the elements of 'Fac' to -1.
%
% Note: When estimating a Tucker model on data using non-orthogonal factors,
%       the sum of square of the core may differ between models of the
%       same dataset. This is in order since the factors may
%       thus be correlated. However, the expl. var. should always be the same.
%      

% $ Version 2.003 $ Jan 2002 $ Fixed problem with length of factors under special conditions $ CA $ Not compiled $
% $ Version 2.002 $ Jan 2002 $ Fixed reshaping of old input G $ RB $ Not compiled $
% $ Version 2.001 $ July 2001 $ Changed problem with checking if Factors exist (should check if it exists in workspace specifically)$ RB $ Not compiled $
% $ Version 2.00 $ May 2001 $ Changed to array notation $ RB $ Not compiled $
% $ Version 1.12 $ Date 14. Nov. 1999 $ Not compiled $
%
%
% Copyright, 1998 - 
% This M-file and the code in it belongs to the holder of the
% copyrights and is made public under the following constraints:
% It must not be changed or modified and code cannot be added.
% The file must be regarded as read-only. Furthermore, the
% code can not be made part of anything but the 'N-way Toolbox'.
% In case of doubt, contact the holder of the copyrights.
%
% Claus A. Andersson
% Chemometrics Group, Food Technology
% Department of Food and Dairy Science
% Royal Veterinary and Agricultutal University
% Rolighedsvej 30, DK-1958 Frederiksberg, Denmark
% E-mail: claus@andersson.dk
%

DimX = size(X);
X = reshape(X,DimX(1),prod(DimX(2:end)));
FacNew = Fac;
FacNew(find(FacNew==-1)) = DimX(find(FacNew==-1));

format long
format compact
dbg=0;

if nargin==0,
    help('tucker.m');
    error(['Error calling ''tucker.m''. Since no input arguments were given, the ''help'' command was initiated.'])
    return;
end;
if nargin<2,
    help('tucker.m');
    error(['Error calling ''tucker.m''. At least two (2) input arguments must be given. Read the text above.'])
    return;
end;
if size(Fac,2)==1,
    help('tucker.m');
    error(['Error calling ''tucker.m''. ''Fac'' must be a row-vector.'])
end;    

% Initialize system variables
N=size(Fac,2);
Fac_orig=Fac;
finda=find(Fac==-1);
if ~isempty(finda),
    Fac(finda)=zeros(size(finda));
end;
FIdx0=cumsum([1 DimX(1:N-1).*Fac(1:N-1)]);
FIdx1=cumsum([DimX.*Fac]);
pmore=30;
pout=0;
Xm=[];
MissingExist=any(isnan(X(:)));
if MissingExist,
    IdxIsNans=find(isnan(X));
end;
SSX=misssum(misssum(X.^2));

if exist('Options'),
    Options_=Options;
else
    Options_=[0];
end;
load noptiot3.mat;
i=find(Options_);
Options(i)=Options_(i);
if isnan(Options(5)),
    prlvl = 0;
else 
    prlvl = 1;
end;
Options12=Options(1);
Options11=Options12*10;
Options21=Options(2);
Options31=Options(3);
Options41=Options(4);
Options51=Options(5);
Options61=Options(6);
Options71=Options(7);
Options81=Options(8);
Options91=Options(9);
Options101=Options(10);

if ~exist('ConstrF'),
    ConstrF=[];
end;
if isempty(ConstrF),
    ConstrF=zeros(size(DimX));
end;
if ConstrF==0 ,
    ConstrF=zeros(size(DimX));
end;

if ~exist('ConstrG')
    ConstrG=[];
end;
if isempty(ConstrG),
    ConstrG=0;
end;

if exist('Factors')~=1,
    Factors=[];
end;

if ~exist('G'),
    G=[];
else
    G=reshape(G,size(G,1),prod(size(G))/size(G,1));
end;

%Give a status/overview
if prlvl>0,
    fprintf('\n\n');
    fprintf('=================   RESUME  &  PARAMETERS   ===================\n');
    fprintf('Array                 : %i-way array with dimensions (%s)\n',N,int2str(DimX));
    if any(Fac==0),
        fprintf('Model                 : (%s) TUCKER2 model\n',int2str(Fac));
    else
        fprintf('Model                 : (%s) TUCKER3 model\n',int2str(Fac));
    end;   
end

%Mth initialization
txt1=str2mat('derived by SVD (orthogonality constrained).');
txt1=str2mat(txt1,'derived by NIPALS (orthogonality constrained).');
txt1=str2mat(txt1,'derived by Gram-Schmidt (orthogonality constrained).');
txt1=str2mat(txt1,'This mode is not compressed/calculated, i.e., TUCKER2 model.');
txt1=str2mat(txt1,'derived by non-negativity least squares.');
txt1=str2mat(txt1,'derived by unconstrained simple least squares.');
txt1=str2mat(txt1,'unchanged, left as defined in input ''Factors''.');
txt1=str2mat(txt1,'derived by unimodality constrained regression.');
MethodO=1;
for k=1:N,
    UpdateCore(k)=1;
    if ConstrF(k)==0,
        if Fac(k)>0,
            if 0<DimX(k) & DimX(k)<=180,
                Mth(k)=1;
            end;
            if 180<DimX(k) & DimX(k)<=Inf,
                Mth(k)=3;
            end;
            if Fac(k)<=6 & 180<DimX(k),
                Mth(k)=2;
            end;
        end;
        UpdateWithPinv(k)=1; %Update with the L-LS-P-w/Kron approach
        CalcOrdinar(k)=1;
    end;
    if ConstrF(k)==1,
        Mth(k)=5; %nonneg
        MethodO=2; %use the flexible scheme
        UpdateCore(k)=1; %Update the core in this mode
        CalcOrdinar(k)=1;
    end;
    if ConstrF(k)==2,
        Mth(k)=6; %uncon
        MethodO=2; %use the flexible scheme
        UpdateCore(k)=1; %Update the core in this mode
        CalcOrdinar(k)=1;
    end;
    if ConstrF(k)==3,
        Mth(k)=7; %unchanged
        MethodO=2;
        UpdateCore(k)=1; %Update the core in this mode
        CalcOrdinar(k)=1;
    end;
    if ConstrF(k)==4,
        Mth(k)=8; %unimod
        MethodO=2; %use the flexible scheme
        UpdateCore(k)=1; %Update the core in this mode
        CalcOrdinar(k)=1;
    end;   
    if Fac_orig(k)==-1
        Mth(k)=4;
        UpdateCore(k)=0; %Do not update core for this mode
        CalcOrdinar(k)=1;
    end;
    if Options91>=1,
        if prlvl>0,
            if Mth(k)~=4,
                fprintf('Mode %i                : %i factors %s\n',k,Fac(k),txt1(Mth(k),:));
            else
                fprintf('Mode %i                : %s\n',k,txt1(Mth(k),:));
            end;
        end;
    end;
end;

UserFactors=1;
if isempty(Factors),
    UserFactors=0;
else
    ff = [];
    for f=1:length(Factors)
        if ~all(size(Factors{f})==[DimX(f),Fac(f)]), %%
            Factors{f}=rand(DimX(f),Fac(f));%% Added by CA, 27-01-2002
        end;%%
        ff=[ff;Factors{f}(:)];
    end
    OrigFactors=Factors;
    Factors = ff;
end;

usefacinput=0;
if MissingExist,
    if ~UserFactors
        [i j]=find(isnan(X));
        mnx=missmean(X)/3;
        mny=missmean(X')/3;
        n=size(i,1);
        for k=1:n,
            i_=i(k);
            j_=j(k);
            X(i_,j_) = mny(i_) + mnx(j_);
        end;
        mnz=(missmean(mnx)+missmean(mny))/2;
        p=find(isnan(X));
        X(p)=mnz;
    else
        usefacinput=1;
        % Convert to new format
        clear ff,id1 = 0;
        for i = 1:length(DimX) 
            id2 = sum(DimX(1:i).*Fac(1:i));ff{i} = reshape(Factors(id1+1:id2),DimX(i),Fac(i));id1 = id2;
        end
        Fact = ff;
        Xm=nmodel(Fact,reshape(G,Fac_orig));
        Xm = reshape(Xm,DimX(1),prod(DimX(2:end)));
        X(IdxIsNans)=Xm(IdxIsNans);
    end;
    SSMisOld=sum(sum( X(IdxIsNans).^2 ));
    SSMis=SSMisOld;
end;

% Initialize the Factors by some method
UserFactors=1;
if isempty(Factors),
    Factors=inituck(reshape(X,DimX),Fac_orig,2,[]);
    
    % Convert to old factors
    ff = [];
    for f=1:length(Factors)
        ff=[ff;Factors{f}(:)];
    end
    Factors = ff;
    UserFactors=0;
end;

% Initialize the core
Core_uncon=0;
Core_nonneg=0;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日本韩国一区二区三区视频| 亚洲激情图片qvod| 精品国产99国产精品| 777午夜精品免费视频| 欧美日韩一区二区电影| 精品视频免费在线| 欧美美女一区二区三区| 宅男在线国产精品| 91精品婷婷国产综合久久性色| 欧美日韩综合一区| 欧美日韩黄色一区二区| 在线综合视频播放| 26uuu另类欧美亚洲曰本| 久久久久久久久久电影| 欧美激情在线看| 一色屋精品亚洲香蕉网站| 日韩码欧中文字| 亚洲成人综合在线| 玖玖九九国产精品| 国产精品中文字幕一区二区三区| 国产精品88888| www.av精品| 欧美性xxxxxxxx| 欧美精品免费视频| 亚洲精品一区二区精华| 中文字幕 久热精品 视频在线| 国产精品日韩成人| 亚洲欧美日韩国产成人精品影院 | 欧美sm极限捆绑bd| 精品盗摄一区二区三区| 国产精品欧美久久久久一区二区 | 国产精品一卡二| 成人精品电影在线观看| 欧美亚洲另类激情小说| 欧美一区二视频| 欧美国产日产图区| 亚洲宅男天堂在线观看无病毒| 蜜臀久久99精品久久久久宅男| 国产成人综合亚洲网站| 91网站黄www| 91精品国产综合久久婷婷香蕉| 久久先锋影音av鲁色资源网| 亚洲人成伊人成综合网小说| 日本中文字幕一区二区有限公司| 国产一区不卡在线| 91国内精品野花午夜精品| 精品99一区二区三区| 亚洲女人****多毛耸耸8| 免费成人av在线| 一本一道综合狠狠老| 精品久久久网站| 亚洲一区二区三区美女| 国产精品亚洲视频| 欧美三级电影在线观看| 国产精品免费看片| 久久福利视频一区二区| 91成人看片片| 中文字幕欧美日韩一区| 青青草精品视频| 色狠狠色噜噜噜综合网| 久久影视一区二区| 亚洲mv在线观看| 91在线播放网址| 久久久久久久综合色一本| 日韩中文字幕av电影| 99久久久国产精品免费蜜臀| 精品美女一区二区| 亚洲第一狼人社区| 不卡大黄网站免费看| 精品播放一区二区| 日本欧洲一区二区| 欧美日韩综合不卡| 中文字幕欧美一区| 粉嫩aⅴ一区二区三区四区五区| 欧美一区二区在线免费播放| 一区二区成人在线视频| 国产91富婆露脸刺激对白| 91精品国产欧美日韩| 亚洲一区二区三区在线| 99天天综合性| 亚洲国产精品成人综合色在线婷婷 | 国产69精品久久99不卡| 6080yy午夜一二三区久久| 亚洲欧洲精品一区二区三区 | 精一区二区三区| 欧美日韩卡一卡二| 亚洲另类一区二区| 成人免费av网站| 久久久久久久久伊人| 免费视频最近日韩| 欧美精品亚洲一区二区在线播放| 亚洲综合色视频| 色婷婷av一区二区三区gif | 成人不卡免费av| 久久精品一区四区| 国产一区二区成人久久免费影院| 日韩欧美你懂的| 免费在线观看视频一区| 欧美一区二区精品久久911| 丝袜亚洲另类欧美| 在线成人免费视频| 日韩精品视频网| 日韩欧美国产wwwww| 毛片av中文字幕一区二区| 日韩三级在线观看| 久久不见久久见免费视频7| 日韩一区二区在线看| 久久草av在线| 国产亚洲精品福利| 丁香五精品蜜臀久久久久99网站| 国产精品入口麻豆原神| 91视频观看免费| 亚洲乱码国产乱码精品精可以看| 色综合色狠狠综合色| 一区二区三区高清在线| 欧美系列在线观看| 日本成人在线网站| 欧美精品一区二区三区高清aⅴ| 国产一区二区三区久久久| 国产日韩三级在线| aaa亚洲精品一二三区| 一区二区三区欧美| 正在播放亚洲一区| 国产一区二区三区蝌蚪| 国产精品的网站| 欧美性xxxxx极品少妇| 日韩avvvv在线播放| 久久久国产精品麻豆| 99精品视频一区| 亚洲成av人片在线| 精品国产麻豆免费人成网站| 成人综合在线观看| 一区二区三区成人在线视频| 日韩一区二区三区高清免费看看 | 69av一区二区三区| 韩国成人在线视频| 国产精品美女久久久久aⅴ| 在线亚洲+欧美+日本专区| 婷婷成人激情在线网| 久久中文娱乐网| 色婷婷综合五月| 麻豆国产一区二区| 国产精品欧美精品| 6080日韩午夜伦伦午夜伦| 国产成人a级片| 亚洲成人资源网| 久久一二三国产| 欧美吻胸吃奶大尺度电影 | 日韩免费看网站| 风间由美性色一区二区三区| 亚洲一区二区三区视频在线播放| 精品久久久久香蕉网| 91成人免费电影| 国内久久精品视频| 亚洲国产一区二区视频| 久久久天堂av| 欧美性猛交一区二区三区精品| 精品一区二区三区久久久| 亚洲少妇中出一区| 欧美大尺度电影在线| 91高清视频在线| 国产在线精品免费av| 亚洲小说欧美激情另类| 国产亚洲精品福利| 欧美精品18+| 91丨九色丨尤物| 国内成人精品2018免费看| 国产麻豆视频一区二区| 亚洲线精品一区二区三区 | 国产在线精品一区二区夜色| 亚洲精品久久久久久国产精华液| 久久天堂av综合合色蜜桃网| 欧美色精品天天在线观看视频| 成人黄色av电影| 狠狠色综合播放一区二区| 亚洲一区二区欧美激情| ...av二区三区久久精品| 久久影视一区二区| 日韩视频在线永久播放| 欧美色爱综合网| 色综合 综合色| 成人免费视频一区| 精品写真视频在线观看| 天天综合日日夜夜精品| 日韩久久一区二区| 中文字幕欧美国产| 久久综合五月天婷婷伊人| 日韩丝袜美女视频| 在线91免费看| 欧美老女人第四色| 欧美影院精品一区| 91蝌蚪国产九色| 91色视频在线| 99久久综合色| 成人av综合在线| 国产乱码精品1区2区3区| 久久草av在线| 久久成人麻豆午夜电影| 久久国产精品99久久人人澡| 麻豆极品一区二区三区|