Code covered by the BSD License  

Highlights from
Introduction to Statistics Toolbox - July 2007 Webinar Files

image thumbnail

Introduction to Statistics Toolbox - July 2007 Webinar Files

by

 

17 Jul 2007 (Updated )

Presentation and demo files for the "Introduction to Statistics Toolbox™" Webinar (July 12, 2007)

simMPG(vars, terms, s)
function blah = simMPG(vars, terms, s)

%simMPG  Simulate MPG with arbitrary input parameters

% Copyright 2007 The MathWorks, Inc.

if strcmp(class(vars), 'dataset')
  % convert to double
  vars = double(vars);
end

blah = nan(size(vars, 1), 1);
for id = 1:size(vars, 1)
  blah2 = terms .* repmat(vars(id, :), size(terms, 1), 1);
  blah2(blah2 == 0) = 1;
  blah(id) = s.beta(1) + sum(s.beta(2:end) .* prod(blah2, 2));
end

Contact us