Linear Regression Traces

The linear regression trace collection is used to store the resulting signal traces produced by the moving linear regression over the samples of a signal trace.

Create the Trace Collection

You can create a linear regression trace collection without samples by calling the LinearRegressionTraces class.

>>> # create an empty linear regression trace collection
>>> traces = LinearRegressionTraces()
>>> traces
LinearRegressionTraces(level=Trace(label='Trace', samples=[]),
                       slope=Trace(label='Trace', samples=[]),
                       intercept=Trace(label='Trace', samples=[]),
                       mean=Trace(label='Trace', samples=[]),
                       median=Trace(label='Trace', samples=[]),
                       minimum=Trace(label='Trace', samples=[]),
                       maximum=Trace(label='Trace', samples=[]),
                       range=Trace(label='Trace', samples=[]),
                       error=Trace(label='Trace', samples=[]),
                       negative_error=Trace(label='Trace', samples=[]),
                       positive_error=Trace(label='Trace', samples=[]),
                       absolute_error=Trace(label='Trace', samples=[]),
                       variance=Trace(label='Trace', samples=[]),
                       deviation=Trace(label='Trace', samples=[]),
                       skew=Trace(label='Trace', samples=[]),
                       kurtosis=Trace(label='Trace', samples=[]))

Number of Traces

You can get the number of the traces in the LinearRegressionTraces collection with the built-in function len().

>>> # number of traces in the collection
>>> len(traces)
16

Names of the Traces

You can get the list with the names of the traces in the LinearRegressionTraces collection.

A list with the key names of the traces is returned.

>>> # key names of the traces in the collection
>>> list(traces)
['level',
 'slope',
 'intercept',
 'mean',
 'median',
 'minimum',
 'maximum',
 'range',
 'error',
 'negative_error',
 'positive_error',
 'absolute_error',
 'variance',
 'deviation',
 'skew',
 'kurtosis']
>>> # key names of the traces in the collection
>>> list(traces.keys())
['level',
 'slope',
 'intercept',
 'mean',
 'median',
 'minimum',
 'maximum',
 'range',
 'error',
 'negative_error',
 'positive_error',
 'absolute_error',
 'variance',
 'deviation',
 'skew',
 'kurtosis']

Level Trace

You can get the level Trace for the approximated lines with the level attribute from the LinearRegressionTraces collection.

The Trace with the level samples is returned.

>>> # level trace by attribute
>>> traces.level
Trace(label='Trace', samples=[])
>>> # level trace by key
>>> traces['level']
Trace(label='Trace', samples=[])

Slope Trace

You can get the slope Trace for the approximated lines with the slope attribute from the LinearRegressionTraces collection.

The Trace with the slope samples is returned.

>>> # slope trace by attribute
>>> traces.slope
Trace(label='Trace', samples=[])
>>> # slope trace by key
>>> traces['slope']
Trace(label='Trace', samples=[])

Intercept Trace

You can get the intercept Trace for the approximated lines with the intercept attribute from the LinearRegressionTraces collection.

The Trace with the intercept samples is returned.

>>> # intercept trace by attribute
>>> traces.intercept
Trace(label='Trace', samples=[])
>>> # intercept trace by key
>>> traces['intercept']
Trace(label='Trace', samples=[])

Mean Trace

You can get the mean Trace for the approximated lines with the mean attribute from the LinearRegressionTraces collection.

The Trace with the mean samples is returned.

>>> # mean trace by attribute
>>> traces.mean
Trace(label='Trace', samples=[])
>>> # mean trace by key
>>> traces['mean']
Trace(label='Trace', samples=[])

Median Trace

You can get the median Trace for the approximated lines with the median attribute from the LinearRegressionTraces collection.

The Trace with the median samples is returned.

>>> # median trace by attribute
>>> traces.median
Trace(label='Trace', samples=[])
>>> # median trace by key
>>> traces['median']
Trace(label='Trace', samples=[])

Minimum Trace

