Methods
Steering Entropy Model as described by Boer, Rakauskas, Ward, and Goodrich (2005).
Model is calibrated to the unique spectral characteristics of the driver. This makes it sensitive to a variety of coping strategies employed by drivers in response to increased workload demands.
A model should be built for each participant. A baseline segment of steering angle data is needed to fit the model via the baseline method. This segment of data should be at least 2 minutes. baseline() will raise an exception if less than 1 minute of data is supplied.
Parameters : | resample_fs : float, optional
alpha : float, optional
M : int, optional
b_pe : array, optional
pkbas : array, optional
bin_edges : array, optional
hbas : float, optional
cdf : CDF, optional
|
---|
Notes
Expecting data to be in degrees. It may not matter but small values will sometimes cause overflow errors in arburg. If you your steering data is in radians it might be better to convert it to degrees.
Loosely based off of Chris’ SteeringEntropy.m script in ndaqTools. Users familiar with ndaqTools should note that the steeringentropy function in ndaqTools (Chris’ matlab) uses the first 60 s to find the AR coeffs and the second 60 s to find baseline prediction error distribution. This module splits the baseline data in half. This class applies a 5th order lowpass to 3/7 the resample_fs as suggested by Boer et al. before resampling. The ndaqTools algorithm just applies an integer factor downsample. Because of these slight differences entropy estimates may differ.
References
Finds AR coefficients to build prediction errors and estimates baseline prediction errors distribution. Returns the baseline entropy.
Parameters : | x : array_like
fs : float
|
---|---|
Returns : | hbas : float
|
Returns steering entropy from given data vector. Specify fs if not collected at 60 Hz.
Parameters : | x : array_like
fs : float
|
---|---|
Returns : | hbas : float
|
returns bode plot of AR coeffs filter
Parameters : | None : |
---|---|
Returns : | fig : matplotlib.figure.Figure |
builds low-pass filter with a cutoff frequency of 3/7th the resample frequency. The filter should be down 40 dB at 1.5 times the cutoff frequency (6/7th) the resample frequency.
Parameters : | fs : the base sampling rate |
---|---|
Returns : | b, a : array_like
|
Private method applies 5th low-pass Butterworth filter to x and resamples and returns x at self.resample_fs.
Parameters : | x : array_like
fs : float
|
---|---|
Returns : | x_resampled : np.ndarray
|
returns bode plot of the lp filter applied before downsampling
Parameters : | None : |
---|---|
Returns : | fig : matplotlib.figure.Figure |
returns ts plot to fit_baseline so it can be returned indirectly to user
Parameters : | x : array_like
_x : array_like
PE : array_like
fs : float
|
---|---|
Returns : | fig : matplotlib.figure.Figure |
returns plot to get_entropy so it can be returned indirectly to user