3
$\begingroup$

I am looking to predict the suitability of weather conditions (a rating out of 10) for an outdoor activity. My plan was to use linear regression with features such as maximum temperature, chance of rain etc. My problem is that I need to make the model account for the time of the year, for example an almost perfect winter day (rated 10) would probably only be a mediocre summer day (rated 5/6).

My idea is to introduce a function that is dependent on time. Hopefully this would also account for climate variations, for example, Country A may have a temperature difference of 40 degrees C from summer to winter whereas Country B may have a more consistent temperature year-round with a difference of only 5 degrees C.

The model would then have a formula like

$y_i = w_0 + w_1*x_{i1} + w_2*x_{i2} + ... + w_k*z_1(t)*x_{i1} + w_{k+1}*z_2(t)*x_{i2} + ...$

where we have the standard linear regression model plus terms which have a weight function $z$ that depends on time $t$ to account for variability of the features throughout the year. My thinking is that $z_i(t)$ would be approximately zero for all $t$ if the feature does not vary throughout year and would vary with $t$ if the feature varies with $t$.

Firstly, is this a (statistically) valid model?

Secondly, I'm struggling to think of the form of the function $z$. It can't be linear in $t$ as $t=1$ and $t=365$ probably have the same value if $t$ is the day of the year. Also different areas of the world have different times for peak weather. Obviously the seasons are reversed in the hemispheres, but also two places in the same hemisphere may have their dry or warm period (for example) at different times of the year. Maybe a sine or cosine function?

Thirdly, is there a completely different model that I should be using? i.e. this one is not appropriate.

$\endgroup$
1
  • $\begingroup$ Gaussian process regression seems appropriate. $\endgroup$
    – Emre
    Commented Dec 14, 2014 at 0:33

1 Answer 1

1
$\begingroup$

If I understand what you have in mind, I think this can be accomplished by interacting geography with pairs of $\cos(2 \pi \cdot j \cdot t)$ and $\sin(2 \pi \cdot j \cdot t)$ terms, where $j$ depends on time unit $t$. For example, with hourly data, $j=\frac{1}{24}$, and daily requires $j=\frac{1}{365}$ This can deal with smoothly varying seasonality. It will not handle abrupt events, like the joy of fireworks on the fourth of July, which can best be handled with dummies.

$\endgroup$
1
  • $\begingroup$ I have now changed my model but this was along the lines of my thinking and I think is correct approach. $\endgroup$
    – mattdevlin
    Commented Dec 16, 2014 at 4:34

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.