You can get the minimum Trace for the approximated lines with the minimum attribute from the LinearRegressionTraces collection.

The Trace with the minimum samples is returned.

>>> # minimum trace by attribute
>>> traces.minimum
Trace(label='Trace', samples=[])
>>> # minimum trace by key
>>> traces['minimum']
Trace(label='Trace', samples=[])

Maximum Trace

You can get the maximum Trace for the approximated lines with the maximum attribute from the LinearRegressionTraces collection.

The Trace with the maximum samples is returned.

>>> # maximum trace by attribute
>>> traces.maximum
Trace(label='Trace', samples=[])
>>> # maximum trace by key
>>> traces['maximum']
Trace(label='Trace', samples=[])

Range Trace

You can get the range Trace for the approximated lines with the range attribute from the LinearRegressionTraces collection.

The Trace with the range samples is returned.

>>> # range trace by attribute
>>> traces.range
Trace(label='Trace', samples=[])
>>> # range trace by key
>>> traces['range']
Trace(label='Trace', samples=[])

Error Trace

You can get the error Trace for the approximated lines with the error attribute from the LinearRegressionTraces collection.

The Trace with the error samples is returned.

>>> # error trace by attribute
>>> traces.error
Trace(label='Trace', samples=[])
>>> # error trace by key
>>> traces['error']
Trace(label='Trace', samples=[])

Maximal Negative Error Trace

You can get the maximal negative error Trace for the approximated lines with the error attribute from the LinearRegressionTraces collection.

The Trace with the negative error samples is returned.

>>> # maximal negative error trace by attribute
>>> traces.negative_error
Trace(label='Trace', samples=[])
>>> # maximal negative error trace by key
>>> traces['negative_error']
Trace(label='Trace', samples=[])

Maximal Positive Error Trace

You can get the maximal positive error Trace for the approximated lines with the error attribute from the LinearRegressionTraces collection.

The Trace with the positive error samples is returned.

>>> # maximal positive error trace by attribute
>>> traces.positive_error
Trace(label='Trace', samples=[])
>>> # maximal positive error trace by key
>>> traces['positive_error']
Trace(label='Trace', samples=[])

Absolute Error Trace

You can get the absolute error Trace for the approximated lines with the absolute_error attribute from the LinearRegressionTraces collection.

The Trace with the absolute error samples is returned.

>>> # absolute error trace by attribute
>>> traces.absolute_error
Trace(label='Trace', samples=[])
>>> # absolute error trace by key
>>> traces['absolute_error']
Trace(label='Trace', samples=[])

Variance Trace

You can get the variance Trace for the approximated lines with the variance attribute from the LinearRegressionTraces collection.

The Trace with the variance samples is returned.

>>> # variance trace by attribute
>>> traces.variance
Trace(label='Trace', samples=[])
>>> # variance trace by key
>>> traces['variance']
Trace(label='Trace', samples=[])

Standard Deviation Trace

You can get the standard deviation Trace for the approximated lines with the deviation attribute from the LinearRegressionTraces collection.

The Trace with the standard deviation samples is returned.

>>> # standard deviation trace by attribute
>>> traces.deviation
Trace(label='Trace', samples=[])
>>> # standard deviation trace by key
>>> traces['deviation']
Trace(label='Trace', samples=[])

Skew Trace

You can get the skew Trace for the approximated lines with the skew attribute from the LinearRegressionTraces collection.

The Trace with the skew samples is returned.

>>> # biased skew trace by attribute
>>> traces.skew
Trace(label='Trace', samples=[])
>>> # biased skew trace by key
>>> traces['skew']
Trace(label='Trace', samples=[])

Kurtosis Trace

You can get the kurtosis Trace for the approximated lines with the kurtosis attribute from the LinearRegressionTraces collection.

The Trace with the kurtosis samples is returned.

>>> # biased kurtosis trace by attribute
>>> traces.kurtosis
Trace(label='Trace', samples=[])
>>> # biased kurtosis trace by key
>>> traces['kurtosis']
Trace(label='Trace', samples=[])