Skip to contents

Simulates n_rep populations with simulate_breeding(), fits each with model() and the given formula, and reports the estimated heritability against the simulated one. Each replicate gets its own seed (seed + rep), and every fit starts cold from var(y) like any other fit, the harness never warm-starts, by the package's own rule.

Usage

mc_study(n_rep = 20, formula = y ~ cg + animal(id), h2 = 0.4, seed = 1, ...)

Arguments

n_rep

number of replicates

formula

passed to model(); the additive term must be named animal for the heritability slice (the component var(animal))

h2

simulated heritability, passed to simulate_breeding()

seed

base seed; replicate r uses seed + r

...

other arguments for simulate_breeding() (population size and depth)

Value

data.frame with one row per replicate (h2_est, converged, seconds), with the simulated value, the mean bias and the empirical standard deviation as attributes h2_true, bias, sd