RMSE relative to 1st principal component



A colleague wanted me to justify using pca to determine error of a
curved, planar, trajectory from a straight line (He is more
comfortable with linear regression). My two results below are in the
relation that I would expect (rmsefit is smaller). Did I calculate
them properly?

[segpcoef, newsegdt, variance] = princomp(trajectory{pidx}) ;

% sqrt(variance(2)) = RMSE of the fit to the 1st pricipal component
?
rmsefit(pidx)=sqrt(variance(2)) ;

[p,S,mu] = polyfit(trajectory{pidx}(:,1),trajectory{pidx}(:,2),1) ;

[y,delta] = polyval(p,trajectory{pidx}(:,1),S,mu) ;
rmse2=sqrt(1/161*sum(delta.^2)) ; % 161 = # of samples

rmsefit(pidx)

ans =

0.0207

rmse2

rmse2 =

0.0317
.



Relevant Pages

  • Two new pics
    ... Baggy sitting on the roof of my car, it seems to be on of his favourite ... Cats leave pawprints on your heart. ...
    (rec.pets.cats.anecdotes)
  • Re: Seeking a correct explanation for Stellar Abberation
    ... | A laser with a vertical beam is moving along the ground under the ball ... = trajectory of ball in ground frame ... an object can be a straight line in one frame and a parabola ...
    (sci.physics.relativity)
  • Re: Seeking a correct explanation for Stellar Abberation
    ... And in Wonderland this parabolic curve isn't the trajectory ... It has but one true Wonderland trajectory, and that's a straight line. ... You plot its 'trajectory' in your frame and get something like this: ... But you, Henry Wilson, made a GIANT fool of yourself ...
    (sci.physics.relativity)
  • Re: How do I fit a line through three points in space?
    ... > fitting a straight line through a number of points in a plane ... > Although this is probably a trivial problem for you mathematicians I ... With two coordinates it's just linear regression, ...
    (sci.math.num-analysis)
  • Re: Differential equation
    ... The trajectory rwill decribe a conic ... (ellipse, circle, parabola, hyperbola, ... straight line) will depend upon the ... Initial position and velocity, that is vectors r ...
    (sci.math)