使用 Mathematica 缩放/移动实验数据向量

发布于 2024-11-19 21:37:38 字数 1150 浏览 4 评论 0原文

我有一些需要处理的实验数据向量,例如:

{
 {0, 61237, 131895, 194760, 249935},
 {0, 61939, 133775, 197516, 251018},
 {0, 60919, 131391, 194112, 231930},
 {0, 60735, 131015, 193584, 249607},
 {0, 61919, 133631, 197186, 250526}, 
 {0, 61557, 132847, 196143, 258687},
 {0, 61643, 133011, 196516, 249891},
 {0, 62137, 133947, 197848, 251106}
}

每个向量都是一次运行的结果,由五个数字组成,这些数字是物体通过五个传感器中每个传感器的时间。在测量间隔内,物体的速度是恒定的(传感器到传感器的间隔不同,因为传感器间距不均匀)。从一次运行到下一次运行,传感器的间距保持不变,但物体的速度从一次运行到下一次运行会略有不同。

如果传感器是完美的,每个向量应该只是任何其他向量的标量倍(与它们的速度之比成比例)。但实际上,每个传感器都会有一些“抖动”,并会提前或延迟触发一些小的随机量。我试图分析传感器本身的性能如何,即它们给我的测量结果中有多少“抖动”?

所以我认为我需要做以下事情。对于每个向量,我必须对其进行缩放,然后添加然后稍微移动向量(对其五个元素中的每个元素添加或减去固定量)。然后每列的标准偏差将描述该传感器中的“噪声”或“抖动”量。必须选择每个向量缩放的量以及每个向量移位的量,以最小化列的标准偏差。

在我看来,Mathematica 可能有一个很好的工具包来完成这个任务,事实上我想我可能已经用 Standardize[] 找到了答案,但它似乎是面向处理标量列表的,不是像我这样的列表列表(或者至少我无法弄清楚将其应用到我的案例中)。

因此,我正在寻找一些关于我可以使用哪些库函数来解决这个问题的提示,或者也许是我可能需要自己分解算法的提示。也许我的问题的一部分是我不知道该往哪里看 - 我这里遇到的是“信号处理”问题,或者是数据操作或数据挖掘问题,或者是最小化问题,或者可能是一个相对标准的问题我以前根本没有听说过的统计功能?

(作为奖励,我希望能够控制用于优化此缩放/移位的加权函数;例如,在上面的数据中,我怀疑传感器#5 存在问题,因此我希望拟合数据以仅考虑 SD进行缩放/移动时传感器 1-4 的数量)

I have some vectors of experimental data that I need to massage, for example:

{
 {0, 61237, 131895, 194760, 249935},
 {0, 61939, 133775, 197516, 251018},
 {0, 60919, 131391, 194112, 231930},
 {0, 60735, 131015, 193584, 249607},
 {0, 61919, 133631, 197186, 250526}, 
 {0, 61557, 132847, 196143, 258687},
 {0, 61643, 133011, 196516, 249891},
 {0, 62137, 133947, 197848, 251106}
}

Each vector is the result of one run and consists of five numbers, which are times at which an object passes each of five sensors. Over the measurement interval the object's speed is constant (the sensor-to-sensor intervals are different because the sensor spacings are not uniform). From one run to the next the sensors' spacing remains the same, but the object's speed will vary a bit from one run to the next.

If the sensors were perfect, each vector ought to simply be a scalar multiple of any other vector (in proportion to the ratio of their speeds). But in reality each sensor will have some "jitter" and trigger early or late by some small random amount. I am trying to analyze how good the sensors themselves are, i.e. how much "jitter" is there in the measurements they give me?

So I think I need to do the following. To each vector I must scale it, and add then shift the vector a bit (adding or subtracting a fixed amount to each of its five elements). Then the StandardDeviation of each column will describe the amount of "noise" or "jitter" in that sensor. The amount that each vector is scaled, and the amount each vector is shifted, has to be chosen to minimize the standard deviation of columns.

It seemed to me that Mathematica probably has a good toolkit for getting this done, in fact I thought I might have found the answer with Standardize[] but it seems to be oriented towards processing a list of scalars, not a list of lists like I have (or at least I can't figure out to apply it to my case here).

So I am looking for some hints toward which library function(s) I might use to solve this problems, or perhaps the hint I might need to cleave the algorithm myself. Perhaps part of my problem is that I can't figure out where to look - is what I have here is a "signal processing" problem, or a data manipulation or data mining problem, or a minimization problem, or maybe it's a relatively standard statistical function that I simply haven't heard of before?

(As a bonus I would like to be able to control the weighting function used to optimize this scaling/shifting; e.g. in my data above I suspect that sensor#5 is having problems so I would like to fit the data to only consider the SDs of sensors 1-4 when doing the scaling/shifting)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

水溶 2024-11-26 21:37:38

我无法对你的算法本身发表太​​多评论,因为数据分析不是我的强项。然而,据我了解,您正在尝试描述每个传感器的时序变化。由于来自单个传感器的数据位于矩阵的单列中,因此我建议将其转置并将标准化映射到每组数据。换句话说,

dat = (* your data *)
Standardize /@ Transpose[dat]

要将其放回柱状形式,请转置结果。要将最后一个传感器排除在此过程之外,只需使用 Part ([ ]) 和 Span (;;)

Standardize /@ Transpose[dat][[ ;; -2 ]]

或者,大多数

Standardize /@ Most[Transpose[dat]]

考虑一下,我认为您将很难将定时抖动与速度变化区分开来。你能有意改变速度吗?

I can't comment much on your algorithm itself, as data analysis is not my forte. However, from what I understand, you're trying to characterize the timing variations in each sensor. Since the data from a single sensor is in a single column of your matrix, I'd suggest transposing it and mapping Standardize on to each set of data. In other words,

dat = (* your data *)
Standardize /@ Transpose[dat]

To put it back in columnar form, Transpose the result. To exclude you last sensor from this process, simply use Part ([ ]) and Span (;;)

Standardize /@ Transpose[dat][[ ;; -2 ]]

Or, Most

Standardize /@ Most[Transpose[dat]]

Thinking about it, I think you're going to have a hard time separating out the timing jitter from variation in velocity. Can you intentionally vary the velocity?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文