1. A computer-based mechanical system for controlling unwanted neurological behavior in an animal or human, comprising: a) at least one electrode or sensor; b) at least one computer processor; and c) a computer, said computer containing a program further containing computational brain models and nonlinear ensemble filters, said computational models further comprising separate models for observation and control with said separate models being capable of operating in intercommunicating parallel, wherein said separate models are in constant feedback communication with one another and with said at least one electrode or sensor.