tokens: values of polynomial fits at each pixel and plot the resulting model over the original spectrum. In the lower panel of Fig. 3 , we show the residuals between the model and the input spectrum, with horizontal lines marking the median uncertainty about zero for this spectrum. With just eight principal components, we can model this particular spectrum to within the typical measurement uncertainty. In Fig. 4 , we show the distribution of model residuals for all spectra in our example slice of the red clump for models using zero, four, and eight principal components. As we expect, increasing the number of principal components used in the model causes the residual histogram to become more peaked towards a value of 0, with shallower wings. Given this continual improvement in modelling, it is necessary to define a cut-off to determine when improvements to the model explain variations due to noise, not intrinsic stellar differences. Figure 4. Histograms of the residual normalized flux after subtracting from each spectrum in the example slice a model using 0, 4, and 8 PCs. As more PCs are used, the histogram becomes more sharply peaked in the centre, with shrinking wings. 3.3.2 Assessing principal components We now define some useful statistics that can be computed from the results of EMPCA, which allow us to assess the results of the algorithm. We define V data mean as the mean-based variance of , We define a similar quantity V data MAD as the median absolute deviation (MAD) based variance of where is the p th row of , the operation ‘med’ is taking the median of the data, and the factor of 1.4826 scales the MAD to the standard deviation for normally distributed data, i.e. V data mean = V data MAD for data drawn from a Gaussian distribution. Equations ( 11 ) and ( 13 ) represent the total variance in the data. We wish to compare these to the variance after removing the principal component model produced by EMPCA. To do this, we define two additional quantities that compute the variance in the data after the contribution from the first n principal components has been subtracted out: Here, is the original data set after the model using the first n principal components has been subtracted (equation 10 ), and is the p th row of . Note that in the case where n = 0, V model mean (0) = V data mean and V model MAD (0) = V data MAD . Also note that when the number of components is maximized ( n = min ( N, P ) = n limit ), V model mean ( n limit ) = 0 and V model MAD ( n limit ) = 0, because in that case the model can perfectly represent all of the data. In what follows, we use V data and V model without superscripts when either the mean-based or MAD-based versions could be used. We compare these variances using R 2 ( n ), defined as The R 2 ( n ) curve should increase in height with the number of iterations on the model components. The maximal value for R 2 ( n ) is 1, which indicates the data can be perfectly reproduced by a linear combination of n components
ner_tags: O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Model O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula O O O O O B-Model O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Model O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B-Formula I-Formula I-Formula B-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula O B-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula O O O O O O O O O O O O B-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula O B-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula O B-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula I-Formula O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O