logo

Analysis of Temperature and Humidity Data for Melbourne in 2017

11 Pages1746 Words454 Views
   

Added on  2023-06-04

About This Document

The analysis includes the use of MATLAB to generate random temperature and humidity data, fitting normal distribution curves, and calculating parameters. Linear regression and interpolation techniques are used to predict the maximum temperature on 29th October 2017. The data is collected from the Bureau of Meteorology and Timeanddate.com.

Analysis of Temperature and Humidity Data for Melbourne in 2017

   Added on 2023-06-04

ShareRelated Documents
Question 4:
In this question the random seed for generating the random 3 pm temperatures and the 9 am
temperatures are taken as seed = 0.7558.
Now, the minimum temperature in July at 3 pm as obtained from the Bureau of Meteorology
is 20.9 °C and maximum temperature is 24.9 °C. Also, the average humidity at July at 9 am is
71% (Timeanddate.com 2018).
MATLAB code:
s = 0.7558;
rng(s);
T3 = (24.9-20.9).*rand(10,1) + 20.9
T3 =
21.5305
24.7824
24.7287
22.8415
24.1011
21.4675
22.5870
24.5629
24.0688
24.7380
Now, the first 10 values of humidity is generated by the following code.
rng(s)
>> phi9 = 71 + 2.*randn(10,1)
phi9 =
72.0753
74.6678
66.4823
72.7243
71.6375
68.3846
70.1328
71.6852
Analysis of Temperature and Humidity Data for Melbourne in 2017_1
78.1568
76.5389
Now, the sample mean and standard deviation for T3 and phi9 are calculated as follows.
mean(T3)
ans =
23.5408
std(T3)
ans =
1.3234
mean(phi9)
ans =
72.2486
std(phi9)
ans =
3.5398
Now, the similar process is followed to generate the first 20 data values for T3 and phi9.
rng(s)
T3 = (24.9-20.9).*rand(20,1) + 20.9
rng(s)
phi9 = 71 + 2.*randn(20,1)
Now, the parameters of the two variables are calculated as follows.
mean(phi9)
ans =
72.3292
std(phi9)
ans =
2.9594
Now, normal distributed is fitted with phi9 which is shown by the histogram of the data along
with the normally fitted line.
histfit(phi9)
Analysis of Temperature and Humidity Data for Melbourne in 2017_2
62 64 66 68 70 72 74 76 78 80 82
0
1
2
3
4
5
6
7
Similarly, the variable T3 is also fitted with normal distribution and the parameters are shown
below (In.mathworks.com 2018).
Normal distribution
mu = 23.4681 [22.8505, 24.0858]
sigma = 1.31973 [1.00364, 1.92756]
The 95% confidence levels are shown in the brackets.
Analysis of Temperature and Humidity Data for Melbourne in 2017_3
19 20 21 22 23 24 25 26 27 28
0
1
2
3
4
5
6
7
8
Clearly, the temperature data T3 do not follow the normal distribution. Hence, normal curve
is not a good fit for this data.
Now, the temperature for 12 months or 365 days at 3 pm (between 13.0 to 24.9 degree
celcious) and humidity for 365 days at 9 am (between) is generated as follows.
rng(s)
phi9 = 71 + 2.*randn(365,1);
rng(s)
T3 = (24.9-13).*rand(365,1) + 13;
Now, the normal curve is fitted with the histogram of the data as given below.
Fitting of phi9:
Histfit(phi9)
Analysis of Temperature and Humidity Data for Melbourne in 2017_4

End of preview

Want to access all the pages? Upload your documents or become a member.