Dear Sir,
I am working on Gaussian random Process, where I am stuck from few
days because of the following two difficulties.
1. I have different segments of Gaussian distributed random
sequences, of which two sequences among them are templates . I need
to find the joint pdf and thereby marginal pdf between a segment
and the templates. And thereby the probability of the segment being
the outcome of the given template process.
ie, I have data1 as the one data segment distributed Gaussian.
And data2 as the template.
The joint pdf of data1 and data2 is
P(x1,x2) = 1/(2*pi*std1*std2*sqrt(1-rho^2)) *Exp{ [-var2*(x1-m1)
^2 + 2*rho*std1*std2*(x1- m1)*(x2-m2) var1^2*
(x2-m2)^2]/(2*var1*var2*(1-rho^2)]}
Where
X1= First data segment
X2= second data segment
Std1= standard deviation of data1
Std2= standard deviation of data2
Var1=variance of data1
Var2= variance of data2
M1=mean of data1
M2=mean of data2
Rho = Covariance normalized by var1 and var2
The Matlab code is as follows
clear all;
close all;
clc;
data1=randn(1,200); %Defining gaussian random sequence data1
data2=randn(1,200); % defining gaussian random sequence data2
data3=randn(1,200); % defining gaussian random sequence data3
data1a1+0.6; % Changing the mean of data1 to 0.6
data2a2-0.8; % changing the mean of data2 to -0.8
data3a3+0.9; % changing the mean of data3 to 0.9
mean1=mean(data1); % Finding the mean of data1
mean2=mean(data2);% Finding the mean of data2
mean3=mean(data3);% Finding the mean of data3
mu12=mean((data1-mean1).*(data2-mean2)); % finding joint central
moment between data1 and data2
var1=var(data1); % Finding variance of data1
var2=var(data2); % Finding variance of data2
var3=var(data3);% Finding variance of data3
std1=sqrt(var1);% Finding standard deviation of data1
std2=sqrt(var2);% Finding standard deviation of data2
std3=sqrt(var3);% Finding standard deviation of data3
rho12=mu12/(std1*std2);% Finding normalised covariance between data1
and data2
for i=1:200,
for j=1:200,
prod1=var2*(data1(i)-mean1)^2; % Using the formula (1)
prod2=-2*rho12*std1*std2*(data1(i)-mean1)*(data2(j)-mean2);
% Using the formula (1)
prod3=var1*(data2(j)-mean2)^2; % Using the formula (1)
divid=2*var1*var2*(1-rho12^2); % Using the formula (1)
p(i,j)=1/(2*pi*std1*std2*sqrt(1-rho12^2))*exp(-
(prod1+prod2+prod3)/divid);% Finding joint pdf
end
end
p1=sum(p,1); % Finding marginal pdf
p2=sum(p,2);% Finding marginal pdf
plot(1:200,p1);% Plotting marginal pdf
plot(1:200,p2);% Plotting marginal pdf
--------------------
But in the plot I am not getting the Bell shape curve.
2. I have got the probability value associated with the random
sequence being the outcome of another random process. I need to get
the covariance and the mean of this second random process.
Can you please tell me how it is,
Also can you please tell me which book I can refer to get such
practical knowledge in probability.
With regards,
ROSHAN JOY MARTIS
1st Year M Tech
DEAC
MIT- manipal