Table of Contents

Class Trend

Namespace
Pamoja.Kit
Assembly
Pamoja.Kit.dll

Fits a line through recent readings, so a slow drift shows before it matters.

public sealed class Trend : IDisposable
Inheritance
Trend
Implements
Inherited Members

Constructors

Trend(int)

Creates an empty trend estimator.

public Trend(int capacity = 32)

Parameters

capacity int

How many readings to fit the line through, from 2 to 32, since a line needs two; 32 unless told fewer.

Exceptions

ArgumentOutOfRangeException

capacity is not from 2 to 32.

Properties

Capacity

How many readings the estimator keeps.

public int Capacity { get; }

Property Value

int

Slope

The fitted slope in units per reading, or null without two readings. A positive slope is a rising signal.

public float? Slope { get; }

Property Value

float?

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Push(float)

Adds a reading.

public void Push(float reading)

Parameters

reading float

The reading to add. One that is not a finite number is not kept.