cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-13203%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EHow%20to%20resample%20%2F%20interpolate%20unevenly%20spaced%20time%20series%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-13203%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CP%3EI%20have%20an%20dataset%20consisting%20of%20two%20columns%2C%20X%20and%20Y%2C%20resulting%20from%20a%20measurement%20(cyclic%20voltammetry%20using%20PAR%20potentiostat).%20Unfortunately%2C%20the%20spacing%20of%20X%20is%20not%20equal%20(varies%20between%200.0005%20and%200.0015)%2C%20and%20the%20instrument's%20software%20cannot%20fix%20this.%20I%20would%20like%20to%20resample%20or%20interpolate%20the%20data%20to%20get%20equal%20spacing%20of%2C%20say%2C%200.001%20in%20X.%20Is%20there%20a%20fast%20way%20to%20do%20it%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-13205%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20How%20to%20resample%20%2F%20interpolate%20unevenly%20spaced%20time%20series%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-13205%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EThank%20you!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-13204%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20How%20to%20resample%20%2F%20interpolate%20unevenly%20spaced%20time%20series%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-13204%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EThe%20answer%20to%20your%20question%20depends%20on%20how%20irregular%20your%20x%20values%20are%2C%20and%20what%2C%20precisely%2C%20you%20mean%20by%20'interpolate'.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ESo%20the%20script%20below%20is%20definitely%20not%20a%20recommendation%2C%20just%20an%20example%20of%20the%20kind%20of%20thing%20that's%20possible.%20If%20you%20don't%20need%20a%20script%2C%20you%20should%20be%20able%20to%20follow%20similar%20steps%20manually.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EProbably%2C%20though%2C%20the%20important%20question%20is%20what%20will%20you%20use%20the%20final%20values%20for%3F%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23032ce4%3B%22%3ENamesDefaultToHere%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E1%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E)%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23008f00%3B%22%3E%2F%2F%20(0)%20Make%20some%20evenly%20spaced%20data%20using%20a%20particular%20function%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3Eh%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3EFunction%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSTRONG%3E%7B%3C%2FSTRONG%3Ex%3CSTRONG%3E%7D%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSTRONG%3E%7B%3C%2FSTRONG%3EDefault%20Local%3CSTRONG%3E%7D%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E0.5%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E0.4%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E*%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3ESin%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E2%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E*%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3EPi%3C%2FSPAN%3E%3CSTRONG%3E()%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E*%3C%2FSPAN%3E%20x%20%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23008f00%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3EN%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E100%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%2F%2F%20Number%20of%20(equally-spaced)%20x%20values%20in%20%5B0%2C1%5D%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3ExVals%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3EIndex%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E0%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E1%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E1%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2F%3C%2FSPAN%3E%20%3CSTRONG%3E(%3C%2FSTRONG%3EN%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E-%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E1%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%60%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%23008f00%3B%22%3E%2F%2F%20x%20values%20as%20a%20column%20vector%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3EyVals%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%20h%3CSTRONG%3E(%3C%2FSTRONG%3E%20xVals%20%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3EJ%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%20N%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E1%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3ERandom%20Normal%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E0%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E0.1%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%23008f00%3B%22%3E%2F%2F%20y%20values%20as%20a%20column%20vector%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23008f00%3B%22%3E%2F%2F%20(1)%20Randomly%20decimate%20three%20quarters%20the%20data%20to%20simulate%20uneven%20x%20values%20(but%20still%20on%20the%20original%20grid)%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23032ce4%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3Edel%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3ERandomIndex%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E(%3C%2FSTRONG%3EN%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3ERound%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E3%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E*%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3EN%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2F%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E4%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E0%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E))%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3ExVals%3CSTRONG%3E%5B%3C%2FSTRONG%3Edel%3CSTRONG%3E%5D%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%20%3CSTRONG%3E%5B%5D%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3EyVals%3CSTRONG%3E%5B%3C%2FSTRONG%3Edel%3CSTRONG%3E%5D%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%20%3CSTRONG%3E%5B%5D%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23942193%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3Edt%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3ENewTable%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%3C%2FSPAN%3E%22Uneven%20x%22%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3ENewColumn%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23942193%3B%22%3E%22x%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Numeric%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Continuous%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Values%3CSTRONG%3E(%3C%2FSTRONG%3ExVals%3CSTRONG%3E))%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3ENewColumn%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23942193%3B%22%3E%22y%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Numeric%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Continuous%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Values%3CSTRONG%3E(%3C%2FSTRONG%3EyVals%3CSTRONG%3E))%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23008f00%3B%22%3E%2F%2F%20(2)%20Fit%20a%20kernel%20smoother%20and%20save%20the%20prediction%20formula%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3Ebiv%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%20dt%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%26lt%3B%26lt%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3CSTRONG%3EBivariate%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%20Y%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3A%3C%2FSPAN%3Ey%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20X%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3A%3C%2FSPAN%3Ex%20%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3Ebiv%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%26lt%3B%26lt%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3CSTRONG%3EKernel%20Smoother%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E1%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E1%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E0.48261%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E0%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSTRONG%3E%7B%3C%2FSTRONG%3ESave%20Prediction%20Formula%3CSTRONG%3E%7D)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23008f00%3B%22%3E%2F%2F%20(3)%20Get%20the%20prerdiction%20formula%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23942193%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3EpForm%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3EColumn%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E(%3C%2FSTRONG%3Edt%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3E%22Loess%20Predictor%20for%20y%22%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%26lt%3B%26lt%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3CSTRONG%3EgetProperty%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%3C%2FSPAN%3E%22Formula%22%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E)%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23008f00%3B%22%3E%2F%2F%20(4)%20Build%20a%20new%20table%20to%20hold%20equally-spaced%20x%20values%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3ECMD%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3EExpr%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20dt2%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3ENewTable%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23942193%3B%22%3E%22Even%20x%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3ENewColumn%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23942193%3B%22%3E%22x%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Numeric%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Continuous%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3ENewColumn%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23942193%3B%22%3E%22Predicted%20y%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Numeric%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Continuous%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Formula%3CSTRONG%3E(%3C%2FSTRONG%3ETBD%3CSTRONG%3E))%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23032ce4%3B%22%3ESubstituteInto%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E(%3C%2FSTRONG%3ECMD%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3EExpr%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E(%3C%2FSTRONG%3ETBD%3CSTRONG%3E)%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3EEvalExpr%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E(%3C%2FSTRONG%3EpForm%3CSTRONG%3E))%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3ECMD%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23008f00%3B%22%3E%2F%2F%20(5)%20Get%20the%20simulated%20measured%20data%20into%20two%20vectors%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23011993%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3ExVals%20%3C%2FSPAN%3E%3D%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3EColumn%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E(%3C%2FSTRONG%3Edt%3C%2FSPAN%3E%2C%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23942193%3B%22%3E%22x%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3C%2FSPAN%3E%26lt%3B%26lt%3B%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3E%3CSTRONG%3EGetAsMatrix%3C%2FSTRONG%3E%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23011993%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3EyVals%20%3C%2FSPAN%3E%3D%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3EColumn%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E(%3C%2FSTRONG%3Edt%3C%2FSPAN%3E%2C%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23942193%3B%22%3E%22y%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3C%2FSPAN%3E%26lt%3B%26lt%3B%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3E%3CSTRONG%3EGetAsMatrix%3C%2FSTRONG%3E%3B%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23008f00%3B%22%3E%2F%2F%20(6)%20Find%20the%20smallest%20x%20increment%20in%20the%20data%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3ExDel%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3EMin%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3ExVals%3CSTRONG%3E%5B%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E2%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3A%3A%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3ENRow%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3ExVals%3CSTRONG%3E)%5D%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E-%3C%2FSPAN%3E%20xVals%3CSTRONG%3E%5B%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E1%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3A%3A%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3ENRow%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3ExVals%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E-%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E1%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSTRONG%3E)%5D)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23008f00%3B%22%3E%2F%2F%20(7)%20Fill%20the%20table%20with%20the%20interpolated%20data%20using%20an%20equal%20spacing%20of%2C%20say%203*xDel%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3ExVals2%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3EIndex%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E0%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E1%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E3%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E*%3C%2FSPAN%3ExDel%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%60%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3EColumn%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3Edt2%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23942193%3B%22%3E%22x%22%3C%2FSPAN%3E%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%26lt%3B%26lt%3B%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3CSTRONG%3ESetValues%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3ExVals2%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23008f00%3B%22%3E%2F%2F%20(8)%20Look%20at%20the%20result%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%20color%3A%20%23011993%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3Edt2%20%3C%2FSPAN%3E%26lt%3B%26lt%3B%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%20%3C%2FSPAN%3E%3CSTRONG%3EGraph%20Builder%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20Size%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E534%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E454%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20Show%20Control%20Panel%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E0%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20Variables%3CSTRONG%3E(%3C%2FSTRONG%3E%20X%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3A%3C%2FSPAN%3Ex%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Y%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3A%3C%2FSPAN%3EPredicted%20y%20%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20Elements%3CSTRONG%3E(%3C%2FSTRONG%3E%20Points%3CSTRONG%3E(%3C%2FSTRONG%3E%20X%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Y%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%2C%3C%2FSPAN%3E%20Legend%3CSTRONG%3E(%3C%2FSTRONG%3E%20%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E5%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2012px%3B%20font-family%3A%20Courier%3B%22%3E%26nbsp%3B%20%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar

