Impose daily variability on monthly meteorological data
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
dpb
2015-2-11
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???
回答(1 个)
dpb
2015-2-12
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...
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Climate Science and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!