How to make the estimation error and average it correctly?

1 visualización (últimos 30 días)
gp
gp el 12 de Dic. de 2020
Editada: gp el 14 de Dic. de 2020
Is the code correct for the whole part especially the estimation error and average error part?

Respuesta aceptada

Paul Hoffrichter
Paul Hoffrichter el 12 de Dic. de 2020
for sd = 0:10:50
PN=Po+(sd.*gaussnoise);
end
In each iteration of this inner loop, PN is computed with a new sd value. But when this loop exits, the only value that PN has is the one that corresponds to sd = 50.
Is it your intent that each experiment have one random gaussnoise value, and then create errors for the 5 PN values corresponding to sd = [0 10 20 30 40 50]?
If so, then you have to move the end further down so that the different 5 different PN values are captured for your 5 tests per experiment.
  2 comentarios
gp
gp el 12 de Dic. de 2020
Yes, but even if i move to downwards it is still the same
Paul Hoffrichter
Paul Hoffrichter el 13 de Dic. de 2020
>> it is still the same
"it" does not compute.
I do not understand how you can have different values of sd which results in different values of PN and still have the same results. You should post your code and print out the results to show the problem.

Iniciar sesión para comentar.

Más respuestas (1)

KALYAN ACHARJYA
KALYAN ACHARJYA el 12 de Dic. de 2020
It seems the code considering the mean error for the last experiment iteration. You may same the E of all experiment and later get the error. Here E as array.
E=zeros(1,10); %preallocation
for experiment = 1:10
.......
E(experiment)=(errM).^2;
%....^
end
Em=mean(E);
disp(['Em=' num2str(Em)]);

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by