# regression for angular/circular data

I have supervised learning problem where targets are angles. If I would do simple regression then numbers 360 and 1 would be far away for my model, but actually they are close and predicting x and y coordinates doesn't feels right, since I am trying to predict just one number here. What is the proper way of doing such a problem? • I am not sure to understand your problem. Have you an angular variable, say $\theta_i$ and some linear predictor $z_i$? or also your predictor are angular? or what? – niandra82 Jul 30 '14 at 14:35
• Only targets are angular (as shown on the picture), predictors are numeric. – rep_ho Jul 30 '14 at 14:45
• See e.g. Pewsey et al. (2013), Circular Statistics in R & the R package circular. – Scortchi - Reinstate Monica Jul 30 '14 at 14:52

I suggest you to take a look at the book "Topics in circular statistics" of Jammalamadaka if you are interested in circular variable.

Suppose that your data come from a circular distribution $F()$, and you want to model the (circular) mean of the circular variable: what is generally used is: $$E(\theta) = 2\arctan(\boldsymbol{\beta}\mathbf{z}_i)$$ $\theta$ is the circular variable, $\boldsymbol{\beta}$ is the vector of regression coefficients and $\mathbf{z}_i$ are the linear covariates.

If you want a parallelism with the usual linear regression you can assume that $\theta_i \sim WN(\mu_i,\sigma^2)$, where $WN()$ indicates the wrapped normal distribution that is in some sense the Normal distribution on a circle. Then

$$\mu_i = 2\arctan(\boldsymbol{\beta}\mathbf{z}_i)$$ or equivalently

$$\theta_i = 2\arctan(\boldsymbol{\beta}\mathbf{z}_i) + \epsilon_i$$ where $\epsilon_i \sim WN(0, \sigma^2)$

This type of regression is implemented in the package $circular$ that the user Scortchi suggests

• Thank you, I still don't get some things. Is it possible to use linear regression and just transform angles to something (sines,cosines)? Or the whole regression should "build" differently? I don't want to do it in R, because I have all my other processing steps in python, that's why I am asking. – rep_ho Jul 31 '14 at 8:58
• Angles have no magnitude, if you transform it in something like sine, cosine or something similar, you introduce magnitude.. – niandra82 Jul 31 '14 at 9:15