[R] problem using tsmp::find_discord

David Katz dk@tz @end|ng |rom t|bco@com
Fri Nov 19 23:36:22 CET 2021


Error from this try: (data below)

library(tsmp)
mp.obj <- stomp(myData, window_size = windowSize) #ok

find_discord(mp.obj, data=input.dt$MeasurementValue)

## Warning in dist_profile(data, data, nn, window_size = .mp$w, index =
discord_idx) :
##   Warning: Result may be inconsistent if the size of the queries are
different.
## Error in fast_avg_sd(data, window_size) :
##   'window_size' must be at least 2.

Thanks.
################################################################
Example:

library(tsmp)

myData<-
c(270.462263440434, 272.664102077857, 269.796430162527, 265.715722218109,
264.406853005756, 265.084587771026, 264.098291489715, 260.43527948116,
258.516029706132, 257.495599873085, 256.301471509598, 257.3508273663,
255.286756542046, 253.920890634228, 252.536181194196, 253.901498621143,
252.488770200592, 253.17373118042, 252.966600656463, 252.703126928303,
253.904283441231, 256.149065587949, 257.487833837001, 257.305445475504,
256.971778599266, 257.031127100531, 258.378144076467, 257.700536692981,
259.294733786397, 257.752154694684, 258.027081468422, 258.08672459079,
258.041715753358, 258.329487642599, 258.299665291887, 258.758197146375,
259.073160554189, 257.290848280257, 256.57958424734, 255.263597775251,
255.428375537274, 254.852562069893, 255.16275117402, 253.104822101118,
252.968454384943, 252.958341056947, 252.413550664159, 252.313035522727,
251.905248262594, 249.840876041166, 250.108495180914, 249.303993972763,
246.963484593993, 248.346250534011, 248.325232558372, 246.80674746288,
247.909455339378, 247.433042791532, 249.402794581885, 249.331976547884,
248.568579055881, 250.594387768302, 251.758252350008, 254.032460428914,
251.686880985135, 253.671777128056, 255.134789754357, 256.064375638822,
253.801672161138, 257.719489656389, 253.966827685572, 255.13559199986,
255.166921377648, 255.962630526721, 257.962603157666, 254.79940264686,
256.855849863449, 255.832325716596, 255.695450823382, 254.736885948759,
251.398771970114, 245.5259580418, 237.715336617082, 232.391882092226,
225.879365097452, 234.597402322106, 227.98504127278, 228.139076301549,
224.173886041436, 226.227280351566, 224.658020137018, 222.056649738085,
223.3202662481, 219.113969733892, 218.391448495584, 218.051289301226,
241.309807159239, 231.913033676054, 246.67008242067, 239.862456006277,
256.373582866136, 258.422042267257, 254.934707124019, 256.099923688313,
253.918253725441, 250.084642761294, 250.806687402073, 253.652116958844,
253.796670716768, 234.682091120398, 231.080911108106, 231.195135810459,
224.727161067631, 223.892852459149, 228.885059227748, 234.115899990639,
238.62885521967, 242.106482479768, 243.921211695019, 244.846424317779,
248.432817418315, 252.583033349365, 255.085796192987, 256.980864458624,
258.223037317721, 257.445069981506, 260.982180904737, 262.487198309787,
264.418811357114, 262.814652461885, 260.130595969269, 261.116867189016,
260.834598457301, 261.334277956188, 260.53066947828, 259.745895410888,
261.29109349791, 261.493881158018, 263.980493014213, 262.876190291578,
264.16183147626, 264.804793464811, 262.390942223882, 261.544820740027,
260.380895000463, 261.926068113605, 260.928243354987, 258.966465326864,
260.547825717181, 259.675027847523, 259.435857442394, 256.966581859812,
255.822263459302, 257.62250959808, 255.608143508667, 255.460477147251,
257.430493221805, 256.616983212018, 256.396313681593, 254.89111013636,
253.111957965884, 253.820672287187, 252.568848789204, 250.287826519459,
250.850996744586, 249.534365097154, 249.722974164085, 249.325430105766,
248.004227338824, 248.422241862165, 248.9895549729, 248.515746102668,
247.411875064159, 247.836559468554, 245.499609602103, 242.627764024446,
243.192466861987, 242.535635591811, 240.80014768187, 241.012683392456,
242.48190025622, 240.923248882825, 240.708791351318, 241.933056565281,
240.334829440666, 240.178917738469, 239.426516135223, 236.317113267444,
234.733216062887, 234.35881561921, 235.381117907399, 235.615542733856,
234.548775568325, 233.18005217826, 233.175399168395, 230.830743898638,
232.722997839982, 232.178285000985, 232.223089888599, 228.928041632613,
230.542523134267, 230.870965189533, 231.808221318154, 231.05403482127,
230.320065171877, 230.50478036101, 235.610489258636, 234.426874698792,
235.079073675256, 233.668844676483, 235.209438616643, 234.347596336808,
235.274837701395, 235.032706411323, 231.35593627654, 230.304829580709,
230.18219645205, 231.520362936985, 230.291755953757, 227.520959882671,
227.357653270895, 225.333449562034, 217.811542729707, 227.059990683896,
239.990208812803, 228.059115129057, 228.868406292098, 236.034196653264,
234.17751710834, 237.003069269005, 239.052892482514, 240.428051100904,
240.191306406911, 240.50419596592, 240.901681595389, 237.87181299557,
236.850762880128, 233.509818236437, 231.983081438765, 235.119339047512,
240.263921064651, 244.679595292406, 248.93951106756, 252.122590302397,
258.805282831052, 242.687846377119, 237.204158759257, 243.178667159705,
231.431086514657, 223.708970214007, 221.640786242951, 219.97023160113,
210.878755430737, 179.209233482601, 144.494342460437, 163.888149251789,
186.003606780246, 189.352081675269, 194.529081804026, 196.759613684891,
223.580900584348, 227.607943509612, 218.162016380718, 211.594753752323,
214.163046110841, 215.744377558026, 227.310642507114, 227.799354057526,
227.551336807385, 226.132788368966, 221.52987925848, 218.445829530153,
218.89121471229, 220.106824906403, 224.207053555921, 226.583060863288,
229.061297126161, 231.837136147171, 234.080896296026, 238.081307704421,
240.863466976117, 240.980620885221, 242.865790697373, 242.192567156209,
244.400966976397, 230.117940277327, 246.551293436438, 248.382975894492,
251.654291217308, 256.004255625047, 257.742864777334, 262.281011258299,
261.284388574678, 261.408284877567, 262.63402390047, 262.027830331167,
263.04610984805, 264.671093973145, 264.421757659875, 265.237929494493,
266.872099533025, 264.696907634661, 264.260035745148, 263.499976769043,
262.425159591483, 260.981390716648, 261.082354369201, 259.278915649932,
259.796834945399, 257.282395334402, 255.692769738659, 256.477281617327,
256.18586372775, 255.027394031128, 253.672028350737, 253.725117554283,
253.678845994268, 252.442158376286, 252.079511253303, 254.582988659106,
254.874491709983, 252.931852529524, 252.177873732708, 251.521926319506,
252.912911842065, 253.201235300861, 251.230596607132, 250.384639365599,
251.930171640497, 247.943138212385, 227.360327759245, 236.807827285165,
236.256607593177, 245.676176491845, 248.029262333829, 246.607130076038,
247.609178481344, 247.744748076377, 247.872489046957, 247.48352803234,
249.194618296623, 249.265455424832, 249.594569674553, 250.408728755265,
247.515878390195, 248.641169324564, 249.340687829629, 249.36502006175,
250.620096849697, 250.924085881794, 251.446678319806, 252.231693277322,
253.722321051266, 251.152605426591, 254.144238363625, 255.721436826838,
255.942811810924, 256.764821865549, 257.00394097222, 258.391524989996,
259.436215976905, 260.193549101287, 261.534455659939, 261.899602734251,
262.616657174518, 263.481273697829, 264.543112079194, 266.521162025398,
267.961329632392, 266.7146434505, 264.785401400272, 265.351171001932,
270.092530136788, 262.900027005747, 258.104321945971, 243.820629691239,
251.983970767446, 255.462414786033, 260.955431247223, 262.743916866882,
262.536868907092, 263.482801351137, 260.690328582004, 259.374907453964,
259.448360515013, 260.766381761152, 266.51212834334, 261.178649726696,
262.13204070949, 260.329801393952, 257.072608946357, 256.699290173501,
259.76781842229, 259.634321800619, 256.142043520836, 253.331642591441,
252.409818426427, 253.606348613091, 254.796218211763, 255.09623971465,
256.665105978632, 255.078059232282, 254.524220743589, 252.710077736247,
252.699360275641, 252.984852506546, 251.256105145533, 249.920269056596,
244.926144783245, 233.956022891542, 220.813007885031, 215.895915163588,
219.629850208992, 226.529124786425, 235.032123494009, 250.546880197711,
254.095666445652, 253.991281213844, 257.473874318134, 255.711023276206,
254.706592350919, 255.897299568681, 255.423667051829, 254.964414633531,
252.309596570162, 250.816389805404, 252.822825341718, 252.433744078688,
253.788538636919, 253.051533051301, 252.259801258752, 251.700941357203,
252.480709904758, 253.304639213951, 253.813290173747, 252.224179178895,
252.5256305716, 252.953270357102, 253.056596744107, 250.887811907567,
249.785344008962, 249.608008671692, 250.198318963079, 249.545803866489,
248.918121550092, 250.413202223321, 248.905568386056, 249.915943725407,
249.996626693197, 248.072932397947, 254.216837446764, 253.47859208961,
254.138987503108, 252.998968019197, 252.145336908707, 253.886762010027,
256.153072158387, 253.416947685881, 256.800148054864, 259.224442075146,
259.926382599212, 260.744060715055, 261.333067704411, 261.70551071479,
260.628314612014, 260.506542761438, 263.354614044726, 266.13290756708,
262.400702435337, 268.301353736501, 267.563565765135, 265.179775401112,
267.50084469174, 265.084311419213, 265.91631323141, 265.908458636794,
267.454699323839, 270.140777570102, 270.156144841528, 269.984118177928,
269.369715720695, 269.112561377231, 267.868800598569, 270.406678517722,
269.055867271265, 265.774697500886, 265.295737018483, 264.470831104601,
265.450849219086, 267.017599059781, 266.64912298019, 263.305864860443,
261.791948233685, 260.177485275595, 261.369886779133, 259.69575348706,
259.332128965948, 255.718119134055, 256.938581692474, 256.615531389322
)

mp.obj <- stomp(myData, window_size = windowSize)

find_discord(mp.obj, data=input.dt$MeasurementValue)

## Warning in dist_profile(data, data, nn, window_size = .mp$w, index =
discord_idx) :
##   Warning: Result may be inconsistent if the size of the queries are
different.
## Error in fast_avg_sd(data, window_size) :
##   'window_size' must be at least 2.

*David Katz*, TIBCO Data Science


1.541.324.7417

	[[alternative HTML version deleted]]



More information about the R-help mailing list