MatlabPARAFAC运行办法.pdf

上传人:wj 文档编号:3437391 上传时间:2023-05-05 格式:PDF 页数:6 大小:350.18KB
下载 相关 举报
MatlabPARAFAC运行办法.pdf_第1页
第1页 / 共6页
MatlabPARAFAC运行办法.pdf_第2页
第2页 / 共6页
MatlabPARAFAC运行办法.pdf_第3页
第3页 / 共6页
MatlabPARAFAC运行办法.pdf_第4页
第4页 / 共6页
MatlabPARAFAC运行办法.pdf_第5页
第5页 / 共6页
MatlabPARAFAC运行办法.pdf_第6页
第6页 / 共6页
亲,该文档总共6页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

MatlabPARAFAC运行办法.pdf

《MatlabPARAFAC运行办法.pdf》由会员分享,可在线阅读,更多相关《MatlabPARAFAC运行办法.pdf(6页珍藏版)》请在冰点文库上搜索。

MatlabPARAFAC运行办法.pdf

Appendix1:

TutorialCharacterizingDOMfluorescenceusingtheDOMFluorToolboxforMATLABInthissectionabrieftutorialinapplyingPARAFACtoDOMfluorescenceEEMswillbegivenwithrecommendationsonasuitableseriesofstagestofollowinordertofacilitatetheprocessbasedontheauthorsownexperience.ThetutorialisbasedonMATLABsoftwareandrequiresthatthisisinstalledonyourcomputer.TheDOMFluortoolboxforMATLABpro-videdisinthecompressedfile“DOMFluorv1_4.zip”(Appen-dix1)andworksindependentofyourcomputersoperatingsystem.ThisisalsofreelydownloadablefromtheChemomet-ricssiteatUniversityofCopenhagen(www.models.life.ku.dk).ThetoolboxcontainswithinittheN-Waytoolboxv.3.1(AndersonandBro,2000)andadditionalfunctionswhichfacilitaterunningPARAFAConDOMfluorescencedata.TheDOMFluortoolboxiswrittenandtestedinMATLABrelease2007b(v7.5)andisfreesoftwarethatcanbeusedandmodi-fiedunderthetermsoftheGNUGeneralPublicLicense.Withinthetoolboxatestdatasetisprovidedforthetutorial,consistingof65EEMswhichhavebeenspectrallycorrectedforinstrumentbiases,correctedforinnerfiltereffectsandRamancalibrated.Asaresult,alloftheRayleighscatterandmostoftheRamanscatterhasbeenremoved.Theremainingscatterwillberemovedinthepre-processingphase.ThedataconsistsofsamplescollectedfromacruiseonRVGunnarThorsonintheKattegatandBeltSearegion(attheentrancetotheBalticSea)inAugust2001.Three“outlier”sampleswerecreatedandarepresentinthedataforthebenefitofthetutorial.Thetutorialiscomposedofphases;i)datapre-processing,ii)initialexplorativedataanalysis,iii)modelingandmodelvalidation,iv)interpretingresults.Themorethoroughlythefirsttwophasesarecarriedout,theeasierthelattertwowillbe.Partofthepre-processingontheexampledatasethasalreadybeencarriedout(importingthedatatoMATLAB,spec-tralcorrections,calibrations,etc.).Thisisveryinstrumentspe-cificandthereforenotappropriateforthistutorial,whichfocusonthemodelingofthedata.DuringthistutorialanystatementstobewritteninMAT-LABwillbewritteningreenwithCourierNewfont.WhenwritingintheCommandWindow,notethatMATLABiscasesensitive.A.SettingupMATLABtorunwithN-waytoolboxandDOMFluortoolbox.1.DecideonasensibleplacetolocatetheDOMFluortoolboxonyourcomputer.(Thiscould,forexample,beC:

ProgramFilesMATLABR2007btoolboxbutcanalsobeelsewhere).CreateafolderandnameitDOMFluor.Extractthecontentsofthezipfile“DOM-Fluor.zip”intotheDOMFluorfolder.2.StartMATLAB.SelectFilemenuthenclickSetpath.ClickAddwithsubfoldersandlocatetheDOMFluorfolderyoucreatedinStep1above.IftheN-Waytool-boxiscurrentlyinstalled,removeitfromthePathlisttoavoidconflicts.TheN-WaytoolboxisincludedaspartoftheDOMFluortoolbox.ClickSavethenClose.YouhavenowassociatedtheDOMFluortool-boxwithMATLABandthismeansthatthefunctionsinthesefolderscanberecognized.3.TocheckthatthetoolboxesarecorrectlyassociatedyoucantypeDOMFluorandpressenterintheCommandWindowinMATLAB.If“Yes”isprintedtotheCommandWindow,thetool-boxisinstalled.Ifredtextappearsthetoolboxhasnotbeencorrectlyinstalled.RedoStep2.Notethatifyouhaveothertoolboxeswithsimilarlynamedfunctions,onlythefunctionupmostinthefolder-listwillworkproperly.4.SectionAwillhavetoberepeatedifanewversionofMATLABisinstalled.B.LoadingthetutorialdataandplottingtheEEMs.1.TypeloadPARAFACexample.matintheCommandWindow.ThiswillloadthetutorialdataintotheMATLABWorkspace.ThisconsistsofadatastructurecalledOriginalData.TrytypingOriginalDataCharacterizingdissolvedorganicmatterfluorescencewithparal-lelfactoranalysis:

