# Difference between revisions of "Group Two: The Towne Family - Again, Class Activity"

Line 1: | Line 1: | ||

<b> Class Activity </b> | <b> Class Activity </b> | ||

+ | Team: | ||

Todd Swinson | Todd Swinson | ||

+ | |||

Elad Liebman | Elad Liebman | ||

+ | |||

Shuqi | Shuqi | ||

+ | |||

+ | Eleisha Jackson | ||

1. Sketch the distribution <math> p_X(x)</math> | 1. Sketch the distribution <math> p_X(x)</math> |

## Revision as of 15:48, 24 February 2014

** Class Activity **
Team:
Todd Swinson

Elad Liebman

Shuqi

Eleisha Jackson

1. Sketch the distribution **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle p_X(x)}**

2. What is the distribution's mean and standard deviation? Mean:

**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \text{Mean} = E(x) }**

**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle E(x) = \int_0^2 xp(x) dx = \int_0^2 x\left(1 - \frac{x}{2}\right) dx = \frac{x^2}{2} - \frac{x^3}{6} \Big|_0^2 = \frac{2}{3}}**

Standard Deviation:

**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \text{Standard Deviation} = \sqrt{\text{Variance}} }**

**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \text{Variance} = \int_0^2 x^2p(x) dx - [E(x)]^2 = \left(\frac{x^3}{3} - \frac{x^4}{8}\right)\Big|_0^2 - [E(x)]^2 = \frac{6}{9} -\frac{4}{9} = \frac{2}{9} }**

**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \text{Standard Deviation} = \sqrt{\text{Variance}} = \sqrt{\frac{2}{9}}}**

3. What is its cumulative distribution function (CDF)?

CDF = F(x)

**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle F(x) = x(1-\frac{x}{4}) \text{ for } 0<x<2 \text{, 0 otherwise } }**

4. Write code or pseudocode for drawing random deviates from the distribution. (You may assume that you have a random generator for unifor (0,1).)

Code:

def getRandomDeviate(): p = random.random() return -2*sqrt(1-p) + 2 def testRandomDeviateGenerator(): curset = [] for i in range(100000): curset.append(getRandomDeviate()) figure() h = hist(curset, 1000) title('histogram of 100000 random deviates sampled for P_X(x)')

5. What is the approximate distribution of the sum S of N deviates drawn from **Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle p_X(x)}**
, where N >>1?
The sum of S of N deviates can be approximated by a Normal by the Central Limit Theorem

So....

**Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle p_S(.) \text{Normal}(\frac{2}{3}N, \frac{2}{9N} ) }**

6. You sum all 28, get a p-value for the sum under the null hypothesis which is the distribution from 5 with N = 28. You are basically computing a pvalue using the distribution form 5 as the null distribution