I have used the SIN link to estimate probabilities, mostly with
Program MARK. However, I am not sure how the SIN link works. I know the SIN link enables parameter estimation on boundaries (when the probability is 0 or 1), while the logit link seems to have problems in those situations.
Given that the SIN link works in
Program MARK, it seems to me that it should also work with logistic regression in glm in
Program R since both are estimating proportions of successes out of
n trials. However, there does not appear to be a built-in SIN link in
R for glm. I asked a question about this on
Stack Overflow when I thought it would be a simple programming issue and learned
R does allow user-specified links in glm.
However, nobody posted the
R code for the SIN link and I have encountered problems with the inverse of the link when trying to do it myself. Namely, there may be multiple solutions given the periodic nature of the SIN function. I imagine the search space must be constrained somehow to avoid multiple solutions.
The issue now seems more like a statistical problem than a programming problem and I am posting here hoping someone will either post the
R code for the SIN link in glm or provide a description of how the SIN link works sufficient for me to codify it myself. The other option I considered was to post a bounty on my
Stack Overflow question and I might still do that later.
Specifically, I am stuck on how to create the inverse of the link and whether the search space must be constrained to avoid multiple solutions resulting from the periodic nature of the SIN function. I am aware of the
family statement in glm and the
make.link statement and that user-specified links are possible in
R, for example with the
logexp link (
Here is a link to my earlier
Stack Overflow question:
The SIN link is:
(sin(X * Beta) + 1) / 2
X = design matrix Beta = parameter estimates
From my earlier post, note that
sin(z) is bounded between -1 and +1 inclusive. Therefore,
(sin(z) + 1) is bounded between 0 and 2 inclusive. Therefore,
(sin(z) + 1)/2 is bounded between 0 and 1 inclusive. This inclusivity is probably what enables the link to return estimates of proportions even when probability is 0 or 1.
Stack Overflow post also contains
R code for an 'exhaustive search' further suggesting the link probably does work for estimation of proportions if the search space is somehow constrained.
Thank you for any help. Hopefully this is an acceptable use of cross-posting given the statistical focus of the present question and the programming focus of the earlier question.
I should point out that in
Program MARK the SIN link seems to be reserved for models that contain only one entry per row in the design matrix, i.e., without covariates.
The inverse of the SIN link, as near as I can tell, is:
lin.pred <- asin((2*y) - 1)
This returns the correct linear predictor as long as the linear predictor,
z, falls in the range
-1 <= z <= 1. If covariates are not allowed, as alluded to above, then perhaps this inverse function will always be acceptable. Of course, I am still going to assume for now that dummy variables are allowed in the linear predictor (at least if there is no intercept).
The above proposed inverse link might solve the immediate problem of the inverse and constraints on the search space. The next step is to incorporate this inverse link into a user-specified link function in glm in R along with any additional required information to estimate proportions.