1. An anomaly detecting apparatus for first to K-th control devices and first to K-th sensors, the control devices being arranged at different locations on a medium path that control output of medium flowing in the medium path according to respective externally given instruction values and the sensors measuring output volumes of the medium controlled by the control devices, comprising: a target model storage storing a target model defined by (Ci+βi(Xi))×(Qi/Qj)^2−(Cj+βj(Xj)), where “Xi” is a first observed variable, “βi(Xi)” is a first unknown characteristic term that is an unknown function having input variable as “Xi,” “Ci” is a first constant term, “Qi” is a second observed variable, “Xj” is a third observed variable, “βj(Xj)” is a second unknown characteristic term that is an unknown function having input variable as “Xj,” “Cj” is a second constant term, and “Qj” is a fourth observed variable; a first storage storing first time-series data each including the instruction values given to the first to K-th control devices and measured values from the first to K-th sensors at predetermined time intervals during a first period; a model optimizer configured to generate, for each of combinations of two of the first to K-th control devices, a diagnostic model instance by assigning the instruction value for one of the two control devices to the “Xi” of the target model, an unknown constant corresponding to the location of the one control device to the “Ci,” the measured value from the sensor corresponding to the one control device to the “Qi,” the instruction value for the other control device to the “Xj,” an unknown constant corresponding to the location of the other control device to the “Cj” and the measured value from the sensor corresponding to the other control device to the “Qj” and obtain each optimized diagnostic model instance in which the “βi(Xi),” the “Ci,” the “βj(Xj),” and the “Cj” are identified using the first time-series data so as to minimize the squares of values of all of each diagnostic model instance, where the “βi(Xi)” is a function that takes values for sections partitioned in a domain of the “Xi” and the “βj(Xj)” is a function that takes values for sections partitioned in a domain of the “Xj”; a second storage storing second time-series data each including the instruction values given to the first to K-th control devices and measured values from the first to K-th sensors at predetermined time intervals during a second period different from the first period; a third storage storing accuracy information, representing maximum observation errors of the first to K-th sensors and maximum response errors of the first to K-th control devices for the instruction values; a determination score calculator configured to, for each optimized diagnostic model instance, obtain first residuals being values calculated from the optimized diagnostic model instance based on each piece of the first time-series data and generate a first probability distribution which is a probability distribution of the first residuals, obtain second residuals values calculated from the optimized diagnostic model instance based on each piece of the second time-series data and generate a second probability distribution which is a probability distribution of the second residuals, change, for each of the two control devices and two sensors based on which the optimized diagnostic model instance is generated, each corresponding value in each piece of the first time-series data according to the accuracy information, obtain third residuals being values calculated from the optimized diagnostic model instance based on each corresponding changed piece of time-series data, and generate each corresponding third probability distribution which is a probability distribution of the third residuals, and generate a first extended KL (Kulback-Leibler) divergence representing a distance between the second and first probability distributions and second extended KL divergences each representing a distance between the second probability distribution and each third probability distribution and calculate a determination score according to the ratio of the first extended KL divergence to the sum of the first extended KL divergence and each one of the second extended KL divergences, respectively; and a comprehensive abnormality determiner configured to obtain, for each of the first to K-th control devices and the first to K-th sensors, a comprehensive score which is a minimum value of determination scores obtained for each of the first to K-th control devices and the first to K-th sensors and, if the comprehensive score of any of the control devices and sensors is larger than a first threshold value, determine that an abnormality has occurred in the control device or the sensor.