Provides an interface for quantitative-genetic models in 'R',
backed by the 'HSquared.jl' engine for 'Julia'. Fits Gaussian pedigree animal models
by restricted maximum likelihood, using
average-information restricted maximum likelihood (AI-REML; Gilmour et al.
(1995)
R interface · Julia engine · a twin, not a port
How much is genetic?
Formula first. The engine returns heritability, variance components, and breeding values on the routes that are covered — experimental 0.9.0 release, not production. CRAN availability is tracked separately.
Get started Choose a model Fit a model
Before you report anything
Warning — experimental 0.9.0 release. Not production. CRAN availability is tracked separately. There are 7 R-public covered routes; fitting needs local Julia and an
HSquared.jlcheckout. Julia engine-covered ≠ R-public covered. Report point estimates only within a covered route. No interval is nominally coverage-calibrated; named univariate pedigree intervals are only classified as directional-conservative. See Can I fit and report this?.
| If you want to… | Read this |
|---|---|
| check a formula without installing Julia | Getting started (control = hs_control(engine = "validate")) |
| decide whether a number may go in a paper | Can I fit and report this? |
| see the seven R-public covered routes | Model status |
| set up the Julia engine | Installation |
| look up a function | Reference |
| understand evidence history without mistaking it for a release | Progression & evidence |
This four-animal pedigree is a syntax demo, not a number for a paper.
library(hsquared)
ped <- data.frame(
id = c("sire", "dam", "off1", "off2"),
sire = c(NA, NA, "sire", "sire"),
dam = c(NA, NA, "dam", "dam")
)
dat <- data.frame(
id = c("sire", "dam", "off1", "off2"),
sex = c("m", "f", "m", "f"),
weight = c(42, 38, 40, 37)
)
hsquared(
weight ~ sex + animal(1 | id, pedigree = ped),
data = dat,
control = hs_control(engine = "validate")
)
With a local Julia, JuliaCall, and an HSquared.jl checkout (see
Installation):
fit <- hsquared(
weight ~ sex + animal(1 | id, pedigree = ped),
data = dat
)
summary(fit)
Report only what Can I fit and report this? allows for the route you ran.
# install.packages("remotes")
remotes::install_github("itchyshin/hsquared")
Fitting also needs Julia, JuliaCall, and a local HSquared.jl tree.
HSquared is not in the Julia General registry — do not use
Pkg.add("HSquared") by name.
install.packages("JuliaCall")
Clone or point at your HSquared.jl checkout per the getting-started guide.
Shinichi Nakagawa (ORCID 0000-0002-7765-5182, [email protected]), Yefeng Yang (ORCID 0000-0002-8610-4016), Szymon Drobniak (ORCID 0000-0001-8101-6247).
hsquared is the applied R interface.
HSquared.jl is the sparse engine.
A twin, not a port.