# Number of parameters for AIC for a particular model

I know there have been a few well answered questions on this topic, but i have found myself in a bit of a special case this time.

I am using AIC for model selection, and i am having trouble counting the number of parameters. Our project involves a multilinear regression with quite a few parameters, which we are trying to cut down. We are doing it on magnetometer data for a particular location on the earth's surface. We have many years worth of 1 minute cadence time series data, for both the predictor and response variables. Based on a-priori reasons and previous studies, we are making multiple different models for varying times of day.

It might appear odd at first, but the different times of day correspond to different orientations of the station with respect to the sun, and we know that the response of the data to the predictor variables is very different for different times of day. We also have multiple different locations that we are trying to model. So there will be a different model for each station. All the stations use roughly the same predictor data, though there are some differences as some stations have missing data etc.

So i have p different stations, each with q different models, each of which has r different parameters. So in my 'global' model, I have p*q models, for a total of p*q*r parameters.I am trying to get a measure of AIC which measures the performance across all the stations and the whole data set. I want this so i can compare between the global models produced when I vary the number of input parameters, r.

What I'm wondering, is do i calculate an AIC by doing this:

AIC=n*ln(RSS across ALL stations & times/n) + 2*p*q*r

Or do i need a different AIC for each station, or even a different AIC for each station and time interval, giving a total of p*q AIC measurements for each global model? Or is this simply a fools errand? Obviously I'd like the 1st option best, but a different AIC for each station would still be manageable

Any help would be greatly appreciated, and if I've left out anything just let me know