example5.mws

Example 5: Investigating the Properties of a Distribution

by Zavan Karian

> restart: with(plots, display, animate): libname:="C:/mylib/statistics",libname: with(stat):

> f := ChisquarePDF(nu, x);

f := x^(1/2*nu-1)*exp(-1/2*x)/(GAMMA(1/2*nu)*2^(1/2...

> assume(nu>0);

> simplify(int(f, x=0..infinity));

1

> mu := simplify(int(x*f, x=0..infinity));

mu := nu

> int(simplify(x^2*f), x=0..infinity) - mu^2;

2^(-1/2*nu)*(GAMMA(1/2*nu)*nu^2/((1/2)^(1/2*nu))+2*...

> var := simplify(%);

var := 2*nu

> animate(f, x=0..25, nu=1..15);

[Maple Plot]

> plot3d(f, x=0..10, nu=0..5, orientation=[135,45], color=blue, axes=boxed);

[Maple Plot]

> df := simplify(diff(f, x));

df := 2^(-1-1/2*nu)*x^(1/2*nu-2)*exp(-1/2*x)*(nu-2-...

> solve(df=0, x);

nu-2, 0