确定线斜率变化的位置(算法) [英] Determine where line slope changes (algorithm)

查看:345
本文介绍了确定线斜率变化的位置(算法)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您绘制下面的数字,您将得到波动微笑": 数字遵循一个线性斜率(左斜率),然后更改为 跟随另一个线性斜率(右斜率).

If you plot the numbers below, you get a "volatility smile": the numbers follow one linear slope (the left slope), and then change to following another linear slope (the right slope).

我有几组这样的数据,想知道斜率在哪里 变化.注意:

I have several sets of data like this and want to know where the slope changes. Notes:

  • 坡度变化通常发生在点之间

  • The slope change usually occurs between points

我不知道左边有多少点,左边有多少点 正确的坡度.

I don't know how many points have the left slope and how many have the right slope.

对于坡度或坡度的符号/大小没有任何保证 斜坡之间的关系.每个斜率可以为负或 是正数,并且任何一个都可能大于另一个.

There's no guarentee about the sign/magnitude of either slope or the relation between the slopes. Each slope may be negative or positive, and either might be greater than the other.

如果斜率相同,则程序应将其报告为 特殊情况.

If the slopes are identical, the program should report this as a special case.


0.1613 
0.1596 
0.1579 
0.1561 
0.1544 
0.1528 
0.1511 
0.1495 
0.1478 
0.1462 
0.1446 
0.1431 
0.1415 
0.1416 
0.1418 
0.1419 
0.1421 
0.1422 
0.1424 
0.1425 
0.1426 
0.1428 
0.1429 
0.1431 

推荐答案

Slope(X) = f(x) - f(x-1)
Slope2(x) = Slope(x) - Slope(x-1)

您需要第二个.它显示了坡度本身的变化速度. (在物理方面的加速度) 我在excel中绘制了两个图形,并检查了我的图形:

you need second one. It shows the speed of changing of the slope itself. (acceleration in terms of physics) I plotted both graphs in excel and check what i have:

替代文字http://img691.imageshack.us/img691/6716/slopes .png

您看到了坡度2的峰值吗?这是指标,很容易找到.

you see peak of slope2? this is the indicator and it can easily be found.

这篇关于确定线斜率变化的位置(算法)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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