Details
Converts standard R family objects into mcpfamily objects used internally by
mcp. Supported family and link combinations include:
gaussian(link = "identity")orgaussian(link = "log")binomial(link = "logit"),binomial(link = "probit"), orbinomial(link = "identity")bernoulli(link = "logit"),bernoulli(link = "probit"), orbernoulli(link = "identity")poisson(link = "log")orpoisson(link = "identity")negbinomial(link = "log", link_shape = "log")
Note: mcpfamily objects are shipped with mcp - there is not (yet) support for user-supplied
families.
Methods (by generic)
format(mcpfamily): Format anmcpfamilyobject.print(mcpfamily): Print anmcpfamilyobject.
Author
Jonas Kristoffer Lindeløv jonas@lindeloev.dk
Examples
# mcp() converts supported standard family objects automatically
data = data.frame(time = 1:6, y = exp(seq(0, 1, length.out = 6)))
my_normal = mcpfamily(stats::gaussian(link = "log"))
fit = mcp(list(y ~ 1), data, family = my_normal, par_x = "time", sample = FALSE)
family(fit) # Show the mcp family retained in the fit
#> Family: gaussian
#> Links: mu = log; sigma = identity
# The converted object can also be inspected directly
mcpfamily(stats::binomial())$dpars # Show its distributional parameters
#> [1] "mu"
