A system for inferring quantities of an automotive subsystem, comprising: a set of an automotive subsystems, the set of automotive subsystems comprising a selective catalytic reduction device configured to introduce ammonia, which is decomposed from injected urea, for removing nitrogen oxides from exhaust gas; an inferential sensor receiving one or more inputs that are also provided to the automotive subsystems and one or more measured outputs outputted by the automotive subsystems, and providing an output for providing one or more estimated quantities of the automotive subsystem; and an engine control unit configured to execute the inferential sensor by processing the one or more inputs provided to the automotive subsystem and the one or more measured outputs from the automotive subsystem, and providing the output of the inferential sensor that includes one or more estimated quantities of the automotive subsystem; and wherein the inferential sensor comprises: an off-line part comprising a manually or automatically prepared model of the selective catalytic reduction device that is suitable for real-time execution and a manually or automatically prepared parameter data set for the model of the selective catalytic reduction device, wherein the model of the selective catalytic reduction device is described by a set of ordinary differential equations; and an on-line part implemented using an extended Kalman filter comprising an implicit fixed step solver configured to update the model of the selective catalytic reduction device, a covariance matrix of a system state estimate based on measured data in a factorized form, and a time update of the covariance matrix, wherein the online part is configured to provide the one or more estimated quantities of the automotive subsystem and wherein the inferential sensor is configured to estimate the ammonia storage in the selective catalytic reduction device catalyst. a set of an automotive subsystems, the set of automotive subsystems comprising a selective catalytic reduction device configured to introduce ammonia, which is decomposed from injected urea, for removing nitrogen oxides from exhaust gas; an inferential sensor receiving one or more inputs that are also provided to the automotive subsystems and one or more measured outputs outputted by the automotive subsystems, and providing an output for providing one or more estimated quantities of the automotive subsystem; and an engine control unit configured to execute the inferential sensor by processing the one or more inputs provided to the automotive subsystem and the one or more measured outputs from the automotive subsystem, and providing the output of the inferential sensor that includes one or more estimated quantities of the automotive subsystem; and wherein the inferential sensor comprises: an off-line part comprising a manually or automatically prepared model of the selective catalytic reduction device that is suitable for real-time execution and a manually or automatically prepared parameter data set for the model of the selective catalytic reduction device, wherein the model of the selective catalytic reduction device is described by a set of ordinary differential equations; and an on-line part implemented using an extended Kalman filter comprising an implicit fixed step solver configured to update the model of the selective catalytic reduction device, a covariance matrix of a system state estimate based on measured data in a factorized form, and a time update of the covariance matrix, wherein the online part is configured to provide the one or more estimated quantities of the automotive subsystem and wherein the inferential sensor is configured to estimate the ammonia storage in the selective catalytic reduction device catalyst.