MATLAB Answers

Calculating mean integrated squared error (MISE)

20 ビュー (過去 30 日間)
Neuropragmatist 2020 年 8 月 21 日
回答済み: Deepak Meena 2020 年 8 月 26 日
Hi all,
I have a bivariate probability distribution ( f1(x) ) and a histogram of real data that I want to compare to it ( f2(x) ).
I can calculate integrated squared error fairly easily:
% both distributions (f1 and f2) are already normalised to integrate to 1
ISE = nansum( nansum( (f1-f2).^2 ) ) .* (dx*dy);
% the same could be achieved with trapz but I have NaN values in f2
Now I would like to calculate mean integrated squared error (MISE): as outlined in this paper (equations 8.2 and 8.3) I should find the expected value of ISE - how do I do that?
My first thought it to take the mean of ISE, but that is not possible because it is a single value. My next thought is to divide by the number of samples; i.e. divide ISE by numel(f1), is this correct?
I have hunted a long time and not really found a satisfactory answer to this.
Thanks for any help,

  1 件のコメント

Neuropragmatist 2020 年 8 月 21 日
An equation is also given here for MISE but again it's not really clear what the 'expected value' is - although it is clear the centre of the equation is ISE.


回答 (1 件)

Deepak Meena
Deepak Meena 2020 年 8 月 26 日
Hello Neuropragmatist,
From what I understood so far , you are misinterpreting the " Expected Value" . Expected value is similar to mean but we calculate the Expected value for Random Variables.
As In the Document you have shared It is given that ISE is a random variable which can take on multiple values with different probabilities depending upon the random sample
To calculate the Expected value of an Variable X:
where p(x) = probability density function.
For example:
  • Let { X represent the outcome of a roll of a fair six-sided dice. More specifically, X will be the number showing on the top face of the dice after the toss. The possible values for X are 1, 2, 3, 4, 5, and 6, all of which 1, 2, 3, 4 are equally likely with a probability of 1/6 but 5 comes with probability 3/12 and 6 comes with probability 1/12. The expectation of X is
which is not equal to
mean([1 2 3 4 5 6]) = 3.5
In your case X will be ISE , you need to find the values it can take and the probabililty assocted with it. So ISE should be a array not a single value .
To calculate MISE it should be like this
MISE = sum(ISE./P) % here P is probability values associated with each ISE value and ./ stand for element wise operations
to know more about the standard distrbutions and how their pdf is calculated refer to this document

  0 件のコメント


Community Treasure Hunt

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

Start Hunting!

Translated by