Database Reference
In-Depth Information
distinct normal distributions with mean hf for females and hm for males
with the same standard deviation s . A joint density function for
f(height,gender) could be implemented as follows:
public static double dnormGender(double h,double
gender,
double hm ,double hf,double sig,double p) {
return Math. pow (p,gender==1 ? 1 : 0)
*Math. pow (1-p,gender==1 ? 0 : 1)
* dnorm (h, hm + (gender == 1 ? hf- hm : 0),sig);
}
Covariance and Correlation
The covariance of two random variables is a measure of how closely two (or
more) random variables “track” each other. So long as the second moment
(variance) of both random variables is defined, the covariance is simple
E[(X-E[X])×(Y-E[Y])]. This simplifies somewhat to the form usually seen in
textbooks: E[XY] - E[X]E[Y]. From this, it can be seen that the variance is
a measure of how well a variable tracks itself; substituting X for Y yields the
usual variance formula from earlier in the chapter.
Thecorrelationbetweentworandomvariablesisanormalizedversionofthe
covariance:
Thisensuresthatthecorrelationwillbebetween-1and1.Notethatalthough
independent random variables will have a covariance of 0, two variables
with a covariance of 0 are not necessarily independent.
Working with Distributions
Having made an assumption about the distribution that underlies some
observed data, it is possible to make an inference about the likely value of
one or more unknown parameters. It is also possible to make statements
about the range of likely values and, given estimates from two different sets
of observed data (perhaps from two different groups) whether or not those
estimates are likely to be truly different.
Search WWH ::




Custom Search