MATLAB POLYSPACE RELEASE NOTES Bedienungsanleitung Seite 189

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 240
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 188
Modeling Data
Modeling Data
In this section.. .
“Overview” on page 5-19
“Polynomial Regression” on page 5-19
“General Linear Regression” on page 5-20
Overview
Parametric models translate an understanding of data relationships into
analytic tools with predictive power. Polynomial and sinusoidal models are
simple choices for the up and down trends in the traffic data.
Note This section continues the data analysis from “Visualizing Data” on
page 5-14.
Polynomial Regression
Use the MATLAB polyfit function to estimate coefficients of polynomial
models, then use the MATLAB
polyval function to evaluate the model at
arbitrary values of the predictor.
The following code fits the traffic data at the third intersection with a
polynomial model of degree six:
c3 = count(:,3); % Data at intersection 3
tdata = (1:24)';
p_coeffs = polyfit(tdata,c3,6);
figure
plot(c3,'o-')
hold on
tfit = (1:0.01:24)';
yfit = polyval(p_coeffs,tfit);
plot(tfit,yfit,'r-','LineWidth',2)
legend('Data','Polynomial Fit','Location', 'NW' )
5-19
Seitenansicht 188
1 2 ... 184 185 186 187 188 189 190 191 192 193 194 ... 239 240

Kommentare zu diesen Handbüchern

Keine Kommentare