**Purpose**:
Studies have reported different numbers of spatial frequency channels for chromatic and achromatic vision. To resolve the difference, we performed factor analysis, a multivariate modeling technique, on population data of achromatic and chromatic sensitivity. In addition, we included resampling and visualization methods to evaluate models from factor analysis. These routines are complex but widely useful. Therefore we have archived our analysis routines by building *smCSF*, an open-source software package in R (https://smin95.github.io/dataviz/).

**Methods**:
Data of 103 normally-sighted adults were analyzed. They included blue-yellow, red-green, and achromatic contrast sensitivity. To obtain the confidence interval of relevant statistical parameters, factor analysis was performed using a resampling method. Then exploratory models were developed. We then performed model selections by fitting them against the empirical data and quantifying the quality of the fits.

**Results**:
During the exploratory factor analysis, different statistical tests supported different factor models. These could partially be reasons for why there have been conflicting reports. However, after the confirmatory analysis, we found that a model that included two spatial channels was adequate to approximate the chromatic sensitivity data, whereas that with three channels was so for the achromatic sensitivity data.

**Conclusions**:
Our findings provide novel insights about the spatial channels for chromatic and achromatic contrast sensitivity from population data. Also, the analysis and visualization routines have been archived in a computational package to boost the transparency and replicability of science.

^{1}It involves retaining the least possible number of dimensions to approximate the empirical data. This dimension is often referred to as a

*factor*. For example, in psychology, general intelligence (or

*g*) is an intangible quantity or value that shapes the human mind across different levels; this is an example of a model that has one latent (or implicit) factor that affects various response variables, such as mathematical aptitude, musicianship and reading comprehension. In the case of human spatial vision, a factor can govern how perception can co-vary across a certain class of stimulus but not another. In vision research, the term

*channel*was initially used to vaguely refer a neurophysiological mechanism that underlies a particular visual function, such as contrast sensitivity.

^{2}However, physiological studies in cats and monkeys began to support the existence of channels for visual perception,

^{3}demonstrating that the term was not merely an abstract reference to what could occur in the visual system but an actuality. In this article, we will use the term

*channel*to refer to a common mechanism that subserves a particular visual function, and employ factor analysis to gain more insights about how these channels operate in human visual system.

^{4}Contrast refers to the difference between brightest and darkest parts of an image. Spatial frequency indicates whether an image is fine or coarse (high or low spatial frequency). Typically, the CSF has an asymmetrical and inverted U-shape with a peak at a medium spatial frequency. In the past, studies using adaptation and masking paradigms have attempted to estimate the number of contrast spatial channels in the human visual system.

^{5}

^{,}

^{6}However, studies using different psychophysical methods have reported different numbers of spatial channels.

^{7}

^{–}

^{10}Factor analysis is an alternative solution to indirectly derive the spatial channel by evaluating the sensitivity data's covariance,

^{11}which can cause a joint variability of sensitivity across a range of spatial frequency but not others.

^{11}

^{–}

^{20}They have aimed to confirm the findings of psychophysical studies that directly analyzed data (but not covariance).

^{21}

^{,}

^{22}Specifically, Peterzell and his colleagues

^{14}

^{,}

^{15}

^{,}

^{19}have shown that there is one channel above 1 c/deg (Wilson A channel) and one below 1 c/deg (Wilson B channel) with a possibly third factor that accounts for covariance of sensitivity driven by optics at higher frequencies (>2.25 c/deg).

^{17}

^{,}

^{23}However, factor analysis can yield discrepant results depending on differences in methodologies

^{24}or sample sizes because it can be easily distorted by skewed values or outliers.

^{25}

^{–}

^{27}For example, the range of tested spatial frequency from the sensitivity data (i.e., methods for data collection) and different criteria for factor retention can both introduce different results.

^{24}Sometimes, the standard criteria must be adjusted depending on the local dataset.

^{12}

^{,}

^{15}

^{,}

^{28}

^{24}

^{,}

^{29}First, the likelihood ratio test can support one model over another with a statistical significance, such as the p-value. However, it tends to overestimate the number of factors.

^{30}Another method is the Guttman criterion,

^{31}which selects factors with eigenvalues larger than 1. Eigenvalue refers to a proportion of variance that is explained by a factor. The higher the eigenvalue for a factor, the larger the factor explains the variance of the data. This method, however, has been shown to be problematic because the exact eigenvalue can vary depending on the sample.

^{25}For instance, a factor's eigenvalue can exceed 1 in one sample but not in another, resulting in different number of factors depending on the sample. In vision research, factors that show systematic patterns in their loadings are qualitatively retained.

^{15}

^{,}

^{19}

^{,}

^{28}Also, a method that has become popular across fields is parallel analysis, which includes factors when the associated eigenvalue for each factor from empirical data exceeds that from randomly generated data.

^{25}In other words, the empirical eigenvalue must be higher than the random eigenvalue. However, statistical value such as factor loadings and eigenvalues themselves can vary from sample-to-sample and have a range of variability both in large and small samples. Therefore calculating the range of uncertainty, such as the confidence interval of eigenvalues, can be useful to compare those from a null distribution. Therefore these methods without a resampling method to compute the range of uncertainty are all prone to the variability of the eigenvalue or factor loadings, and can support different models depending on the local dataset.

*confirm*whether the fit of the factor model is adequate. The standard approach for confirmatory factor analysis requires a sample size of at least 200.

^{27}In cases of questionnaires from psychometrics, a large sample size can be achieved and clear conclusions from a confirmatory factor analysis can be formulated because one test can record responses for multiple response variables at once.

^{32}However, in ophthalmology and vision research where one datum is a summarized data of multiple trials, there is no systematic and uniform confirmatory approach to determine the number of factors in a model because meeting the requirements for a standard confirmatory factor analysis is not feasible. Fortunately, contrast sensitivity data can be visualized, and the fit of the factor model can be visually inspected against the experimental data. With modern tools, the fitted data from the factor model can be plotted and stochastic (random) methods can be implemented without consuming excessive computer memory. In other words, in vision research and ophthalmology, because of contemporary tools for factor analysis and availability of diverse software packages, it has now become possible to confirm whether a given factor model is appropriate even if the data do not meet the standard requirements for confirmatory factor analysis.

^{2}for the model fit. Moreover, we applied a statistical method that generates a range of error for eigenvalues from bootstrap resampling to derive the most appropriate factor model. Bootstrapping is a stochastic procedure of resampling data with replacement,

^{33}which is repeated numerous times. It can be used to generate the range of error, such as the confidence interval, of statistical values that can be only collected once from the raw data. Also, as a confirmatory measure, we used a visualization method to inspect whether the fit of the selected factor model was faithful to the experimental data. Second, to promote reproducibility and replicability of research practices in factor analysis for vision scientists and ophthalmologists, we compiled our analysis and visualization routines for contrast sensitivity data in an R package

*smCSF*(https://smin95.github.io/dataviz/: Chapters 13–16).

^{34}and 51 from Kim et al.

^{35}were analyzed separately. In both studies, the quick Contrast Sensitivity Function (qCSF) method was used to measure the sensitivity at various spatial frequencies.

^{36}

^{,}

^{37}For each qCSF test, there were 100 trials, and each test would take about eight minutes.

^{35}

^{35}includes contrast sensitivity of 51 adults with normal vision for red-green, blue-yellow, and achromatic noise patterns. Noise gratings were generated in the space domain by filtering white noise by an oriented Gabor filter and were presented in a 5° Gaussian window. Each measurement was performed twice, and the values were then averaged across the two repetitions. The color sensitivity data were obtained from 0.25 c/deg to 2.54 c/deg, whereas the achromatic data were obtained from 0.25 c/deg to 9.57 c/deg.

^{34}

^{34}In our computational study, only the data of the dominant eye's sensitivity was used because a preliminary analysis, using the Kaiser-Meyer-Olkin test, revealed that the dataset was more apt for factor analysis than that from the non-dominant eye. The range of tested spatial frequencies was from 1 c/deg to 14.16 c/deg.

^{2}likelihood ratio test. It tests whether a model with more factors can fit the model better than a simpler model with fewer factors with a statistical significance. Next, the simple scree test was used, a qualitative method that has been used in vision research

^{14}

^{,}

^{19}and involves locating where the plot “breaks” into a flat line. The breaking point is noted as the boundary between significant and insignificant factors. Third, factors with loadings showing systematic patterns were kept. This qualitative method has been used in previous psychophysical studies.

^{19}

^{,}

^{28}For example, if a three-factor model is used to derive the loading scores from factor analysis on a dataset that supposedly has two factors, then the loading scores for the third factor should not show meaningful pattern with high values.

^{25}The 95% confidence interval of the eigenvalues was obtained using the resampling method (see the Appendix) to counter against the potential variability of eigenvalues. Then, the eigenvalues and their confidence intervals from empirical and random data were visualized as the scree plot.

^{40}

^{,}

^{41}The factors whose confidence intervals of the eigenvalue from the raw data do not overlap with those from factors from the random data are deemed to be statistically significant. These steps are compiled in the functions of the

*smCSF*package (see the Appendix).

^{+}is the Moore-Penrose pseudo inverse of the loadings for each factor, and y is the matrix of the raw data (contrast sensitivity).

^{42}

^{,}

^{43}By performing a matrix multiplication between the coefficient weights β and the matrix of the loadings, we computed the following fitted value:

*R*

^{2}) between the fitted values from the factor model and the experimental data.

^{11}

^{,}

^{19}

^{,}

^{44}:

*i*at spatial frequency

*n*. The value of

*Q*was set to 4 based on earlier works.

^{13}

^{,}

^{19}The derived sensitivity values were then used to derive the qCSF parameters (see the Appendix) to obtain the truncated log-parabola model of CSF so that the smooth tuning function of each spatial channel could be computed across the tested range of spatial frequency. This analysis comes along with an assumption of the combination rule, pointing that different spatial channels can

*combine*to influence contrast sensitivity.

^{44}In addition, the derived sensitivity values were fitted against Wilson's model

^{45}(Equation 1 in the previous study) to estimate the tuning of each statistical factor.

^{35}: Chromatic and Achromatic Sensitivity

^{16}These datasets were combined as if the three sensitivity functions were part of a single matrix. Specifically, the three datasets were concatenated one after the other on the spatial frequency dimension. According to the Kaiser-Meyer-Olkin test (most values > 0.6) and Bartlett's test for sphericity (

*P*< 0.05), which is a test that compares the identity matrix to the observed correlation matrix, combined dataset was appropriate for factor analysis.

