KalmanFilterRegression

class KalmanFilterRegression(C=1)[source][source]

Class for the Kalman Filter Decoder

Parameters:
  • float (C -)

  • optional

  • 1 (default)

  • in (This parameter scales the noise matrix associated with the transition)

  • new (kinematic states. It effectively allows changing the weight of the)

  • update. (neural evidence in the current)

  • on (Our implementation of the Kalman filter for neural decoding is based)

  • (https (that of Wu et al 2003)

  • the (-cursor-motion-using-a-kalman-filter.pdf) with the exception of)

  • previously (addition of the parameter C. The original implementation has)

  • Morris (been coded in Matlab by Dan)

  • (http (//dmorris.net/projects/neural_decoding.html#code))

fit(X_kf_train, y_train)[source][source]

Train Kalman Filter Decoder

Parameters:
  • X_kf_train (numpy 2d array of shape [n_samples(i.e. timebins) ,)

  • n_neurons] – This is the neural data in Kalman filter format. See example file for an example of how to format the neural data correctly

  • y_train (numpy 2d array of shape [n_samples(i.e. timebins), n_outputs]) – This is the outputs that are being predicted

predict(X_kf_test, y_test)[source][source]

Predict outcomes using trained Kalman Filter Decoder

Parameters:
  • X_kf_test (numpy 2d array of shape [n_samples(i.e. timebins) ,)

  • n_neurons] – This is the neural data in Kalman filter format.

  • y_test (numpy 2d array of shape [n_samples(i.e. timebins),n_outputs]) – The actual outputs This parameter is necesary for the Kalman filter (unlike other decoders) because the first value is nececessary for initialization

Returns:

  • y_test_predicted (numpy 2d array of shape [n_samples(i.e. timebins),)

  • n_outputs] – The predicted outputs