PROB ASS (1)
PROB ASS (1)
Rxx(t1,t2)=E[A⋅t1⋅A⋅t2]
Explanation:
1. Set Parameters: Define the limits for the uniform distribution of AA,
the number of samples T, and the time vector t that ranges from 0 to
10.
4. Calculate the mean of X(t): Find the mean value of each column in
Xt (i.e., the mean across all realizations for each time point).
5. Plot Mean of X(t): Create a plot of meanX against t, with proper titles
and labels.
MATLAB Code:
% Parameters
% Calculate X(t) = A * t
figure;
plot(t, meanX);
xlabel('Time t');
ylabel('Mean of X(t)');
autocorr = corr(Xt');
figure;
imagesc(t, t, autocorr);
colorbar;
title('Autocorrelation of X(t)');
xlabel('Time t_1');
ylabel('Time t_2');
SIMULATION
Therefore
The mean of X(t) should vary linearly with t, as E[X(t)] = E[A] ⋅t, which
is not constant.
For a uniform distribution over (a, b), the mean and autocorrelation are fixed.
However, checking if a process is time-dependent requires ensuring that
these properties do not change with time.
Explanation:
1. Set Parameters:
2. Generate Random θ:
3. Calculate X(t)=cos(wt+θ)
4. Plot X(t):
o Create a plot with t on the x-axis and the computed X(t) on the y-
axis. Label the plot and axes accordingly.
o Compute the mean of X(t) across the samples (along rows for
each time value).
MATLAB Code:
% Parameters
for i = 1:num_samples
end
% Mean calculation
% Autocorrelation calculation
for i = 1:num_time_points
for j = 1:num_time_points
end
end
% Plotting Mean
figure;
subplot(1, 2, 1);
xlabel('Time (t)');
ylabel('Mean');
grid on;
% Plotting Autocorrelation
subplot(1, 2, 2);
imagesc(t, t, R_X);
colorbar;
title('Autocorrelation of X(t)');
xlabel('t_1');
ylabel('t_2');
grid on;
% Adjust layout
SIMULATION
Therefore
For a process X(t), to check if it's stationary, we typically compute the mean,
and autocorrelation over time. If any of these properties change with time,
the process is not stationary.
Explanation:
o Mean: Calculate the mean of X(t) for each time point (across all
realizations/samples).
o Subplot 1: Plot the mean of X(t) against t. Set the title and axis
labels accordingly.
o Subplot 2: Plot the variance of X(t) against t. Set the title and
axis labels accordingly.
MATLAB Code:
% Parameters% Parameters
A = 1; % Amplitude
% Initialize X(t)
for i = 1:num_samples
end
autocorr = corr(X_t);
% Plot results
figure;
% Mean plot
subplot(2, 1, 1);
plot(time_vector, mean_X);
title('Mean of X(t)');
xlabel('Time (s)');
ylabel('Mean');
grid on;
% Variance plot
subplot(2, 1, 2);
plot(autocorr);
title('AUTOCORRELATION of X(t)');
xlabel('Time (s)');
ylabel('autocorr');
grid on;
SIMULATION
Therefore
The process X(t) will have a mean and variance that changes with
time, indicating that the process is not stationary.
Explanation:
1. Set Parameters:
o Set the number of days to simulate for one year (365 days).
3. Plot Histogram:
o Set the plot's title and labels for the x and y axes.
4. Display Statistics:
MATLAB Code:
% Parameters
% Calculate statistics
mean_messages = mean(messages_received);
var_messages = var(messages_received);
% Display results
figure;
ylabel('Probability');
grid on;
x = 0:max(messages_received);
figure;
xlabel('Number of Messages');
ylabel('Probability');
grid on;
SIMULATION
Therefore