I am summarizing the problem that I have:(adsbygoogle = window.adsbygoogle || []).push({});

Problem Description

Given a model with 5 states [0 0 0 0 3] and with probabilities (1/3, 1/5, 1/5, 1/5, 1/15) find the variance.

Solution

I think I am calculating it properly but I am getting a different answer than MATLAB.

Var = E(x^2) - E(x)^2

Calculate E(x^2)

P1X1^2 + P2X2^2 + P3X3^2 + P4X4^2 + P5X^2 =

1/3(0) + 1/5(0) + 1/5(0) + 1/5(0) + 1/15(9) = 9/15

Calculate E(x)^2

(P1X1 + P2X2 + P3X3 + P4X4 + P5X5)^2 =

(1/15(3))^2 = (3/15)^2 = 9/225

Therefore variance is 9/15 - 9/225 = 0.5600

However, MATLAB gives me 1.8.

Who is right?

Thanks

Asif

1. The problem statement, all variables and given/known data

2. Relevant equations

3. The attempt at a solution

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Calculating variance- matlab discrepancy

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

Loading...

Similar Threads for Calculating variance matlab |
---|

MATLAB MATLAB: forces acting on an object |

MATLAB Matlab histogram |

MATLAB Sovling Bernoulli's differential equation in matlab? |

MATLAB Matlab-like software |

**Physics Forums - The Fusion of Science and Community**