3.85 FAQ-323 在一列数据中,如何按顺序取一定数量的数据进行计算,例如移动平均值或移动标准差?
Last Update: 7/16/2018
使用 Origin 内置的移动函数
Origin 提供了几个内置的移动函数,你可以指定移动窗口的大小(相对于当前数据点向后和/或向前N个点):
Movavg,
Emovavg,
Mmovavg,
Movcoef,
Movrms,
Movslope,
Tmovavg, 和
Wmovavg.
例如,要使用 Movavg 函数来计算移动平均值,可以在 Set Values 对话框中执行以下操作:
- 选择要放置结果的列。
- 从菜单中选择 Column: Set Column Value...(或按 CTRL + Q 键),打开 Set Values 对话框。
- 在对话框中选择菜单 Function: Statistics: Movavg(vd,back,forward),在列公式编辑框中会自动输入 movavg 函数。
- 将 vd替换为你想要计算移动平均值的那一列。
- 根据你想设置的移动窗口的大小,替换 back 和 forward。其中,back 为相对于当前点的位置,向后 N 个点,forward 则是向前 M 个点。
- 点击 OK 按钮。
编辑其他函数使其成为移动函数
你可以在 Set Value 对话框中调用自定义的子范围来作为移动窗口。
例如,要计算窗口大小为 11 的移动标准差,你可以在 Set Column Value 的公式中自定义一个包含 11 个数据点的子范围,例如:
StdDev(A[i-5:i+5])
你可以在 Set Values 对话框中选择 Formula: Load Sample菜单,获取有关列值计算的示例。 |
注: 要计算图上某条曲线的移动平均值,可以使用 Analysis: Signal Processing: Smoothing 工具并将 Method 设置为 Adjacent-Averaging。
Keywords:Moving, Rolling, Sliding, average, mean, standard deviation, std, SMA, 移动, 滚动, 滑动, 平均值, 均值, 标准差
- FAQ-976 Why does my Analysis Template file keep getting bigger?
- FAQ-222 What is the difference between global fit and independent fit?
- FAQ-223 How do I set the same bounds to parameters when fitting multiple datasets?
- FAQ-224 How to use the parameter values from the last fit as the new starting values
- FAQ-225 How do I fit all curves in my layer or graph?
- FAQ-226 How do I fit a part of the data plot in my graph?
- FAQ-228 How do I force my fit curve to go through a point?
- FAQ-231 How do I know if my fit result is good?
- FAQ-232 How to identify the outliers in linear fit?
- FAQ-233 How to find a slope on the log-log plot?