right now, for both our traits of interest logit(D0) and the slope, there are only one source of variance allowed, the "residual", "non-genetic" part.
We need to allow for heritable variation. To do that:
change SD input sliders to variance (not strictly needed, but better to follow)
add a global "heritability" slider to the GUI (min 0, max 1)
add "internal" globals (i.e. in code, not on the GUI) "V_A" and "V_R" for both slope and logit(d0) that are set to heritability*global variance and (1-heritability)*global variance, respectively (we force both traits to have the same heritability for simplicity)
when setting initial turtles, draw genotypic value from Normal(mean, sqrt(V_A)), and draw residual noise from Normal(0,sqrt(V_R)). Store both, and then create trait value by adding them
when creating new turtles, draw genotypic value from the parent(s), and then re-draw residual noise from the random normal distribution
Note that this means we can dump the "reshuffled/evolutionary" switch once this is done since reshuffled should be equivalent to heritability = 0
right now, for both our traits of interest logit(D0) and the slope, there are only one source of variance allowed, the "residual", "non-genetic" part.
We need to allow for heritable variation. To do that:
Note that this means we can dump the "reshuffled/evolutionary" switch once this is done since reshuffled should be equivalent to heritability = 0