Polynomial regression in a circular data set

I'm working on a data set where I have a set of events per time of the day (in a 1h time slot). I made the sum of the events and plotted a bar as show below. In order to define an equation that could give me the chance chance of the event to happen according to the time of the day, I did a polynomial regression for each of the 3 data sets (Total, Streets and Streets+GIS). As the time of the day is a cycle, I'd like to see the regression connecting the data point at the end of the graph (23h) to the beginning of it (0h). That is, I would like to run a regression analysis and find the parameters that best fit for my data but without losing the continuity of the time of the day.

I've searched for circular regression analysis, but so far didn't succeed in finding any appropriate material for a non-statistician who programs in python. Would someone mind giving me a hint about what can I do, or so good material from where I can learn how to make this sort of analysis?

• regress on sine and cosine (2 x pi x f x t/24) with f = [1,2,3,...] – seanv507 May 30 at 12:37
• See our posts on circular splines. – whuber May 30 at 13:08
• @seanv507 I will try it... thanks. – Eric Araújo May 30 at 14:59