Impose daily variability on monthly meteorological data

Hello,
I have daily temperature and precipitation time series (see attached sample). I need to create a daily time series from this. To create realistic variation, I have the standard deviation of daily values (before they were originally processed) for each month of the year, so I would like to use the stdev to create a realistic daily series.
Any ideas? Thanks in advance

6 Comments

No data attached.
But, if were to assume days were independent of each other (and they're probably not given weather patterns)
doc randn
should give some ideas. More realistically, would need some way to have a model for what frequency of events and dynamic ranges of temperatures, etc., are realistic for the given locale. For instance, the likelihood of rain on a given day here in SW KS is far different from that in, say, Olympia, WA.
Apologies, data should be attached now. I'll try out randn and report back. For temp, a normal distribution around the mean tempo with the stdev constraining the variability is ok. For precip, however, a gamma distribution would be more appropriate but problem here is that my monthly timeseries is for total precip rather than mean precip...
dpb
dpb on 10 Feb 2015
Edited: dpb on 11 Feb 2015
WOW!!! Where on earth is this that has average temp's in August of 40F and a monthly precipitation of 40"??? We don't get that two years of average and in the current drought cycle it'll take three at least...
Anyways, if you must do something like this, best I can say would be to set an upper percentile of the gamma to the monthly maximums and set parameters on that. If there's any outside data on longer-term extremes that could use, that would likely help in getting a better estimate of upper bounds.
Haha, yes, it's at high altitude in the Himalayas so the monsoon months don't look particularly fun..!
That sounds reasonable for the gamma fitting, my next question is how to set the upper percentile of the gamma distribution and how to prevent it outputting negative values. I've had a look at 'randg' and 'gamrnd' but couldn't see what I'm looking for?
Cheers
A gamma is a positive-only distribution unless you introduce a shifting parameter so avoiding negatives should be automagic.
What information do you actually have regarding the variabilities within months from the original dataset? I didn't see anything but the totals(?) in the posted dataset???
That's the problem, all i have is the total monthly precip, no measure of variability so any fitted gamma distribution would be unrealistic but may be ok for intended purpose (testing a model until I can get some actual daily data, hopefully in a month or two).
Thanks

Sign in to comment.

Answers (1)

OK, w/o a lot of effort a first pass of the basic idea might be sotoo...
rain=importdata('rain.dat'); % the data file w/o the first section
rain=rain.data(:,4); % just keep the rainfall data alone by month
daymo=diff(datenum(1980,1:12*6+1,1,0,0,0)); % number days/month
r=rain./daymo; % average/day for each month
r=reshape(r,12,[]); % arrange by monthXyear
format bank % keep from scaling for viewing
[r mean(r,2) var(r,[],2)] % just looking at data to see what looks like
figure, plot(r), xlim([1 12])
OK, I learned the exponential with parameters eta and lambda where eta is the Matlab a and lambda --> 1/b
For gamma, the mean is eta/lambda and variance is mean/lambda or eta/lambda*2. Solving for those by month leads us by some simple algebra to
lamb=mean(r,2)./var(r,[],2);
eta=mean(r,2).*lamb;
x = gaminv((0.005:0.01:0.995),eta(1),1/lamb(1)); % for January range of x to cover distr
y = gampdf(x,eta(1),1/lamb(1)); % evaluate pdf
figure,plot(x,y) % see what looks like..
rgam=gamrnd(eta(1),1./lamb(1),31,1); % generate 31 random samples
OK, here's some results...
>> [min(rgam) max(rgam) mean(rgam) sum(rgam)]
ans =
0.30 1.92 0.85 26.45
>>
That's at least in the realm of reasonableness altho you'll likely need to do something to capture the real variability a little more on an annual basis...
The alternative is, as said, to decide what the extremes in your observed values might represent in terms of the realistic upper limits and use the cdf percentage points and back solve for parameters that match that and, say, the mean and see what that leads to.
You've got any number of possibilities given the lack of actual data structure...

Categories

Find more on Climate Science and Analysis in Help Center and File Exchange

Asked:

on 9 Feb 2015

Answered:

dpb
on 12 Feb 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!