1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! Create a Link for GLM Families
//!
//! ## Description:
//!
//! This function is used with the ‘family’ functions in ‘glm()’.
//! Given the name of a link, it returns a link function, an inverse
//! link function, the derivative dmu/deta and a function for domain
//! checking.
//!
//! ## Usage:
//!
//! make.link(link)
//!
//! ## Arguments:
//!
//! * link: character; one of ‘"logit"’, ‘"probit"’, ‘"cauchit"’,
//! ‘"cloglog"’, ‘"identity"’, ‘"log"’, ‘"sqrt"’, ‘"1/mu^2"’,
//! ‘"inverse"’.
//!
//! ## Value:
//!
//! A object of class ‘"link-glm"’, a list with components
//!
//! * linkfun: Link function ‘function(mu)’
//! * linkinv: Inverse link function ‘function(eta)’
//! * mu.eta: Derivative ‘function(eta)’ dmu/deta
//! * valideta: ‘function(eta)’{ ‘TRUE’ if ‘eta’ is in the domain of
//! ‘linkinv’ }.
//! * name: a name to be used for the link
//!
//! ## See Also:
//!
//! ‘power’, ‘glm’, ‘family’.
//!
//! ## Examples:
//!
//! ```r
//! utils::str(make.link("logit"))
//! ```
use DMatrix;