Code covered by the BSD License  

Highlights from
cmsbounds

Be the first to rate this file! 1 Download (last 30 days) File Size: 3.09 KB File ID: #25115

cmsbounds

by Ben Petschel

 

24 Aug 2009

Determine bounds on a distribution given the first few moments

| Watch this File

File Information
Description

usage: [x,y]=cmsbounds(m)

Given a sequence M of the first 2*n raw moments of a distribution, CMSBOUNDS calculates arrays X and Y of length n and n+1 respectively such that Y(i) <= F(X(i)) <= Y(i+1) for any distribution F with the given moments M (Chebyshev-Markov-Stieltjes inequalities).

The raw moments are M(k) = E[X^k] = Integral of x^k dF(x).

Example: Normal distribution

mu=0;
sig=1;
n=20;
M(1)=mu;
M(2)=sig^2+mu^2;
for k=3:2*n
  M(k)=mu*M(k-1)+(k-1)*sig^2*M(k-2);
end;
[x,y] = cmsbounds(M) % returns 1x20 and 1x21 arrays
all(normcdf(x,mu,sig)<=y(2:end)) % true
all(normcdf(x,mu,sig)>=y(1:end-1)) % true

See the help file for further details of the theory and algorithm.

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
distribution bound Ben Petschel 24 Aug 2009 13:12:02
moment inequalities Ben Petschel 24 Aug 2009 13:12:02
chebyshevmarkovstieltjes Ben Petschel 24 Aug 2009 13:12:02

Contact us at files@mathworks.com