atutorialColinA.Stedmon1*andRasmusBro21DepartmentofMarineEcology,NationalEnvironmentalResearchInstitute,AarhusUniversity,Frederiksborgvej399,Roskilde,Denmark2Dept.FoodScience,FacultyofLifeSciences,UniversityCopenhagen,Rolighedsvej30,DK-1958,Frederiksberg,Denmark*Correspondingauthore-mail:

cstdmu.dk,Tel:

+4546301805.Limnol.Oceanogr.:

Methods6,20082008,bytheAmericanSocietyofLimnologyandOceanography,Inc.inthecommandwindow.Thiswilloutputthefollowing:

Thisdetailsthedatathatiscontainedwithinthedatastructure.i.Ex-isalistoftheexcitationwavelengthsmea-sured(innm).Inthiscase240to450every5nm.ii.Em-isalistoftheemissionwavelengthsmea-sured(innm).Inthiscase300to600every2nm.iii.X-isthefluorescencedataasathreedimen-sionalarray(65samplesx151emissionwave-lengthsx43excitationwavelengths).iv.nSample,nExandnEm:

statethenumberofsamples,excitationandemissionwavelengths.v.XBackup-isabackupcopyofthedataandnotusedinthetutorial.2.NowwewillplottheEEMstocheckthatthedataiscorrectlyloaded.Inthetoolboxthereareseveralfunc-tionsthatcanbeusedtoplotEEMs.a.TypingPlotEEMby1(1:

5,OriginalData,R.U.)willplotthefirst5EEMsinthedatasetoneatatimeascontourplots.Thenextgraphcanbeviewedbypressinganykeyonthekeyboard.If1:

5isreplacedwith1:

