something more theoretical, even experimental which is (far?) beyond my mathematical capabilities.
when converting bayer RGGB -> XYZ -> RGB we always assume that the single tristimulus values "R" "G" and "B" are single-frequency reference points at "x nm" wavelength in both RAW and RGB colorspaces.
(see
http://en.wikipedia.org/wiki/File:CIE1931xy_CIERGB.svg )
but the CFA filters are not that narrow! they have a very wide range of sensitivity and are - unlike tristimulus values - correlated.
check the spectral response of a CFA pattern, like here for the D90:
http://vitabin.blogspot.it/2013/04/spectral-response-of-nikon-dslrs-d90.htmlso every RAW-RGGB pixel's component is correlated to the value of the other components of that pixel.
the conclusion is, there is no 1:1 mapping between the real spectral color that occurred and the RGGB representation.
if we get an accurate spectral response curve, like the one on the webpage above could be, cant we recover the probability map of every single pixel which (spectral) color
would have led to the RGGB values we find in the raw pixel values?
using this statistical data, recovering unusual color phenomens and a more perfect CA should be possible, aint it?
the downside: recovering is very time and memory consuming