*P*< 0.05). In sum, most methods supported the two-factor model but with the exception from the likelihood ratio test.

*P*< 0.05). As was the case with the blue-yellow sensitivity data, the analyses yielded contradictory results regarding which model is most appropriate.

*unequivocal*result.

^{2}for both three-factor models ranged from 0.95 to 1; this range is very narrow and high, demonstrating that the three-factor model is possibly overfitting the data.

^{34}but with a different range of spatial frequency from 1 c/deg to 14.16 c/deg.

^{34}: Achromatic Sensitivity Above 1 c/deg

^{35}revealed mixed results regarding which model is most appropriate. Therefore, we analyzed the achromatic data of the study by Reynaud et al.,

^{34}who tested 52 normally-sighted adults; this dataset contains tested spatial frequencies between 1 c/deg and 14.16 c/deg. Using the dataset would enable us to examine whether the inclusion of only one spatial channel in the factor model at a frequency range above 1 c/deg is adequate. First, the scree test (Fig. 4) had a breaking point between the second and third factors, indicating that a two-factor model is sufficient. The confidence intervals of the eigenvalues from two factors were also significant. Parallel analysis also supported a two-factor model. The likelihood ratio test endorsed the two-factor model. Furthermore, loadings from two factors showed meaningful patterns. To summarize, the different tests unanimously supported the two-factor model for achromatic vision above 1 c/deg.

