I have a cosine-like data curve over $x \in [0,1]$ that I can rather well-fit by a function of the form $a \cos{2 \pi x} +b$. Although good, the fit is still lacking, in that the residuals from the fit have something of the form $c \sin{4 \pi x} + d$, where $c$ is considerably less than $a$, and $d$ less than $b$. So, I think that I should explore the use of doubly-periodic functions to fit my data. Is this sufficient information, for possible candidate families of functions (elliptic...) to be suggested, the use of which I could explore? (I am a Mathematica user.)

This question arises in a quantum-information-theoretic/random-matrix context, in trying to employ eq. (24) \begin{equation} \label{JointBuresHSformula} \rho_x= \frac{(y \mathbb{I} +x U) AA^{\dagger}(y \mathbb{I}+x U^{\dagger})}{\mbox{Tr} (y \mathbb{I}+x U) A A^{\dagger} (y \mathbb{I} +x U^{\dagger})}, \end{equation} in the paper "Random Bures mixed states and the distribution of their purity" of Osipov, Sommers and Zyczkowski https://arxiv.org/abs/0909.5094. ($U$ is a random unitary matrix and $A$, a Ginibre matrix.) This formula provides an interpolation between random density matrices ($\rho_x$) with respect to the Hilbert-Schmidt and Bures (minimal monotone) measures ($x$ being the interpolating variable).

I am interested in exactly determining the ($x = \frac{1}{2}$) Bures "separability probability" ($\approx 0.0733$) of two-qubit ($4 \times 4$ density matrices), while the Hilbert-Schmidt separability probability ($x=0,1$) already appears to be exactly known (that is, $\frac{8}{33} \approx 0.242424...$, https://arxiv.org/abs/1701.01973). Each random density matrix generated in accordance with the formula is tested to see if it satisfies the "Peres-Horodecki" partial transposition test for separability. If it does, it contributes to the total separability probability.

For a related/background posting, entitled "Estimate/determine Bures separability probabilities making use of corresponding Hilbert-Schmidt probabilities", see https://quantumcomputing.stackexchange.com/questions/2740/estimate-determine-bures-separability-probabilities-making-use-of-corresponding

Per the comment of მამუკა ჯიბლაძე, I am inserting an image of my "cosine-like data curve" (based now preliminarily on 740,000 random realizations). (Note the $\frac{8}{33}$ fit at $ x =0, 1$.)

Here, additionally, is a plot of the (sine-like) residuals resulting from subtracting from the above data curve a fit of $\frac{1}{66} (5.29209 \cos (2 \pi x)+10.7079)=0.0801832 \cos (2 \pi x)+0.162241$.

This is now a plot of the two indicated curves

So, to reiterate, I am interested in suggestions of classes of models (presumably with some random-matrix pertinence) that might fit these data--the goodness of fits of which, I could then investigate. (The "Holy Grail" of this research program is the exact value [$\approx 0.0733$] of the Bures [$x =\frac{1}{2}]$ separability probability [https://arxiv.org/abs/quant-ph/0308037, and subsequent literature].)

2more comments