RMSE relative to 1st principal component
- From: Tristin <Tristin@xxxxxxxxxxxx>
- Date: Fri, 11 Aug 2006 19:24:33 -0400
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
.
- Follow-Ups:
- Re: RMSE relative to 1st principal component
- From: Tristin R
- Re: RMSE relative to 1st principal component
- Prev by Date: Re: Handle of GUIDE generated GUI not appearing
- Next by Date: Re: FFT with matlab
- Previous by thread: missing data gets replaced by zeros
- Next by thread: Re: RMSE relative to 1st principal component
- Index(es):
Relevant Pages
|