As R produces prettier graphs, it is nicer to use and is totally free so made it a more user-friendly script there. See the code in folder called R_code
also RMSE (root-mean-square error), log likelyhood (ll), and Bayesian Information Criterion (BIC) are calculated as quantitative metrics of the fit (see function recompute.fit.stats = function(stat_in, n, K, y_in, y_fit, error, w)
in plot_subfunctions.R
The messy plotting everything version
Clearer plot with only model. The younger data is not really represented well with the model? Some sort of trends can be seen in the OLD data in accordance with the story that the photoreceptor contributions change and are not constant and how melatonin suppression spectral sensitivity cannot be really expressed by a single action spectrum (analogous to nonlinear mesopic sensitivity)
Tracking how well the melanopic explains the data
TODO! for the paper, you could pick couple of those parameters and compare those to the R^2 of the melanopic template by Lucas et al. and some parameter from Simon?
Scroll-down for how the McDougal and Gamlin (2010) plotted the evolution.
Open plot_matlab_fitting.R
and Run All (Ctrl+Alt+R) and see the magic happening..
The boring stuff is hidden to plot_subfunctions.R
that you do not necessarily ever need to open. The plot_model_fit_per_timepoint.R
is meant to be customized by you. So the fitting was done for values with no negative values and max then normalized to unity (was easier this way, a lot easier). So if you wanna work on the disinhibition theory around 590nm, you need to re-define your model :S
Init simple
fit (meaning the model from McDougal and Gamlin (2010) for the spectral sensitivity (with no spectral opponency):
Spitschan et al. (2014): S = Melanopsin + (MWS+LWS) - SWS +Rods (PT)
When S-cones are inhibitory (rod contribution can be easily set to zero in the code later)
Woelders et al. (2018): S = Melanopsin -MWS +LWS - SWS +Rods (PT)
When S-cones and M-cones are inhibitory, and only melanopsin and L-cones are excitatory (rod contribution can be easily set to zero in the code later)
McDougal and Gamlin (2010) modeled the PLR dynamics using the Quick pooling model (Quick (1974))
Illustration of the effect of changing the curve fitting parameters of Eq. (4) on the composite spectral sensitivity derived from the combination of rod and cone spectral sensitivities. Panels A, C, and E demonstrate the effect of changing the value of the parameter k in Eq. (4) to 1 (A), 2 (C), and 100 (E). Panels B, D, and F demonstrate the effect of changing the relative contribution of the rod and cone signals on the spectral sensitivity of the overlying function, by setting c = 0.5r (B), c = 0.1r (D), and c = 0.03r (F).
Relative contribution of the rod, cone, and melanopsin photoresponse to the spectral sensitivity of the PLR over time. The time course of light adaptation of the rod (■), cone (♦), and melanopsin (●) photoresponses while maintaining a half maximal PLR with (A) no background present, (B) a 50 td adapting background, and (C) a three-quarter maximal PLR with a 50 td adapting background. Light adaptation was calculated by the combining the difference in absolute irradiance necessary to maintain these responses with the change in relative contribution of each of the photoresponses to the composite spectral sensitivity function generated for each duration condition of each of the three experiments (see Section 2.4 for details). Each point is relative to the most sensitive photoresponse at the shortest duration condition. The smooth line through each data set is the best fit of a three parameter single exponential decay function to the data.
Kurtenbach et al. (1999) demonstrated some color opponency "compound action spectra" for trichromatic, deuteranopic and protanopic individuals:
Now with spectral opponency, we can start seeing these notches as shown by [Rea et al. (2005)[https://doi.org/10.1016/j.brainresrev.2005.07.002] {cited by 245}; Rea et al. 2011
Data from Thapan et al. 2001, Brainard et al. 2001; and models from Rea et al. (2005), Takahashi et al. 2011, Gall 2004 / DIN Standard, Lang 2011, and Melanopic function from Enezi et al. 2011
Fitting when normalized to unity in linear domain
The fitting residuals
How this looks in LOG domain (not totally sure now, what is the difference between 2nd and 3rd row):
If one would actually remember the details, but the components of their model
_See the build-up on how this was imagined back in 2013
From : "Krastel, Alexandridis, and Gertz (1985) provided the first evidence that the pupillary system has access to a "color opponent" visual process. Krastel et al. showed that the pupillary action spectrum for chromatic flashes on a steady-white background was virtually identical to the spectral sensitivity curve obtained psychophysically under the same stimulus conditions. That is, the action spectrum has three prominent lobes with maxima in a long, middle, and short wavelength region and has a prominent dip in sensitivity near 570 nm, resembling what visual psychophysicists call the "Sloan notch" (see also Schwartz 2002, Calkins et al. 1992)."
Action spectra derived from the ON, OFF, and steady-state portions of the pupillary response waveform. (A) Action spectra for individual observers. The ON action spectra for all observers are plotted in actual quantal sensitivity (reciprocal quanta sec -t deg-2). The psychophysical spectral sensitivity curve (bold solid lines) and other action spectra, however, were shifted vertically to illustrate their similarities and differences. The OFF and steady-state spectra for observer A were shifted by + 0.2 and -0.45, respectively. The steady-state spectrum for observer J was shifted by -0.65. The psychophysical spectral sensitivity curve, OFF and the steady-state spectra for observer M were shifted by -0.5, +0.2 and -0.3, respectively. Thee action spectra derived from the high criterion ON amplitude and from the steady-state amplitudes can be reasonably described as a linear sum of the quantized scotopic and photopic luminous efficiency functions. The relative weights for the photopic function were 49% for observer A, 13% for observer J, and 20% for observer M. Alternatively, the two action spectra can be described as a linear sum of the LWS-,MWS-, and SWS-cone spectra (thin dotted line; Smith & Pokorny, 1975). The relative weights for LWS- and MWS-cones were 30% and 37% for observer A, 3% and 41% for observer J, and 14% and 20% for observer M, respectively.
Our work reveals a curious, opponent response to blue light in the otherwise familiar pupillary light response. Increased stimulation of S cones can cause the pupil to dilate, but this effect is usually masked by a stronger and opposite response from melanopsin-containing cells.
We show that selectively activating L-cones or melanopsin constricts the pupil whereas S- or M-cone activation paradoxically dilates the pupil. Intrinsically photosensitive RGCs therefore appear to signal color on yellow/blue and red/green scales, with blue and green cone shifts being processed as brightness decrements.
Serial electron microscopic reconstructions revealed that M5 cells receive selective UV-opsin drive from Type 9 cone bipolar cells but also mixed cone signals from bipolar Types 6, 7, and 8. Recordings suggest that both excitation and inhibition are driven by the ON channel and that chromatic opponency results from M-cone-driven surround inhibition mediated by wide-field spiking GABAergic amacrine cells. We show that M5 cells send axons to the dLGN and are thus positioned to provide chromatic signals to visual cortex. These findings underscore that melanopsin's influence extends beyond unconscious reflex functions to encompass cortical vision, perhaps including the perception of color.