Danh mục

Lecture note Data visualization - Chapter 29

Số trang: 40      Loại file: pptx      Dung lượng: 2.99 MB      Lượt xem: 3      Lượt tải: 0    
Hoai.2512

Phí tải xuống: 7,000 VND Tải xuống file đầy đủ (40 trang) 0
Xem trước 4 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

The main contents of the chapter consist of the following: The relational algebra, unary relational operations, relational algebra operations from set theory, binary relational operations, ER-to-Relational mapping algorithm, mapping EER model constructs to relations.
Nội dung trích xuất từ tài liệu:
Lecture note Data visualization - Chapter 29Lecture29RecapSummaryofChapter6InterpolationLinearInterpolationCubicSplineInterpolationConnectingdatapointswithstraightlinesprobablyisn’t thebestwaytoestimateintermediatevalues,althoughitis surelythesimplestAsmoothercurvecanbecreatedbyusingthecubic splineinterpolationtechnique,includedintheinterp1 function.Thisapproachusesathirdorderpolynomialto modelthebehaviorofthedataTocallthecubicspline,weneedtoaddafourthfieldto interp1: interp1(x,y,3.5,spline)Thiscommandreturnsanimprovedestimateofyatx=MultidimensionalInterpolationSupposethereisasetofdatazthatdependsontwo variables,xandy.ForexampleContinued….Inordertodeterminethevalueofzaty=3andx=1.5, twointerpolationshavetoperformedOneapproachwouldbetofindthevaluesofzaty=3 andallthegivenxvaluesbyusinginterp1andthendoa secondinterpolationinnewchartFirstlet’sdefinex,y,andzinMATLAB: y=2:2:6; x=1:4; z=[7152230 54109164218Continued….Althoughthepreviousapproachworks,performingthe calculationsintwostepsisawkwardMATLABincludesatwodimensionallinearinterpolation function,interp2,thatcansolvetheprobleminasingle step: interp2(x,y,z,1.5,3) ans= 46.2500Thefirstfieldintheinterp2functionmustbeavector definingthevalueassociatedwitheachcolumn(inthis case,x),andthesecondfieldmustbeavectordefiningContinued….MATLABalsoincludesafunction,interp3,forthree dimensionalinterpolationConsultthehelpfeatureforthedetailsonhowtousethis functionandinterpn,whichallowsyoutoperformn dimensionalinterpolationAllthesefunctionsdefaulttothelinearinterpolation techniquebutwillacceptanyoftheothertechniquesCurveFittingAlthoughinterpolationtechniquescanbeusedtofind valuesofybetweenmeasuredxvalues,itwouldbemore convenientifwecouldmodelexperimentaldataasy=f(x)ThenwecouldjustcalculateanyvalueofywewantedIfweknowsomethingabouttheunderlyingrelationship betweenxandy,wemaybeabletodeterminean equationonthebasisofthoseprinciplesMATLABhasbuiltincurvefittingfunctionsthatallow ustomodeldataempiricallyThesemodelsaregoodonlyintheregionwherewe’ve collecteddataLinearRegressionThesimplestway tomodelasetof dataisasastraight lineSupposeadataset x=0:5; y=[15,10,9,6, 2,0];Ifweplotthedata, wecantrytodraw astraightline throughthedataContinued….Lookingattheplot, thereareseveralof thepointsappearto fallexactlyonthe line,butothersare offbyvarying amountsInordertocompare thequalityofthefit ofthislinetoother possibleestimates, wefindtheContinued….Continued….Thelinearregressiontechniqueusesanapproachcalled leastsquaresfittocomparehowwelldifferentequations modelthebehaviorofthedataInthistechnique,thedifferencesbetweentheactualand calculatedvaluesaresquaredandaddedtogether.Thishas theadvantagethatpositiveandnegativedeviationsdon’t canceleachotheroutMATLABcouldbeusedtocalculatethisparameterfor data.Wehave sum_of_the_squares=sum((yy_calc).^2)Continued….LinearregressionisaccomplishedinMATLABwiththe polyfitfunctionThreefieldsarerequiredbypolyfit: avectorofx–values avectorofy–values anintegerindicatingwhatorderpolynomialshouldbeused tofitthedataSinceastraightlineisafirstorderpolynomial,enterthe number1intothepolyfitfunction: polyfit(x,y,1) ans=2.914314.2857PolynomialRegressionContinued….Wecanfindthesumofthesquarestodeterminewhether thesemodelsfitthedatabetter: y2=0.0536*x.^23.182*x+14.4643; sum((y2y).^2) ans=3.2643 y3=0.0648*x.^3+0.5398*x.^24.0701*x+14.6587 sum((y3y).^2) ans=2.9921Themoretermsweaddtoourequation,the“better”istheContinued….Inordertoplotthecurvesdefinedbythesenew equations,morethanthesixdatapointsareusedinthe linearmodelMATLABcreatesplotsbyconnectingcalculatedpoints withstraightlines,soifasmoothcurveisneeded,more pointsarerequiredWecangetmorepointsandplotthecurveswiththe followingcode: smooth_x=0:0.2:5; smooth_y2=0.0536*smooth_x.^23.182*smooth_x+

Tài liệu được xem nhiều: