{"id":201,"date":"2017-04-18T02:42:40","date_gmt":"2017-04-18T02:42:40","guid":{"rendered":"http:\/\/sites.warnercnr.colostate.edu\/gwhite\/?page_id=201"},"modified":"2017-04-18T02:42:40","modified_gmt":"2017-04-18T02:42:40","slug":"link-functions","status":"publish","type":"page","link":"https:\/\/sites.warnercnr.colostate.edu\/gwhite\/link-functions\/","title":{"rendered":"Link Functions"},"content":{"rendered":"<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\"><a href=\"http:\/\/warnercnr.colostate.edu\/~gwhite\/mark\/markhelp\/index.html\">Contents<\/a> &#8211; <a href=\"http:\/\/warnercnr.colostate.edu\/~gwhite\/mark\/markhelp\/idx.htm\">Index<\/a><\/span><\/p>\n<hr \/>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: medium\"><b>Link Functions<\/b><\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: medium\"><b>Standard Link Functions<\/b><\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">A link function is the function that links the linear model specified in the design matrix, where columns represent the <a href=\"http:\/\/warnercnr.colostate.edu\/~gwhite\/mark\/markhelp\/beta_parameters.htm\">beta parameters<\/a> and rows the <a href=\"http:\/\/warnercnr.colostate.edu\/~gwhite\/mark\/markhelp\/real_parameter.htm\">real parameters<\/a>.\u00a0 <a href=\"http:\/\/warnercnr.colostate.edu\/~gwhite\/mark\/markhelp\/real_parameter.htm\">Real parameters<\/a> are the parameters of interest, e.g., the survival, recapture, reporting, fidelity or population size parameters, that are defined in the <a href=\"http:\/\/warnercnr.colostate.edu\/~gwhite\/mark\/markhelp\/parameter_matrices.htm\">PIM Matrices<\/a>.\u00a0 Program Mark supports 8 different link functions.\u00a0 The default is the SIN function, because the sin function is most useful with the <a href=\"http:\/\/warnercnr.colostate.edu\/~gwhite\/mark\/markhelp\/identity_design_matrix.htm\">identity design matrix<\/a> to provide a constraint that keeps the real parameters in the [0, 1] interval, yet allows the number of parameters to be correctly estimated.\u00a0 For the SIN link function, the linear combination from the design matrix (X * beta) is converted to the interval [0,1] by the link function<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 real parameters = (SIN(X * beta) + 1)\/2\u00a0 .<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">Other link functions include the logit,<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 real parameters = exp(X * beta)\/[1 + exp(X * beta)]\u00a0 ,<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">the loglog,<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 real parameters = exp[-exp(-X * beta)]\u00a0 ,<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">the complimentary loglog,<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 real parameters = 1 &#8211; exp[-exp(X * beta)]\u00a0 ,<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">the log,<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 real parameters = exp(X * beta)\u00a0 ,<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">the identity,<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 real parameters =\u00a0 X * beta\u00a0 ,<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">the absolute value,<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">real parameters = ABS(X * beta) ,\u00a0<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">and the Cauchy,<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">real parameters = 1\/2 + ATAN(X * beta)\/pi .\u00a0<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">The log and absolue value link functions constrain the real parameters to be positive (&gt;=0), and the identity link forces no constraints so that the real parameter values can be from -infinity to +infinity.\u00a0 The rest of the link functions contrain real parameters to be in the [0, 1] interval.\u00a0 When link functions that do not constrain probabilities to [0, 1] are used, numerical problems when optimizing the likelihood will often result.\u00a0 For the log and identity link functions used with an <a href=\"http:\/\/warnercnr.colostate.edu\/~gwhite\/mark\/markhelp\/identity_design_matrix.htm\">identity design matrix<\/a>, Program Mark uses the SIN link function to obtain initial estimates for parameters, then transforms the estimates to the parameter space of the log and identity link functions when they are requested.<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">The Sin link should only be used with design matrices that are identity matrices, or when only column in each row has a value not equal to zero.\u00a0 This is because the Sin link will reflect around the\u00a0 parameter boundary, and not enforce monotonic relationships.\u00a0 The logit link is better for non-identity design matrices.\u00a0 The Sin link is the best link function to enforce parameter values in the [0, 1] interval and yet obtain correct estimates of the number of parameters estimated.<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">The identity link is the best link function for determining the number of parameters estimated when the [0, 1] interval does not need to be enforced.<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: medium\"><b>Parameter-specific Link Functions<\/b><\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">MARK also has the option of using a different link function for each real parameter, i.e, each row of the design matrix is converted to its real parameter value with a different link function.\u00a0 For example, you might want to enforce a [0, 1] constraint on one group of real parameters, i.e., phi(t), whereas you do not want to enforce this constraint on another group of real parameters.\u00a0 To select a different link function for each parameter, select the &#8220;Parm-specific&#8221; choice for the link function.\u00a0 You will then be given a chance to select a link function for each real parameter.\u00a0 The dialog window will include a drop-down box for each real parameter to provide you with choices.\u00a0 Besides the 6 link functions listed above, the multinomial logit link function and the cumulative logit link function will also be available.<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">Note that it would probably not make sense to use the same beta parameter in 2 different link functions, i.e., have non-zero values in 2 different rows but the same column of the design matrix, and different link functions for the rows.\u00a0 Although Program MARK would allow such a bizzare situation, the biology behind the model would likely be non-sensical.<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: medium\"><b>Multinomial Logit Link Function<\/b><\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">The multinomial logit link (MLogit) function is useful for constraining a set of parameters to have a sum &lt;= to 1.\u00a0 A common application of this link function would be the psi parameters of a <a href=\"http:\/\/warnercnr.colostate.edu\/~gwhite\/mark\/markhelp\/multi_state_models.htm\">multi-state<\/a> model.\u00a0 The multinomial logit works as follows.\u00a0 Assume that each of the transition parameters from state A have their own beta value, so that A to B is B1, A to C is B2, and A to D is B3.\u00a0 To constrain these 3 parameters to sum to &lt;= 1, the multinomial logit link works as follows:<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">psi A to B = exp(B1)\/[1 + exp(B1) + exp(B2) + exp(B3)]<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">psi A to C = exp(B2)\/[1 + exp(B1) + exp(B2) + exp(B3)]<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">psi A to D = exp(B3)\/[1 + exp(B1) + exp(B2) + exp(B3)]<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">To create this set of links, you would select the MLogit(1) link function from the list of link functions offered to you for these 3 parameters.<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">A second set of multinomial logit link functions would be required for the psi parameters from state B:<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">psi B to A = exp(B4)\/[1 + exp(B4) + exp(B5) + exp(B6)]<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">psi B to C = exp(B5)\/[1 + exp(B4) + exp(B5) + exp(B6)]<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">psi B to D = exp(B6)\/[1 + exp(B4) + exp(B5) + exp(B6)]<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">For this set of parameters, you would select the MLogit(2) link function, because you want a separate MLogit link function to constrain these 3 psi values to sum to &lt;= 1.<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">Similarly, for transitions from state C, you would select the MLogit(3) link for the transitions psi C to A, psi C to B, and psi C to D.\u00a0 Likewise, for transitions from state D, the MLogit(4) link function would be selected.<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">In summary, for each set of parameters where you want the constraint that the parameters sum to &lt;= 1, you must specify a MLogit(<i>x<\/i>) function, where <i>x<\/i> represents the set number of the MLogit link function.<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">Care must be taken to select the MLogit link for the set of parameters in the PIM that you want to sum to &lt;=1.\u00a0 An <a href=\"http:\/\/warnercnr.colostate.edu\/~gwhite\/mark\/markhelp\/mlogit_link.htm\">example<\/a> of how to properly constrain parameters within an MLogit link is provided.\u00a0<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: medium\"><b>Cumulative Logit Link Function<\/b><\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">The cumulative logit link (CLogit) function is useful for constraining a set of parameters to monotonically increase.\u00a0 Suppose that you desire the relationship of S(1) &lt;= S(2) &lt;= S(3), but do not want to enforce the relationship on the logit scale that logit[S(2)] &#8211; logit[S(1)] =\u00a0 logit[S(3)] &#8211; logit[S(2)] as a trend model would do.\u00a0 The CLogit link would generate this relationship as:<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">S(1) = exp(B1)\/[1 + exp(B1) + exp(B2) + exp(B3)]<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">S(2) = [exp(B1) + exp(B2)]\/[1 + exp(B1) + exp(B2) + exp(B3)]<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">S(3) = [exp(B1) + exp(B2) + exp(B3)]\/[1 + exp(B1) + exp(B2) + exp(B3)]<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">As with the MLogit link, you have to specify a separate CLogit link for each set of parameters that are to be constrained.\u00a0 In addition, you also have to specify the order of the parameters for the set.\u00a0 For the above example, the link function for each of the 3 survival rates would be:<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">S(1): CLogit(1,1),<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">S(2): CLogit(1,2), and<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">S(3): CLogit(1,3).<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">If you have a second set of parameters that you also want to enforce a monotonic increase on, say S(4) &lt;= S(5) &lt;= S(6), the appropriate links would be:<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">S(4): CLogit(2,1),<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">S(5): CLogit(2,2), and<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">S(6): CLogit(2,3).<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">You specify these link functions by selecting the Parm.-Specific choice from the <a href=\"http:\/\/warnercnr.colostate.edu\/~gwhite\/mark\/markhelp\/run_window.htm\">Run Window<\/a> list of link functions, and then entering the appropriate specification in the edit box next to the parameter name.\u00a0 Note that you cannot select the CLogit link function from the drop-down list of link functions like as with all of the other link functions, because you have to specify the set and the order of the parameter within the set.\u00a0 Therefore, you have to manually enter the link function in each edit box next to the real parameter value to which it pertains.\u00a0 This is the most logical method to provide the user the flexibility needed to select the parameters for each CLogit set, and still specify the order of the increase of the real parameters.<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">Note that you can force a monotonic decrease by reversing the order of the real parameters in the CLogit set.\u00a0 For example, to create the relationship S(1) &gt;= S(2) &gt;= S(3), you would specify the following link functions:<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">S(3): CLogit(1,1),<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">S(2): CLogit(1,2), and<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">S(1): CLogit(1,3).<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">In this case, what you have really specified is that S(3) &lt;= S(2) &lt;= S(1).<\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: medium\"><b>Forced Link Function<\/b><\/span><\/p>\n<p><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\">Several types of parameters have forced link functions, i.e., the link function is changed to the default value unless the user specifies Parm.-Specific link functions.\u00a0 Specifically, the lamba and <i>f<\/i> parameters of the <a href=\"http:\/\/warnercnr.colostate.edu\/~gwhite\/mark\/markhelp\/data_type.htm\">Pradel data types<\/a> and <\/span><span style=\"font-family: Arial, helvetica, sans-serif;font-size: small\"><a href=\"http:\/\/warnercnr.colostate.edu\/~gwhite\/mark\/markhelp\/link_barker.htm\">Link-Barker<\/a><\/span><span style=\"color: #0000ff;font-family: Arial, helvetica, sans-serif;font-size: small\"> data type are set to a log link function, even if the user selects the sin, logit, loglog, or cloglog link functions.\u00a0 Likewise, the population estimates (<i>N<\/i>) in the <a href=\"http:\/\/warnercnr.colostate.edu\/~gwhite\/mark\/markhelp\/data_type.htm\">closed captures<\/a> and <a href=\"http:\/\/warnercnr.colostate.edu\/~gwhite\/mark\/markhelp\/data_type.htm\">Jolly-Seber<\/a> and <a href=\"http:\/\/warnercnr.colostate.edu\/~gwhite\/mark\/markhelp\/popan_model.htm\">POPAN<\/a> data types are also set to a log link function when the user selects the sin, logit, loglog, or cloglog link functions for the model.\u00a0 The reason for these changes from the user-specified link function for the model is that link functions that constrain these parameters to the [0, 1] interval will not work because the real parameters lambda, <i>f<\/i> and <i>N<\/i> should not be in t<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Contents &#8211; Index Link Functions Standard Link Functions A link function is the function that links the linear model specified in the design matrix, where columns represent the beta parameters and rows the real parameters.\u00a0 Real parameters are the parameters &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/sites.warnercnr.colostate.edu\/gwhite\/link-functions\/\"> <span class=\"screen-reader-text\">Link Functions<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":117,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-201","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/sites.warnercnr.colostate.edu\/gwhite\/wp-json\/wp\/v2\/pages\/201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.warnercnr.colostate.edu\/gwhite\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sites.warnercnr.colostate.edu\/gwhite\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sites.warnercnr.colostate.edu\/gwhite\/wp-json\/wp\/v2\/users\/117"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.warnercnr.colostate.edu\/gwhite\/wp-json\/wp\/v2\/comments?post=201"}],"version-history":[{"count":1,"href":"https:\/\/sites.warnercnr.colostate.edu\/gwhite\/wp-json\/wp\/v2\/pages\/201\/revisions"}],"predecessor-version":[{"id":202,"href":"https:\/\/sites.warnercnr.colostate.edu\/gwhite\/wp-json\/wp\/v2\/pages\/201\/revisions\/202"}],"wp:attachment":[{"href":"https:\/\/sites.warnercnr.colostate.edu\/gwhite\/wp-json\/wp\/v2\/media?parent=201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}