How to resample / interpolate unevenly spaced time series?

I have an dataset consisting of two columns, X and Y, resulting from a measurement (cyclic voltammetry using PAR potentiostat). Unfortunately, the spacing of X is not equal (varies between 0.0005 and 0.0015), and the instrument's software cannot fix this. I would like to resample or interpolate the data to get equal spacing of, say, 0.001 in X. Is there a fast way to do it?

2 REPLIES 2
ian_jmp
Level X

Re: How to resample / interpolate unevenly spaced time series?

The answer to your question depends on how irregular your x values are, and what, precisely, you mean by 'interpolate'.

So the script below is definitely not a recommendation, just an example of the kind of thing that's possible. If you don't need a script, you should be able to follow similar steps manually.

Probably, though, the important question is what will you use the final values for?

NamesDefaultToHere(1);

// (0) Make some evenly spaced data using a particular function

h = Function( {x}, {Default Local}, 0.5 + 0.4 * Sin( 2 * Pi() * x ) );

N = 100;                                                       // Number of (equally-spaced) x values in [0,1]

xVals = Index( 0, 1, 1 / (N - 1) )`;                           // x values as a column vector

yVals = h( xVals ) + J( N, 1, Random Normal( 0, 0.1 ) );       // y values as a column vector

// (1) Randomly decimate three quarters the data to simulate uneven x values (but still on the original grid)

del = RandomIndex(N, Round(3*N/4, 0));

xVals[del] = [];

yVals[del] = [];

dt = NewTable("Uneven x",

  NewColumn("x", Numeric, Continuous, Values(xVals)),

  NewColumn("y", Numeric, Continuous, Values(yVals))

  );

// (2) Fit a kernel smoother and save the prediction formula

biv = dt << Bivariate( Y( :y ), X( :x ) );

biv << Kernel Smoother( 1, 1, 0.48261, 0, {Save Prediction Formula});

// (3) Get the prerdiction formula

pForm = Column(dt, "Loess Predictor for y") << getProperty("Formula");

// (4) Build a new table to hold equally-spaced x values

CMD = Expr(

  dt2 = NewTable("Even x",

  NewColumn("x", Numeric, Continuous),

  NewColumn("Predicted y", Numeric, Continuous, Formula(TBD))

  )

  );

SubstituteInto(CMD, Expr(TBD), EvalExpr(pForm));

CMD;

// (5) Get the simulated measured data into two vectors

xVals = Column(dt, "x") << GetAsMatrix;

yVals = Column(dt, "y") << GetAsMatrix;

// (6) Find the smallest x increment in the data

xDel = Min(xVals[2::NRow(xVals)] - xVals[1::(NRow(xVals)-1)]);

// (7) Fill the table with the interpolated data using an equal spacing of, say 3*xDel

xVals2 = Index( 0, 1, 3*xDel )`;

Column(dt2, "x") << SetValues(xVals2);

// (8) Look at the result

dt2 << Graph Builder(

  Size( 534, 454 ),

  Show Control Panel( 0 ),

  Variables( X( :x ), Y( :Predicted y ) ),

  Elements( Points( X, Y, Legend( 5 ) ) )

  );

Re: How to resample / interpolate unevenly spaced time series?

Thank you!

Recommended Articles