*R*

^{2}across 52 observers are shown. First, the loading scores (see Fig. 5A) demonstrate that the two spatial channels intersect at about 3 c/deg, which is approximately where the peak of the achromatic CSF is located. We also see that the two-factor model can faithfully reproduce the achromatic curve at a range of spatial frequency above 1 c/deg (Fig. 5B). The spatial tunings of the two channels are shown in Figure 5C, indicating that the intersection between the two spatial channels is at about 3.11 c/deg. The distribution of

*R*

^{2}(mostly above 0.8) also indicates that the model-fit is appropriate (Fig. 5C). However, there remains a possibility that a third spatial channel might operate. To address this issue, we included a third factor in the model. However, it contributed to only 4% of total variance, whereas the two primary factors explained 96% of variance. Therefore we can conclude that there are two frequency-tuned statistical factors beyond 1 c/deg for achromatic sensitivity.

^{35}After Model Selections

^{35}with the three channels that are necessary for achromatic sensitivity in the range 0.25 c/deg to 9.57 c/deg. For chromatic stimuli, together with the visualization and resampling methods, our results reveal that a two-factor model adequately describes the contrast sensitivity for chromatic stimulus, be it red-green or blue-yellow. The loading scores of the two spatial channels across the two chromatic classes intersect at about 0.7 to 1 c/deg [Fig. 6A(i) and (ii)]. To precisely capture the point of intersection, we plotted the tuning of each spatial channel [Fig. 6B(i) and (ii)] by fitting the data using the loading scores with the qCSF model. The intersection of spatial frequency between the two channels were 0.81 and 0.91 for blue-yellow and red-green stimuli, respectively. Indeed, the points of intersection are close to where the peaks of the sensitivity functions are shown in Figure 6C(i) and (ii). Also, the shape of the model CSF accurately fits the data shown in Figure 6C(i) and (ii). Additionally, the distribution of the coefficient of determination (

*R*

^{2}) of the two-factor model for these two stimuli types also shows that the model faithfully describes the data shown in Figure 6D(i) and (ii). Because the range of 0.25 c/deg and 2.54 c/deg encompasses entire shape of the CSF, there might be no need for another one beyond the spatial two channels. Therefore our results show that the likelihood ratio test, which supported the three-factor model, overestimated the number of factors in our chromatic data. For the blue-yellow data, the fit from one-factor model (Fig. 3) and the tuning of the second channel [pink line in Fig. 6B(i)] have similar shapes and ranges of sensitivity, indicating that one-factor model from Figure 3 might represent the second spatial channel. However, for the red-green data, the fit from one-factor model (Fig. 3) has a higher range of sensitivity than the second spatial channel [pink line in Fig. 6B(ii)], suggesting that the one-factor model was merely a coarse attempt of the factor analysis to summarize the original data rather than a direct representation of the second spatial channel.

