optimization algorithms or any algorithms

Dear ALL
Hopefully you are keeping fine..
I need your help.
I want to generate a normal random sequence with mu=0 and sigma=1, and pass these sequence by filter as following:-
X=randn(1,100000); % generate normal random sequence.
A=[a1 a2 a3]; % the coefficients of the filter.
Y= filter(1,A,X); %The sequence after passed on the filter.
NOW, I have my Data set called C, which is correlated normal random sequence.
SO, I need to adjust the coefficients of the filter ( A ) to give me the best value of y when RC=RY.
RC=xcorr(C,100); % the correlation coefficient of my data set C;
RY=xcorr(Y,100); % the desired correlation coefficient of Y;
*Could please to help me how can I find the best value of A which make RY is near to RC value, by any optimization algorithm. * Thanks in advance
RAYYAN

5 Comments

Matt J
Matt J on 28 Aug 2013
Edited: Matt J on 28 Aug 2013
How are you measuring "best"? How are you measuring "near"?
Thanks Matt for your response I will calculate the error for every one as the following
E=mean(abs(RC-RY)^2)
the smallest value of E means the best one for me..
Dear ALL This is the question in details.
I want to generate a normal random sequence with mu=0 and sigma=1, and pass these sequence by filter as following:-
X=randn(1,100000); % generate normal random sequence.
A=[a1 a2 a3]; % the coefficients of the filter.
Y= filter(1,A,X); %The sequence after passed on the filter.
And then I will find the correlation coefficient of the first 100 points as following:
RY=xcorr(Y,100); % the correlation coefficient of the first 100 points of Y;
NOW, I have my Data set called C, which is correlated normal random sequence. And I will find also the correlation coefficient of the first 100 points for it.
RC=xcorr(C,100); % the correlation coefficient of my data set C;
Finally I will calculate the error of the mean value of between RC and RY by using
R=abs(RC-RY) % take the absolute value of difference result
E=mean(R.*R) % find the mean of the R square
SO, I need to adjust the coefficients of the filter ( A ) which give me the smallest value of error ( E ).
Thanks in advance.. RAYYAN
Your purpose is to find the coefficients of a two (three?) pole filter that will best transform an uncorrelated normal distribution to match the correlated normal distribution C ?
Yes, exactly Mr.Walter
So, Could you please help me for that?

Sign in to comment.

 Accepted Answer

Matt J
Matt J on 29 Aug 2013
You can solve for A algebraically using the Yule Walker equations

1 Comment

Thanks Matt
I will check it, and let you know..

Sign in to comment.

More Answers (0)

Asked:

on 28 Aug 2013

Community Treasure Hunt

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

Start Hunting!