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

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

?? polyfitn.m

?? 多項式擬合的MATLAB工具。只要具有以下幾個函數 POLYFITN - A general n-dimensional polynomial fitting tool POLYVALN - An
?? M
字號:
function polymodel = polyfitn(indepvar,depvar,modelterms)% polyfitn: fits a general polynomial regression model in n dimensions% usage: polymodel = polyfitn(indepvar,depvar,modelterms)%% Polyfitn fits a polynomial regression model of one or more% independent variables, of the general form:%%   z = f(x,y,...) + error%% arguments: (input)%  indepvar - (n x p) array of independent variables as columns%        n is the number of data points%        p is the dimension of the independent variable space%%        IF n == 1, then I will assume there is only a%        single independent variable.%%  depvar   - (n x 1 or 1 x n) vector - dependent variable%        length(depvar) must be n.%%        Only 1 dependent variable is allowed, since I also%        return statistics on the model.%%  modelterms - defines the terms used in the model itself%%        IF modelterms is a scalar integer, then it designates%           the overall order of the model. All possible terms%           up to that order will be employed. Thus, if order%           is 2 and p == 2 (i.e., there are two variables) then%           the terms selected will be:%%              {constant, x, x^2, y, x*y, y^2}%%           Beware the consequences of high order polynomial%           models.%%        IF modelterms is a (k x p) numeric array, then each%           row of this array designates the exponents of one%           term in the model. Thus to designate a model with%           the above list of terms, we would define modelterms as%           %           modelterms = [0 0;1 0;2 0;0 1;1 1;0 2]%%        If modelterms is a character string, then it will be%           parsed as a list of terms in the regression model.%           The terms will be assume to be separated by a comma%           or by blanks. The variable names used must be legal%           matlab variable names. Exponents in the model may%           may be any real number, positive or negative.%%           For example, 'constant, x, y, x*y, x^2, x*y*y'%           will be parsed as a model specification as if you%           had supplied:%           modelterms = [0 0;1 0;0 1;1 1;2 0;1 2]%           %           The word 'constant' is a keyword, and will denote a%           constant terms in the model. Variable names will be%           sorted in alphabetical order as defined by sort.%           This order will assign them to columns of the%           independent array. Note that 'xy' will be parsed as%           a single variable name, not as the product of x and y.%%        If modelterms is a cell array, then it will be taken%           to be a list of character terms. Similarly,%           %           {'constant', 'x', 'y', 'x*y', 'x^2', 'x*y^-1'}%%           will be parsed as a model specification as if you%           had supplied:%%           modelterms = [0 0;1 0;0 1;1 1;2 0;1 -1]%% Arguments: (output)%  polymodel - A structure containing the regression model%        polymodel.ModelTerms = list of terms in the model%        polymodel.Coefficients = regression coefficients%        polymodel.ParameterVar = variances of model coefficients%        polymodel.ParameterStd = standard deviation of model coefficients%        polymodel.R2 = R^2 for the regression model%        polymodel.RMSE = Root mean squared error%        polymodel.VarNames = Cell array of variable names%           as parsed from a char based model specification.%  %        Note 1: Because the terms in a general polynomial%        model can be arbitrarily chosen by the user, I must%        package the erms and coefficients together into a%        structure. This also forces use of a special evaluation%        tool: polyvaln.%%        Note 2: A polymodel can be evaluated for any set%        of values with the function polyvaln. However, if%        you wish to manipulate the result symbolically using%        my own sympoly tools, this structure can be converted%        to a sympoly using the function polyn2sympoly.%% Find my sympoly toolbox here:% http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=9577&objectType=FILE%% See also: polyvaln, polyfit, polyval, polyn2sympoly, sympoly%% Author: John D'Errico% Release: 2.0% Release date: 2/19/06if nargin<1  help polyfitn  returnend% get sizes, test for consistency[n,p] = size(indepvar);if n == 1  indepvar = indepvar';  [n,p] = size(indepvar);end[m,q] = size(depvar);if m == 1  depvar = depvar';  [m,q] = size(depvar);end% only 1 dependent variable allowed at a timeif q~=1  error 'Only 1 dependent variable allowed at a time.'endif n~=m  error 'indepvar and depvar are of inconsistent sizes.'end% Automatically scale the independent variables to unit variancestdind = sqrt(diag(cov(indepvar)));if any(stdind==0)  warning 'Constant terms in the model must be entered using modelterms'  stdind(stdind==0) = 1;end% scaled variablesindepvar_s = indepvar*diag(1./stdind);% do we need to parse a supplied model?varlist = {};if iscell(modelterms) || ischar(modelterms)  [modelterms,varlist] = parsemodel(modelterms,p);  if size(modelterms,2)<p    modelterms = [modelterms, zeros(size(modelterms,1),p - size(modelterms,2))];  end  elseif length(modelterms) == 1  % do we need to generate a set of modelterms?  modelterms = buildcompletemodel(modelterms,p);elseif size(modelterms,2)~=p  error 'Modelterm must be a scalar or have the same # of columns as indepvar'endnt = size(modelterms,1);% check for replicate terms if nt>1  mtu = unique(modelterms,'rows');  if size(mtu,1)<nt    warning 'Replicate terms identified in the model.'  endend% build the design matrixM = ones(n,nt);scalefact = ones(1,nt);for i = 1:nt  for j = 1:p    M(:,i) = M(:,i).*indepvar_s(:,j).^modelterms(i,j);    scalefact(i) = scalefact(i)/(stdind(j)^modelterms(i,j));  endend% estimate the model using QR. do it this way to provide a% covariance matrix when all done. Use a pivoted QR for% maximum stability.[Q,R,E] = qr(M,0);polymodel.ModelTerms = modelterms;polymodel.Coefficients(E) = R\(Q'*depvar);yhat = M*polymodel.Coefficients(:);% recover the scalingpolymodel.Coefficients=polymodel.Coefficients.*scalefact;% variance of the regression parameterss = norm(depvar - yhat);if n > nt  Rinv = R\eye(nt);  Var(E) = s^2*sum(Rinv.^2,2)/(n-nt);  polymodel.ParameterVar = Var.*(scalefact.^2);  polymodel.ParameterStd = sqrt(polymodel.ParameterVar);else  % we cannot form variance or standard error estimates  % unless there are at least as many data points as  % parameters to estimate.  polymodel.ParameterVar = inf(1,nt);  polymodel.ParameterStd = inf(1,nt);end% R^2polymodel.R2 = 1 - (s/norm(depvar-mean(depvar)) )^2;% RMSEpolymodel.RMSE = sqrt(mean((depvar - yhat).^2));% if a character 'model' was supplied, return the list% of variables as parsed outpolymodel.VarNames = varlist;% ==================================================% =============== begin subfunctions ===============% ==================================================function [modelterms,varlist] = buildcompletemodel(order,p)% % arguments: (input)%  order - scalar integer, defines the total (maximum) order %%  p     - scalar integer - defines the dimension of the%          independent variable space%% arguments: (output)%  modelterms - exponent array for the model%%  varlist - cell array of character variable names% build the exponent array recursivelyif p == 0  % terminal case  modelterms = [];elseif (order == 0)  % terminal case  modelterms = zeros(1,p);elseif (p==1)  % terminal case  modelterms = (order:-1:0)';else  % general recursive case  modelterms = zeros(0,p);  for k = order:-1:0    t = buildcompletemodel(order-k,p-1);    nt = size(t,1);    modelterms = [modelterms;[repmat(k,nt,1),t]];  endend% ==================================================function [modelterms,varlist] = parsemodel(model,p);% % arguments: (input)%  model - character string or cell array of strings%%  p     - number of independent variables in the model%% arguments: (output)%  modelterms - exponent array for the modelmodelterms = zeros(0,p);varlist = {};while ~isempty(model)  if iscellstr(model)    term = model{1};    model(1) = [];  else    [term,model] = strtok(model,' ,');  end    % We've stripped off a model term. Now parse it.    % Is it the reserved keyword 'constant'?  if strcmpi(term,'constant')    modelterms(end+1,:) = 0;  else    % pick this term apart    expon = zeros(1,p);    while ~isempty(term)      vn = strtok(term,'*/^. ,');      k = find(strncmp(vn,varlist,length(vn)));      if isempty(k)        % its a variable name we have not yet seen                % is it a legal name?        nv = length(varlist);        if ismember(vn(1),'1234567890_')          error(['Variable is not a valid name: ''',vn,''''])        elseif nv>=p          error 'More variables in the model than columns of indepvar'        end                varlist{nv+1} = vn;                k = nv+1;      end      % variable must now be in the list of vars.             % drop that variable from term      i = strfind(term,vn);      term = term((i+length(vn)):end);            % is there an exponent?      eflag = false;      if strncmp('^',term,1)        term(1) = [];        eflag = true;      elseif strncmp('.^',term,2)        term(1:2) = [];        eflag = true;      end      % If there was one, get it      ev = 1;      if eflag        ev = sscanf(term,'%f');        if isempty(ev)            error 'Problem with an exponent in parsing the model'        end      end      expon(k) = expon(k) + ev;      % next monomial subterm?      k1 = strfind(term,'*');      if isempty(k1)        term = '';      else        term(k1(1)) = ' ';      end          end      modelterms(end+1,:) = expon;        end  end% Once we have compiled the list of variables and% exponents, we need to sort them in alphabetical order[varlist,tags] = sort(varlist);modelterms = modelterms(:,tags);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲免费av网站| 成人午夜av影视| 福利电影一区二区三区| 色综合视频在线观看| 日韩一区二区三区av| 亚洲欧洲精品一区二区三区不卡| 亚洲chinese男男1069| 国产不卡视频一区| 欧美一卡二卡在线| 一区二区三区**美女毛片| 国产一区91精品张津瑜| 欧美日韩激情一区二区| 国产精品久久久久久久久动漫| 蜜臀av性久久久久蜜臀av麻豆| 色菇凉天天综合网| 国产欧美一区二区精品性| 美腿丝袜亚洲一区| 欧美丰满高潮xxxx喷水动漫| 亚洲欧美一区二区三区孕妇| 国产大陆亚洲精品国产| 精品国产制服丝袜高跟| 日本视频中文字幕一区二区三区| 在线欧美日韩精品| 亚洲欧洲综合另类在线| 91在线一区二区三区| 亚洲国产激情av| 成人小视频在线观看| 久久品道一品道久久精品| 美女国产一区二区| 日韩一级成人av| 毛片av一区二区| 日韩欧美一级精品久久| 美女网站色91| 欧美tickle裸体挠脚心vk| 美腿丝袜亚洲一区| ...xxx性欧美| av在线一区二区| 亚洲手机成人高清视频| 91丨九色丨尤物| 亚洲日本在线a| 欧美色综合网站| 日韩精品一级二级 | 777久久久精品| 亚洲国产cao| 欧美日韩一级黄| 日本欧美加勒比视频| 日韩一区二区在线看| 久久99国产精品免费| 精品少妇一区二区三区视频免付费 | 日韩欧美一区在线观看| 寂寞少妇一区二区三区| 久久久久久久久伊人| 粉嫩在线一区二区三区视频| 日韩一区中文字幕| 在线观看免费成人| 日本va欧美va瓶| 精品国产sm最大网站免费看| 国产精品99久久久久久久vr| 亚洲色图欧洲色图婷婷| 欧美猛男gaygay网站| 狠狠色丁香婷婷综合| 国产精品的网站| 欧美日韩成人激情| 国产一区二区三区日韩| 亚洲男人电影天堂| 日韩一区二区三区视频在线观看| 国产美女精品一区二区三区| 亚洲日本在线视频观看| 欧美精品777| 国产成人精品www牛牛影视| 亚洲女人的天堂| 欧美电影免费观看高清完整版| 国产91精品露脸国语对白| 亚洲午夜激情网站| 国产欧美日韩中文久久| 欧美日韩三级视频| 成人午夜av在线| 日本女优在线视频一区二区| 国产精品乱码一区二三区小蝌蚪| 精品视频在线免费| 国产福利一区二区三区| 视频一区欧美精品| 中文字幕永久在线不卡| 欧美成人猛片aaaaaaa| 91久久精品一区二区| 国产高清一区日本| 日韩电影一二三区| 一区二区三区加勒比av| 亚洲国产成人自拍| 精品捆绑美女sm三区| 在线一区二区三区四区| 成人aaaa免费全部观看| 久久电影国产免费久久电影 | 欧美一区二区三区精品| 色综合久久综合网| 国产成人激情av| 国产在线观看一区二区| 首页国产丝袜综合| 亚洲国产一二三| 国产精品福利影院| 成人欧美一区二区三区| 久久久激情视频| 久久亚洲私人国产精品va媚药| 欧美人xxxx| 欧美日韩亚洲丝袜制服| 91成人看片片| 在线视频欧美精品| 欧美性猛交一区二区三区精品| 91色视频在线| 色哟哟日韩精品| 日本韩国欧美一区| 色综合中文字幕国产 | 成人免费高清视频| 国产成人在线视频播放| 久久se精品一区精品二区| 综合激情网...| 国产喷白浆一区二区三区| 欧美成人精品二区三区99精品| 欧美日韩国产综合一区二区| 色94色欧美sute亚洲线路一ni| 懂色中文一区二区在线播放| 久久精品国产亚洲a| 日韩精品亚洲一区| 亚洲动漫第一页| 日韩国产精品大片| 亚洲成年人影院| 亚洲高清免费观看高清完整版在线观看| 国产精品无遮挡| 国产精品天美传媒沈樵| 国产精品系列在线| 国产精品久久久久久一区二区三区 | 欧美午夜理伦三级在线观看| 国产91丝袜在线18| 91丨九色丨黑人外教| av在线不卡电影| 9色porny自拍视频一区二区| 成人av免费网站| 成人精品免费看| 欧美日韩在线播放三区| 欧美卡1卡2卡| 精品少妇一区二区三区在线播放| 日韩午夜精品视频| 国产精品久久免费看| 亚洲日本一区二区三区| 亚洲精品国产精华液| 亚洲6080在线| 三级亚洲高清视频| 福利一区福利二区| 色哟哟一区二区在线观看| 欧美视频一二三区| 在线播放中文字幕一区| 国产女主播视频一区二区| 中文字幕在线不卡一区二区三区| 一区二区激情小说| 日日嗨av一区二区三区四区| 男人的j进女人的j一区| 欧美一区欧美二区| 欧美大片在线观看一区| 国产日韩欧美精品一区| 一区二区在线观看不卡| 激情文学综合网| 99国产精品久久久| 7777精品伊人久久久大香线蕉 | 亚洲色图在线视频| 三级成人在线视频| 蜜臀a∨国产成人精品| 9i看片成人免费高清| 9191精品国产综合久久久久久 | 天堂成人免费av电影一区| 黄色成人免费在线| 91网站在线播放| 欧美一区二区福利视频| 亚洲精品欧美在线| 国产一区激情在线| 色天使色偷偷av一区二区| 欧美一区二区三区四区视频| 亚洲女人小视频在线观看| 蓝色福利精品导航| 色94色欧美sute亚洲线路一久| 日韩欧美的一区二区| 国产日韩欧美精品电影三级在线| 亚洲精品乱码久久久久久日本蜜臀| 成人精品电影在线观看| 91超碰这里只有精品国产| 亚洲婷婷综合色高清在线| 国产成人免费9x9x人网站视频| 欧美剧情片在线观看| 亚洲同性gay激情无套| 久久精品国产色蜜蜜麻豆| 色哟哟在线观看一区二区三区| 国产欧美日韩一区二区三区在线观看| 一区二区三区高清| 豆国产96在线|亚洲| 欧美高清dvd| 日韩国产精品久久久久久亚洲| 色综合夜色一区| 国产精品青草久久| 激情欧美一区二区| 久久亚洲欧美国产精品乐播| 奇米影视一区二区三区|