Anomaly detection in a large area using hyperspectral imaging is an important application in real-time remote sensing. Anomaly detectors based on subspace models are suitable for such an anomaly and usually assume the main background subspace and its dimensions are known. These detectors can detect the anomaly for a range of values of the dimension of the subspace. The objective of this paper is to develop an anomaly detector that extends this range of values by assuming main background subspace with an unknown user-specified dimension and by imposing covariance of error to be a diagonal matrix. A pixel from the image is modeled as the sum of a linear combination of the unknown main background subspace and an unknown error. By having more unknown quantities, there are more degrees of freedom to find a better way to fit data to the model. By having a diagonal matrix for the covariance of the error, the error components become uncorrelated. The coefficients of the linear combination are unknown, but are solved by using a maximum likelihood estimation. Experimental results using real hyperspectral images show that the anomaly detector can detect the anomaly for a significantly larger range of values for the dimension of the subspace than conventional anomaly detectors.