趋势线的最佳拟合曲线 [英] Best fit curve for trend line

查看:1940
本文介绍了趋势线的最佳拟合曲线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题限制


  • 数据集的大小,但不是数据本身,已知。

  • 数据集一次增长一个数据点。

  • 趋势线一次绘制一个数据点(使用样条曲线/贝塞尔曲线) 。

图表

下面的拼贴画显示具有相当准确的趋势线的数据集:

The collage below shows data sets with reasonably accurate trend lines:

图表是:


  • 左上角。按小时计算,有~24个数据点。

  • 右上角。白天一年,有~365个数据点。

  • 左下角。按周计算,一年约52个数据点。

  • 右下角。按月计算,一年约12个数据点。

  • Upper-left. By hour, with ~24 data points.
  • Upper-right. By day for one year, with ~365 data points.
  • Lower-left. By week for one year, with ~52 data points.
  • Lower-right. By month for one year, with ~12 data points.

用户输入s

用户可以选择:


  • 的类型时间序列(每小时,每日,每月,每季度,每年);和

  • 时间序列的开始和结束日期。

例如,用户可以在6月份选择30天的每日报告。

For example, the user could select a daily report for 30 days in June.

趋势权重

要计算窗口大小(即计算趋势线时要平均的数据点数),使用以下表达式:

To calculate the window size (i.e., the number of data points to average when calculating the trend line), the following expression is used:

data points / trend weight

其中数据点源自用户输入,趋势权重 6.4 。即使趋势权重 6.4 产生良好的拟合,它也是相当随意的,可能不适合不同的用户输入。

Where data points is derived from user inputs and trend weight is 6.4. Even though a trend weight of 6.4 produces good fits, it is rather arbitrary, and might not be appropriate for different user inputs.

问题

考虑到这个问题的限制,如何计算趋势权重

How should trend weight be calculated given the constraints of this problem?

推荐答案

根据图表的外观,我会说你的12点图有太多的点(它只是一个样条的样条)给出的分数......在视觉上令人愉悦,但在尝试理解趋势时实际上弊大于利,而365分图的分数太少。也许尝试做一些像指数一样的事情:

Based on the looks of the graphs I would say you have too many points for your 12 point graph (it is just a spline of the points given... which is visually pleasing, but actually does more harm than good when trying to understand the trend) and too few points for your 365 point graph. Perhaps try doing something a little exponential like:

(Data points)^1.2/14.1

我确实意识到这比你已经拥有的更加武断,但任意并不是世界上最糟糕的事情。

I do realize this is even more arbitrary than what you already have, but arbitrary isn't the worst thing in the world.

(我通过尝试保持52点图固定得到14.1,因为那个看起来不错,取(52 ^(1.2)/ 52)* 6.4 = 14.1 。你使用这种技术你可以尝试除了1.2以外的其他功能,看看你的视觉效果。

(I got 14.1 by trying to keep the 52 point graph fixed, since that one looks nice, by taking (52^(1.2)/52)*6.4=14.1. You using this technique you could try other powers besides 1.2 to see what you visually get.

Dan

这篇关于趋势线的最佳拟合曲线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