A method of determining a structure parameter of a target pattern in a lithographic process used to manufacture a device layer on a substrate, the method comprising: calculating a series of calibration spectra from a reference pattern, each spectra being calculated using a different known value of a structure parameter of the reference pattern; and measuring a target spectrum produced by directing a beam of radiation onto the target pattern (S61; S1401); the method being characterised by the steps of: performing principal component spectral analysis on each calculated calibration spectrum to obtain a common set of principle components and a plurality of first sets of principle component coefficients, each first set of principle component coefficients representing one calculated spectrum; storing the common set of principle components and the plurality of first sets of principle component coefficients in a library; performing principal component analysis on the measured target spectrum using the common set of principle components obtained from the principal component analysis of the calculated calibration spectra to obtain a second set of principle component coefficients representing the measured target spectrum; comparing a representation of the stored first set of principle component coefficients and a representation of the second set of principle component coefficients (S63; S1402); and using the comparison to derive a value for the structure parameter of the target pattern (S64; S1403), characterized in that for a selected number of spectral angles or wavelengths of each calibration spectrum the value is calculated. calculating a series of calibration spectra from a reference pattern, each spectra being calculated using a different known value of a structure parameter of the reference pattern; and measuring a target spectrum produced by directing a beam of radiation onto the target pattern (S61; S1401); the method being characterised by the steps of: performing principal component spectral analysis on each calculated calibration spectrum to obtain a common set of principle components and a plurality of first sets of principle component coefficients, each first set of principle component coefficients representing one calculated spectrum; storing the common set of principle components and the plurality of first sets of principle component coefficients in a library; performing principal component analysis on the measured target spectrum using the common set of principle components obtained from the principal component analysis of the calculated calibration spectra to obtain a second set of principle component coefficients representing the measured target spectrum; comparing a representation of the stored first set of principle component coefficients and a representation of the second set of principle component coefficients (S63; S1402); and using the comparison to derive a value for the structure parameter of the target pattern (S64; S1403), performing principal component spectral analysis on each calculated calibration spectrum to obtain a common set of principle components and a plurality of first sets of principle component coefficients, each first set of principle component coefficients representing one calculated spectrum; storing the common set of principle components and the plurality of first sets of principle component coefficients in a library; performing principal component analysis on the measured target spectrum using the common set of principle components obtained from the principal component analysis of the calculated calibration spectra to obtain a second set of principle component coefficients representing the measured target spectrum; comparing a representation of the stored first set of principle component coefficients and a representation of the second set of principle component coefficients (S63; S1402); and using the comparison to derive a value for the structure parameter of the target pattern (S64; S1403),