関数sequence_trend_limittime マニュアル

(The documentation of function sequence_trend_limittime)

Last Update: 2025/12/4


◆機能・用途(Purpose)

指定した時刻範囲における 時系列データを直線でフィットしたときの傾きと切片を求める。
Calculate the slope and intercept of the straight line that best fits a time series data in a specified time window.


◆形式(Format)

#include <sequence/statistics.h>
inline double ∗sequence_trend_limittime
(struct sequence seq,const double tmin,const double tmax)


◆引数(Arguments)

seq 計算に用いる時系列データを表す構造体。
A structure to represent the time series data used for the computation.
tmin 計算に用いる時刻範囲の下限(\(t_{min}\))。
The lower limit, \(t_{min}\), of the time window used for the calculation.
tmax 計算に用いる時刻範囲の上限(\(t_{max}\))。
The upper limit, \(t_{max}\), of the time window used for the calculation.


◆戻り値(Return value)

\([t_{min},t_{max}]\)の時刻範囲における時系列データの 傾き\(a\)、切片\(b\)、それらの推定誤差\(\sigma_a\), \(\sigma_b\)を並べた配列。 配列要素の順番は傾き、切片、傾きの推定誤差、切片の推定誤差の順とする。 切片は時系列データの定義域に関わらず直線の時刻\(t=0\)での値とする。 \(t_{min}\), \(t_{max}\)がサンプル時刻でない場合は内側に丸められる。
An array composed of the slope \(a\), intercept \(b\), and their estimation errors \(\sigma_a\) and \(\sigma_b\) of the time series data in a time window \([t_{min},t_{max}]\). The order of the array components is as follows: the slope, the intercept, the estimation error of the slope, and the estimation error of the intercept. The intercept is defined as the value of the straight line at time \(t=0\) regardless of the definition range of the time series data. If \(t_{min}\) and \(t_{max}\) are not at sample times, the time window is rounded inward.


◆使用例(Example)

struct sequence seq;
double ∗trend=sequence_trend_limittime(seq,2.0,5.0);

この例ではtrend[0]が傾き、trend[1]が切片、 trend[2]が傾きの推定誤差、trend[3]が切片の推定誤差となる。
In this example, trend[0] and trend[1] are the slope and intercept, and trend[2] and trend[3] are the estimation errors of the slope and intercept, respectively.


◆計算式(Formula)

関数sequence_trendのマニュアル参照。
See the documentation of function sequence_trend.