^{34}(see Fig. 5). Also, the histogram of

*R*

^{2}indicates that the three-factor model has an excellent model-fit to the empirical data [Fig. 6D(iii)]. Together, these findings suggest that there are three spatial-frequency-tuned statistical factors in the range of 0.25 c/deg to 9.54 c/deg for achromatic contrast sensitivity.

^{45}We fitted the derived sensitivity values from each statistical factor against Wilson's spatial model, which assumes that there are separate mechanisms for processing contrast sensitivity across different ranges of spatial frequency (Fig. 7). The lowest spatial frequency range is represented by the Wilson A channel (Fig. 7A). The mid and higher ranges are represented by Wilson B and C channels, respectively (Figs. 7B, 7C). The agreement between our extrapolated sensitivity from each statistical factor and the Wilson channels demonstrate that Wilson's model can reliably capture the tuning functions of the three statistical factors. The three fits resemble faithfully to those in previous studies

^{11}(compare Fig. 7D vs. Fig. 3 in Peterzell's report

^{11}). For instance, the peak of Wilson A channel is close to 1 c/deg, whereas that of Wilson B channel is above 1 c/deg. Our findings from factor analysis also support Wilson's model and earlier studies

^{11}

^{,}

^{44}that describe contrast sensitivity data using covariance.

^{27}

^{,}

^{32}Confirmatory factor analysis is often used in psychometrics that rely on questionnaires for data analysis, where each question can be considered a response variable and a cluster of questions can be part of a latent factor.

