1
$\begingroup$

I'm a newbie at stats/machine learning so please bare with me.

This plot is a result of an experiment that attempts to find the perceived angle of a stimulus.

enter image description here

The stimulus is placed at a position (see the X axis of the plot) and participants reply with the perceived angle (see the Y axis)--in other words, the question is "what direction do you think it's coming from?" Perceived angles therefore range from 0 to 360.

The plot shows this strange sinusoidal pattern about the best fit line (in blue). How would I go about capturing that wavy pattern in a regression? I would like to obtain an equation for perceived angle as a function of position.

A linear regression is not a bad approximation, but I would like to see if there's anything better. I also tried to do a regression with a few added polynomial terms, but I couldn't get a reasonable fit (perhaps I just messed up).

Thoughts/advice appreciated.

$\endgroup$
5
  • $\begingroup$ LOWESS wouldn't be a terrible choice. The R call is lowess. $\endgroup$
    – Sycorax
    Commented Jul 24, 2014 at 15:35
  • $\begingroup$ The circular linear regression is well studied in literature, if you like R you can use the circular package and the function lm.circular. $\endgroup$
    – niandra82
    Commented Jul 24, 2014 at 18:19
  • $\begingroup$ If the period is known, this is relatively simple; if it's unknown (leaving the period as another parameter) then it's a nonlinear problem. There's also periodic splines. $\endgroup$
    – Glen_b
    Commented Jul 25, 2014 at 4:35
  • $\begingroup$ @user777 lowess was a great suggestion and worked great, thanks. $\endgroup$
    – aleph_null
    Commented Jul 25, 2014 at 16:11
  • $\begingroup$ @niandra82 FWIW, I also (fruitlessly) searched for the answer that Glen_b linked to. Depending on your research goals, that answer might be better suited for your purposes. $\endgroup$
    – Sycorax
    Commented Jul 25, 2014 at 16:18

1 Answer 1

2
$\begingroup$

If a predictor is angular, it's clear how to do this; but that's not the case here. I think there is a power of suggestion going on here: because you have angular response values, you have trig on your mind. You do have some departure from linearity, but maybe it's not sinusoidal. If you plot the residuals instead of the data, it may not look as sinusoidal.

I thought maybe a transformation might help, but reconsidered since I don't think zero has any particular meaning here.

So maybe it's a good time to remember what George Box said -- all models are wrong, but some are useful. In your plot, it's clear that the straight-line model does in fact explain the lion's share of what is going on, and maybe you should just be happy with it. It's simple and easy to explain -- and that's worth something because the goal of statistics is to explain things.

If the polynomial fits don't work, maybe there is some kind of nonlinear model. But I can't think of a natural one here.

$\endgroup$
1
  • $\begingroup$ Great suggestions. I should have just called it "wavy" from the beginning instead of calling it sinusoidal the first time. I used lowess (thanks to a comment by user777) and will find the worst-case difference in predictions to evaluate if a linear model is good enough. Thanks. $\endgroup$
    – aleph_null
    Commented Jul 25, 2014 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.