dadi handles theta differently than other parameters, because theta works in a particular way. Theta just scales the frequency spectrum. So (if all other parameters are held fixed) the frequency spectrum for theta=2 is just the frequency spectrum for theta=1
with every entry doubled. In practice this means that we don't need to use the full optimizer to find theta, since it's so easy to find once we've optimized the other parameters.
The definition of theta used in dadi is theta=4*Nref*mu*L. Here mu is the mutation rate, L is the length of sequence, and Nref is the effective size of the reference population. That's the population all other population sizes are measured in relation
to. In the most common case, that population is the ancestral population.
As for "fixed theta", not that the function you call is optimal_sfs_scaling. If theta=1 in the model, which is the default, then optimal_sfs_scaling gives the optimal value for theta. If theta is fixed to some other value in the model, then optimal_sfs_scaling
gives the factor by which theta must be scaled to optimally fit the data. In your case, that factor is 1, since you fixed theta to be equal to the optimal value.
The "fixed theta" analysis is useful when you have some external information about theta, so that you don't want to get it by fitting the FS. For example, maybe you know what the ancestral size is, and you want to plug that information into your model,
rather than fitting it.
Does this answer your questions?
Best,
Ryan
--
Ryan Gutenkunst
Assistant Professor
Molecular and Cellular Biology
University of Arizona