^{32}In such a case, there can be as many as 50 or more questions with a sample size above 300. This is impractical for psychophysical experiments, along with the fact that data at each response variable could be a summary measure of many trials.

^{46}However, as opposed to in psychometrics, the model from psychophysical studies can be fitted against experimental data visually, enabling us to estimate the number of factors clearly.

^{15}

^{,}

^{19}The number of channels was found to be different between achromatic and chromatic vision for two reasons. First, the shapes of achromatic and chromatic data are different. The chromatic sensitivity function has the lowpass shape, peaking (0.5 c/deg) and falling off at a lower spatial frequency,

^{47}whereas the achromatic sensitivity function has a bandpass shape, peaking at about 2-3 c/deg and falling off at a higher frequency.

^{47}

^{,}

^{48}Second, the range of tested spatial frequency for the chromatic sensitivity was narrower than that of the achromatic sensitivity in our dataset, requiring us to consider the possibility that a third spatial channel might still exist for chromatic sensitivity at beyond 3 c/deg (see Fig. 6). However, in light of the difference in the shapes of the chromatic (lowpass) and achromatic (bandpass) sensitivity functions, it is possible that the minimal sensitivity levels at higher spatial frequencies (beyond 4 c/d) for chromatic stimuli might minimize the role of the potential third spatial channel even if it operates, reducing its significance and impact on visual perception.

^{12}

^{,}

^{13}

^{,}

^{15}For achromatic sensitivity, the loadings from the three-factor model intersected at about 1 and 3 c/deg [see Fig. 6 B(iii)], surrounding the achromatic peak. Following the same interpretation, we can speculate that three spatial channels were active near the peak between 1 and 3 c/deg. Interestingly, the first two channels from our achromatic three-factor model are similarly positioned as Wilson A and B channels from Peterzell et al.,

^{11}

^{,}

^{14}

^{,}

^{15}

^{,}

^{19}

^{,}

^{20}

^{,}

^{44}

^{,}

^{49}despite some differences in where the spatial channels intersect, which can be attributed to sample-to-sample variability. Interestingly, the tunings of the three statistical factors were faithfully captured by Wilson's model,

^{45}which yielded three separate channels (see Fig. 7). The third factor is similarly positioned to the covariance factor driven by optics at a higher spatial frequency.

^{17}Furthermore, two lowest achromatic channels (blue and pink lines in Fig. 6B) show similar tunings to those of the two chromatic channels. This similarity in their tuning does not necessarily support an interdependence of these channels

^{15}because we observed no dependent relationships between them. Instead, it would suggest that vision of luminance modulations (i.e., achromatic contrast) can simply benefit from an additional high spatial frequency channel compared to color vision, thereby supporting the classical view that achromatic vision processes finer details.

^{50}Conclusions from our factor analysis confirm the findings from primate studies, namely that achromatic and chromatic vision are processed independently

^{50}

^{–}

^{55}and that there is a form of multiplexing of retinal ganglion cells resulting in the dependency of spatial frequency

^{56}that results in similar tunings of the achromatic and chromatic channels. Midget ganglion cells relay color information and spatial resolution to the parvocellular layers of the lateral geniculate nucleus. For example, if the parvocellular pathway is perturbed, color sensitivity and achromatic sensitivity at high spatial frequency are compromised.

^{50}

^{,}

^{51}

