Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please fill the parts with % To be completed part: % Cooperative / Non cooperative clear all Na=2; % Number of agents Ncoef=4;

Please fill the parts with "% To be completed" part:

% Cooperative / Non cooperative

clear all Na=2; % Number of agents Ncoef=4; % Number of coefficients per agent Niter=1000; % Number of iterations N_rep=200; % Number of repetitions to average s2_v1=.032; % Variance of the first user s2_v2=.010; % Variance of the second user w0=randn(Ncoef,1);w0=w0/norm(w0); % Optimum regressor mu=0.005; % step-size error=zeros(1,Niter); % Average error non cooperative error_coop=zeros(1,Niter); % Average error cooperative

for kk=1:N_rep u1=randn(Ncoef,Niter); v1=sqrt(s2_v1)*randn(Niter,1); d1=u1'*w0+v1; % Data generation user 1 u2=randn(Ncoef,Niter); v2=sqrt(s2_v2)*randn(Niter,1); d2=u2'*w0+v2; % Data generation user 2 w1=zeros(Ncoef,Niter); % Coefficients agent 1 non cooperative w2=zeros(Ncoef,Niter); % Coefficients agent 2 non cooperative w1_coop=zeros(Ncoef,Niter); % Coefficients agent 1 cooperative w2_coop=zeros(Ncoef,Niter); % Coefficients agent 2 cooperative

for k=2:Niter w1_coop(:,k)=...; To be completed w2_coop(:,k)=...; To be completed w1(:,k)=...; To be completed w2(:,k)=...; To be completed error(k)=error(k)+mean([sum((w1(:,k)-w0).^2),sum((w2(:,k)-w0).^2)]); error_coop(k)=error_coop(k)+mean([sum((w1_coop(:,k)-w0).^2),sum((w2_coop(:,k)-w0).^2)]); end end

error=error/N_rep; % Averaging error_coop=error_coop/N_rep; % Averaging plot(1:Niter,10*log10(error),'b','LineWidth',3),hold plot(1:Niter,10*log10(error_coop),'r','LineWidth',3), plot(1:Niter,10*log10(mu*(s2_v1+s2_v2)/2*Ncoef)*ones(1,Niter),'--b','LineWidth',3) plot(1:Niter,10*log10(mu*(s2_v1+s2_v2)/4*Ncoef)*ones(1,Niter),'--r','LineWidth',3) grid hold off xlabel ('Iteration') ylabel ('MSE (dB)') title('Non-cooperative / Cooperative scenario') legend('Average error (non cooperative)', 'Average error (cooperative)')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions

Question

6. Ask if the authorizer wants progress reports.

Answered: 1 week ago