MATLAB POLYSPACE RELEASE NOTES Instrukcja Użytkownika Strona 189

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 240
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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
Przeglądanie stron 188
1 2 ... 184 185 186 187 188 189 190 191 192 193 194 ... 239 240

Komentarze do niniejszej Instrukcji

Brak uwag