Links¶
-
class
pygam.links.Link(name=None)¶ Bases:
pygam.core.Core
-
class
pygam.links.IdentityLink¶ Bases:
pygam.links.Link-
gradient(mu, dist)¶ derivative of the link function wrt mu
Parameters: - mu (array-like of legth n) –
- dist (Distribution instance) –
Returns: grad
Return type: np.array of length n
-
link(mu, dist)¶ glm link function this is useful for going from mu to the linear prediction
Parameters: - mu (array-like of legth n) –
- dist (Distribution instance) –
Returns: lp
Return type: np.array of length n
-
mu(lp, dist)¶ glm mean function, ie inverse of link function this is useful for going from the linear prediction to mu
Parameters: - lp (array-like of legth n) –
- dist (Distribution instance) –
Returns: mu
Return type: np.array of length n
-
-
class
pygam.links.InvSquaredLink¶ Bases:
pygam.links.Link-
gradient(mu, dist)¶ derivative of the link function wrt mu
Parameters: - mu (array-like of legth n) –
- dist (Distribution instance) –
Returns: grad
Return type: np.array of length n
-
link(mu, dist)¶ glm link function this is useful for going from mu to the linear prediction
Parameters: - mu (array-like of legth n) –
- dist (Distribution instance) –
Returns: lp
Return type: np.array of length n
-
mu(lp, dist)¶ glm mean function, ie inverse of link function this is useful for going from the linear prediction to mu
Parameters: - lp (array-like of legth n) –
- dist (Distribution instance) –
Returns: mu
Return type: np.array of length n
-
-
class
pygam.links.LogitLink¶ Bases:
pygam.links.Link-
gradient(mu, dist)¶ derivative of the link function wrt mu
Parameters: - mu (array-like of legth n) –
- dist (Distribution instance) –
Returns: grad
Return type: np.array of length n
-
link(mu, dist)¶ glm link function this is useful for going from mu to the linear prediction
Parameters: - mu (array-like of legth n) –
- dist (Distribution instance) –
Returns: lp
Return type: np.array of length n
-
mu(lp, dist)¶ glm mean function, ie inverse of link function this is useful for going from the linear prediction to mu
Parameters: - lp (array-like of legth n) –
- dist (Distribution instance) –
Returns: mu
Return type: np.array of length n
-
-
class
pygam.links.LogLink¶ Bases:
pygam.links.Link-
gradient(mu, dist)¶ derivative of the link function wrt mu
Parameters: - mu (array-like of legth n) –
- dist (Distribution instance) –
Returns: grad
Return type: np.array of length n
-
link(mu, dist)¶ glm link function this is useful for going from mu to the linear prediction
Parameters: - mu (array-like of legth n) –
- dist (Distribution instance) –
Returns: lp
Return type: np.array of length n
-
mu(lp, dist)¶ glm mean function, ie inverse of link function this is useful for going from the linear prediction to mu
Parameters: - lp (array-like of legth n) –
- dist (Distribution instance) –
Returns: mu
Return type: np.array of length n
-