65all65sampleswillbeplottedoneatatime.TheplottingprocesscanbehaltedatanytimebyenteringCtrl+ConthekeyboardandthenclosingtheFigurewindow.b.TypingPlotEEMby4(1,OriginalData,R.U.)willplotthedatafouratatime.Thisisquickerwhendealingwithlargedatasets.c.TypingPlotEEMby4FixZ(1,OriginalData,R.U.)doesthesameasabovebutplotsthedatawithafixedz-axis(colorbarscale)automaticallyderivedfromtheminandmaxmeasureddata.3.Tryusingthethreefunctions.AlsotrytypinghelpPlotEEMby1,helpPlotEEMby4,andfinallyhelpPlotEEMby4FixZ.SomeinstructionsonhowtousethefunctionsareprintedtotheCommandWindow.ThisistrueforallfunctionsinMATLAB(e.g.trytyp-inghelpload).4.SurfaceplotscanalsobeplottedinasimilarwayusingthePlotSurfby1,andPlotSurfby4functions.C.Cuttingtheregionofthespectrainfluencedbyscatterpeaks.1.Thisstepcreatesanewcopyofthedatawherethewavelengthsinfluencedbyscatterpeakshavebeencutandreplacedwithmissingvaluesorzeros.TypeCutData=EEMCut(OriginalData,20,20,NaN,NaN,No)thedatawillbecutandthenplottedsothattheEEMsbeforeandafterthecutcanbecompared.Thegraphswillplotautomaticallyfromthefirstsampletothelast.Thefunctiondeletesthedataintheregionofnofluorescence(whereemissionwavelengthislessthanexcitationwavelength)andtheregionsgreatlyinflu-encedbyfirstorderscatter(whereRayleighandRamanpeaksdominatethesignal)andreplacesthemwithmissingvalues(“NaN”(NotANumber)inMAT-LAB).AdditionallyaregionofzerosisinsertedtoassistthePARAFACmodeling.2.TypehelpEEMCuttoreadanexplanationofwhatthisfunctiondoes.3.Experimentwithchangingtheinputvaluesfor(20,20,NaN,NaN,No)andobservehowthedataiscutdifferently.4.BeforeproceedingwiththetutorialtypeCutData=EEMCut(OriginalData,20,20,NaN,NaN,)sothatthedataisprocessedappropriatelyfortherestofthetutorial.Thiswillcutthedata,butnotplottheresults.D.Initialexplorativedataanalysisandoutlieridentification.Inthisstep,aseriesofPARAFACmodelsareruninordertoexplorethedataforoutliersamples,noisywavelengths,orotherpotentialproblemswiththedatathatarenoteasilyidentifiedbyvisualanalysisoftheEEMplots.Thestepisstruc-turedintotwotests:

oneontheoriginal(complete)dataandasecondonamodifieddatasetwhereoutliershavebeenremoved.ThedatasetcanbereducedinsizebyselectingeveryotherEmissionwavelength,(i.e.300,304,306.nm,insteadofthemeasured300,302,304,306.Thiswillspeedthemod-StedmonandBroFluorescence-PARAFACanalysisofDOM2elingprocessconsiderably,withoutnecessarilynotablyinflu-encingtheoutcome(exceptthespectralresolutionoftheloadings).Thisisnotdoneherebuttryitoutlater.Theques-tionstobeaddressedhereare;-Aretherespecificsamplesorwavelengthsthatareinflu-encingthemodelfitmuchmorethantheothers?

-Whatseemstobetheappropriate“ballpark”numberofPARAFACcomponents(i.e.thenumberofdistinctfluores-centphenomena)?

3-5components,8-10?

etc.Whendothespectraofthecomponentsfoundbeginnottolooklikeorganicfluorophoresbutmorelikescatterpeaksornoise?

1.TypehelpOutlierTestintotheCommandWindowandreadtheexplanationofthefunction.2.TypeTest1=OutlierTest(CutData,2,1,7,No,No)toperformthefirsttest.Afterpressinganykeythiswillrunaseriesofmodelsfrom2componentsto7components.Theresultsfromtheseinitialfivemod-els(2,3,4,5,6and7componentmodels)canbeeval-uatedinmanywaysbutforthistutorialwewillusetwotypesofplots;loadingsandleverages.Thesetestswilltakeapprox3minutesforyourcomputertorun.3.TypehelpPlotLoadingsandreadaboutthefunctionthentypePlotLoadings(Test1,2)andafigurewillbecreatedshowingthescoresandloadingsofthemodel(a,bandcinEquation1).4.Plotsbandcshowtheemissionandexcitationload-ingsofthetwocomponents.Plotashowshowtheconcentrationofthetwocomponentsvariesbetweensamples.Checkthattheloadingslookreasonable,i.e.thattheyaresmoothandspectralappearancethatcor-respondswellwithyourunderstandingofthedata.5.Anotherusefulplotisthatofleverages.TypehelpPlotLeverageandreadaboutthefunctionandthentypePlotLeverage(Test1,2)andafigurewillbecreatedshowingtheleverages.Intheplot,lookforsamplesthathaveextremeleveragesindicatingextremeandpotentiallyoutlyingsamples.6.Tip:

UsingthefunctionPlotLLcreatesacombinationofboththeleverageandloadingplots.TrytypingPlotLL(Test1,2)7.Nowtrycreatingthesameplotsfortheothermodels(3,4,5,6and7components).Afterexaminingtheloadingplotsitshouldbeapparentthatweneedtobegintoconstrainthemodel.Someofthe

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > PPT模板 > 商务科技

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2