www.gusucode.com > mbcmodels 工具箱 matlab 源码程序 > mbcmodels/@xregmodel/set.m
function varargout=set(m,property,value) %SET overloaded set function for xregmodel class % % set(m,property,value) % Note inputname{1} is used as variable name in caller workspace % % Supported properties: % 'ytrans' Y Transformation (could be inline, char or sym) % An empty matrix turns off any output transformation % The inverse function must exist. It is calculated here % and stored for speedy evaluation. % 'tbs' transform both sides % 'fitalg' fitting algorithm % 'datum' Use coding to set a datum (xcode= x-datum) % 'boxcox' Sets ytrans as a boxcox transformation % Value can be one of % lambda % [lambda,shift] % {lambda , y} % {[lambda,shift], y} % 'nfactors' Change number of factors in model (not recommended) % {'symbol','symbols'} input factor symbols % 'summarystats' indices for summary statistics % 'outliers' Outlier selection method (either function or array % Copyright 2000-2007 The MathWorks, Inc. and Ford Global Technologies, Inc. switch lower(property) case 'ytrans' m.Output.Transform = value; case 'tbs' if supportTBS(m) m.TransBS= value; end case 'fitalg' m.FitAlgorithm= value; case 'datum' m.Inputs = datum(m.Inputs,value); case 'boxcox' m.Output.BoxCox = value; case {'symbol','symbols'} m.Inputs = setList(m.Inputs,'Symbol',value); case 'nfactors' % change the number of factors nf= value; nlold= length(m.Inputs); if nf < nlold % delete some factor info m.Inputs = m.Inputs(1:nf); elseif nf > nlold nnewf = nf-nlold; xsym = cell(nnewf,1); for i= 1:nnewf xsym{i}= sprintf('X%1d',i+nf); end NewInps = mbcinputfactor('Name',xsym,... 'Symbol',xsym); NewInps = setupTargets(NewInps,repmat(recommendedTgt(m),nnewf,1)); m.Inputs = [m.Inputs; NewInps]; end case 'outliers' if ischar(value) ok= exist(value,'file'); else ok= isempty(value) || (isnumeric(value) && (size(value,2)==4 || size(value,2)==5)); end if ok m.Outliers= value; else error(message('mbc:xregmodel:InvalidProperty1')); end case 'summarystats' m.Stats.Summary = value; otherwise error(message('mbc:xregmodel:InvalidProperty', property)); end % switch if nargout==1 varargout{1}=m; else assignin('caller',inputname(1),m); end