*smCSF*package, which is for researchers and clinicians who wish to plot elegant contrast sensitivity functions and perform standardized data analysis routines that have been used in the last decade with minimal coding (code examples and documentation in https://smin95.github.io/dataviz: Chapters 13–16). It also allows the user to easily compute the qCSF parameters for all subjects across experimental conditions, groups and repetitions in a single line of code if the data frame has an appropriate structure. In addition, the package provides functions for fitting the sensitivity curve from raw data; examples are shown in Chapters 13 and 14 of the documentation. Finally, it provides some additional methods for performing factor analysis (Chapter 16). To our knowledge, this library is the first R package for analyzing and visualizing contrast sensitivity data. It has been built to simplify the process of data visualization and analysis of contrast sensitivity data within a single software environment. We hope that the methods and the tool we have introduced will be useful for the researchers and clinicians in the fields of vision science and ophthalmology.

*smCSF*.

**S.H. Min**, None;

**A. Reynaud**, None

*Studies in Individual Differences: The Search for Intelligence*. Norwalk, CT: Appleton-Century-Crofts; 1961: 59–73.

*Behav Brain Res*. 1983; 10: 87–97. [CrossRef] [PubMed]

*J Physiol*. 1962; 160: 106. [CrossRef] [PubMed]

*J Physiol*. 1968; 197: 551. [CrossRef] [PubMed]

*Annual review of psychology*. 1980; 31(1): 309–341. [CrossRef] [PubMed]

*Visual Pattern Analyzers*. Oxford, UK: Oxford University Press; 1989.

*J Physiol*. 1988; 395: 661–678. [CrossRef] [PubMed]

*J Physiol*. 1973; 231: 385. [CrossRef] [PubMed]

*Vis Res*. 1982; 22: 225–233. [CrossRef] [PubMed]

*Vis Res*. 1981; 21: 1115–1122. [CrossRef] [PubMed]

*Electronic Imaging*. 2016; 28: 1–11.

*Vis Res*. 2000; 40: 431–444. [CrossRef] [PubMed]

*Vis Res*. 1984; 24: 689–700. [CrossRef] [PubMed]

*Vis Res*. 1996; 36: 3077–3085. [CrossRef] [PubMed]

*Vis Res*. 2000; 40: 417–430. [CrossRef] [PubMed]

*Vis Res*. 2000; 40: 613–628. [CrossRef] [PubMed]

*J Vis*. 2017; 17: 791–791. [CrossRef]

*Vision Science and Its Applications*. Washington, DC: Optica Publishing Group; 2000: FC2.

*Vis Res*. 1993; 33: 381–396. [CrossRef] [PubMed]

*Vision Science and Its Applications*. Washington, DC: Optica Publishing Group; 1996:ThA-3.

*Visual Perception: The Neurophysiological Foundations*. Philadelphia: Elsevier; 1990: 231–272.

*Invest Ophthalmol Vis Sci*. 2022; 63(11): 6–6. [CrossRef] [PubMed]

*Front Comput Neurosci*. 2023; 17: 1241455. [CrossRef] [PubMed]

*Organ Res Methods*. 2004; 7: 191–205. [CrossRef]

*Eco-Stats: Data Analysis in Ecology: From t-Tests to Multivariate Abundances*. Berlin: Springer Nature; 2022.

*Research Methods Using R: Advanced Data Analysis in the Behavioural and Biological Sciences*. Oxford, UK: Oxford University Press; 2022.

*JOSA A*. 1988; 5: 1722–1735. [CrossRef]

*Pract Assess Res Eval*. 2005; 10(1): 7.

*Struct Equation Model*. 2007; 14: 505–526. [CrossRef]

*Psychol Test Assess Model*. 2014; 56: 104.

*Psychology*. 2018; 9: 2207. [CrossRef]

*Bootstrapping: A Nonparametric Approach to Statistical Inference*. Thousand Oaks, CA: Sage Publishing; 1993.

*J Vis*. 2014; 14(9): 3–3. [CrossRef] [PubMed]

*Invest Ophthalmol Vis Sci*. 2017; 58: 3628–3636. [CrossRef] [PubMed]

*J Vis*. 2010; 10(3): 17–17. [CrossRef]

*Invest Ophthalmol Vis Sci*. 2010; 51: 5365–5377. [CrossRef] [PubMed]

*The comprehensive R archive network*. 2015; 337(338).

*Factor Analysis: Classic Edition*. Routledge; 2014.

*Psychol Methods*. 1999; 4(3): 272. [CrossRef]

*Personnel Psychol*. 1986; 39: 291–314. [CrossRef]

*Neuroimage*. 2011; 54: 1196–1210. [CrossRef] [PubMed]

*Human Brain Mapping*. 1994; 2(4): 189–210. [CrossRef]

*Optom Vis Sci*. 1997; 74: 800–807. [CrossRef] [PubMed]

*JOSA A*. 1984; 1: 124–131. [CrossRef]

*Psychophysics: A Practical Introduction*. New York: Academic Press; 2016.

*J Physiol*. 1985; 359: 381–400. [CrossRef] [PubMed]

*JOSA*. 1983; 73: 742–750. [CrossRef]

*Vis Res*. 1995; 35: 961–979. [CrossRef] [PubMed]

*J Neurosci*. 1989; 9: 776–783. [CrossRef] [PubMed]

*Nature*. 1990; 343(6253): 68–70. [CrossRef] [PubMed]

*Ann Rev Psychol*. 1990; 41: 635–658. [CrossRef]

*J Neurophysiol*. 1966; 29: 1115–1156. [CrossRef] [PubMed]

*J Physiol*. 1982; 330: 125–143. [CrossRef] [PubMed]

*J Physiol*. 1984; 357: 241–265. [CrossRef] [PubMed]

*J Neurosci*. 2018; 38: 1520–1540. [CrossRef] [PubMed]

*Ggplot2*. Berlin: Springer; 2016: 189–201.

*smCSF*

*smCSF*package fits the CSF based on the maximum likelihood estimates of key parameters of the truncated log-parabola model for human contrast sensitivity data.

^{35}

^{–}

^{37}The mathematical model predicts the shape of the CSF, using the equations below:

*sm_CSF()*,

*sm_areaCSF()*and

*sm_ribbonCSF(),*can plot the best-fitted model automatically in log scales using a data frame that contains experimental data with R implementations of the equations above. These functions estimate the parameters based on default arguments and fit a best possible model based on maximum likelihood. They have been created as direct extensions of

*ggplot2*via

*ggproto*objects.

^{57}The parameters specify the overall characteristic of the sensitivity function, rather than a data point at a specific frequency (Fig. A1).

- 1. Peak gain (γ
_{max}): Peak contrast sensitivity (hence, it is in the y-axis unit). - 2. Peak spatial frequency (
*f*): Spatial frequency where the peak gain is located (hence, it is in the x-axis unit)._{max} - 3. Bandwidth (β): Width of the CSF at half of the peak gain. The larger the bandwidth, the higher the overall sensitivity across the region of high spatial frequencies.
- 4. Truncation value (δ): This is a parameter creates a narrow plateau (i.e., flat curve) at the low spatial frequency range and resolves the issue of the CSF's asymmetry. In this model, however, the factor plays a very minor role and the plateau is usually unnoticeable.

^{36}and estimated the model parameters using maximum likelihood. Then, we resampled the parameters with replacement to create a simulated dataset in the form of a full CSF (note that parameters were considered being independent), and computed the eigenvalues with factor analysis. Resampling was performed independently because it is more robust to potential outliers. These steps would be one iteration, and 1000 iterations were performed in total. If we resampled the sensitivity data from multiple observers to create a simulated dataset, the resampled data might still produce a normal CSF with a peak and trough, but it would not retain covariance of the data. A computational demonstration has been posted online (https://smin95.com/dataviz: Chapter 16). Also, factor analytic results from Monte Carlo simulations are shown above to illustrate this point.

*smCSF*

*smCSF*.

**smCSF**) # devtools:: install_github(‘smin95/smCSF’)

*devtools*package is not up to date; the user should redownload the

*devtools*package if the installation of

*smCSF*fails.

*smCSF*package allows the users to compute the five parameters for all subjects across different conditions and/or groups with a single line of code. It has several arguments. It returns a list of important outputs. The user must identify the column that has all the subject identifiers within the subjects argument, as well as for the column with identifiers for the conditions in the conditions argument. Likewise, the argument x is for the column with spatial frequencies, values for the column with the contrast sensitivity data (in linear units) and data for the data frame itself that contains the linear data of spatial frequency and contrast sensitivity. Its output is a list with two vectors. The list from sm_params_list() can be used as argument for the function sm_np_boot(), which performs nonparametric simulation by resampling the parameters with replacement and refitting the CSF using the parameters. The output is saved in the variable param_res, which is short for

*parameter results.*

**sm_np_boot**(param_res, n = nObs, nSim = nSim)

**sm_plot_boot**(boot_res, shapes = 16) + ylab('Mean eigenvalues')