1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sveta [45]
4 years ago
5

Question 3 This questions requires you to examine computational differences for methods used to calculate sample variation. You

will implement three approaches. You should find that two of these approaches calculate the sample variation more accurately than the other approach. Note that the values provided in part a. coincide with a large mean and a small variance. This scenario can be particularly problematic computationally when calculating sample variance. a. Add code to H4_Q3 that declares an array of doubles named values initialized with the following: {100000000.6,99999999.8,100000002.8,99999998.5,100000001.3 }. b. Add code to H4_Q3 that determines the sample variance using the following equation: S = Pn−1 i=0 (xi − x¯) 2 n − 1 where x¯ = Pn−1 i=0 xi n . The individual xi values are given as {10,000.6, 9,999.8, 10,002.8, 9,998.5, 10,001.3 } so that n = 5 with x indexed as i = 0, . . . , 4. c. Add code to H4_Q3 that determines the sample variance using the following equation: 2 S =   Pn−1 i=0 x 2 i n − Pn−1 i=0 xi n !2   × n n − 1 with xi given in b. d. Add code to H4_Q3 that calculates the sample variance using the following method: Algorithm 1: Sample Variance Algorithm: Part d Result: Sample Variance: Sn−1 n−1 initialization: Set M0 = x0; S0 = 0 and i = 1; while i ≤ n − 1 do Mi = Mi−1 + xi−Mx−1 i+1 ; Si = Si−1 + (xk − Mk−1) ∗ (xk − Mk) end with xi given in b. This approach to calculating sample variance is known as the Welford method.
Mathematics
1 answer:
Licemer1 [7]4 years ago
8 0

Answer:

sigma formulas are executed by using for loop to sum all the values.

public class H4_Q3{

public static void main(String[] args)

{

//Part a

double[] values = {100000000.6, 99999999.8, 100000002.8, 99999998.5, 100000001.3};

int n = values.length;

//Part b;

double sum = 0;

double sample_average = 0;

double sample_variance = 0;

int i = 0;

for(i = 0; i < n; i++)

{

sum = sum + values[i];

}

sample_average = sum/n;

for(i = 0; i < n; i++)

{

sample_variance = sample_variance + (Math.sqrt(values[i]) - sample_average);

}

System.out.println("Sample variance (Part b formula): "+sample_variance);

//Part c

double sum_squared = 0;

double sum_values = sample_average;

for(i = 0; i < n; i++)

{

sum_squared = sum_squared + Math.sqrt(values[i]);

}

sum_squared = sum_squared/n;

sample_variance = (sum_squared - Math.sqrt(sum_values)) * (n/ (n - 1));

System.out.println("Sample variance (Part c formula): "+sample_variance);

//Part d

sample_variance = 0;

double[] M = new double[n];

double[] S = new double[n];

M[0] = values[0];

S[0] = 0;

i = 1;

while(i < n)

{

M[i] = M[i-1] + ((values[i] - M[i-1])/i+1);

S[i] = S[i-1] + (values[i] - M[i-1]) * (values[i] - M[i]);

i++;

}

System.out.println("Sample variance (Part d formula): "+S[n-1]/n);

}

}

You might be interested in
15 is what percent of 40
Cloud [144]
15% of 40...
15% in decimal form is 0.15...

0.15(40)= 6

your answer is 6.
7 0
3 years ago
Read 2 more answers
A survey of 120 teachers determined the following:
son4ous [18]

Answer:

0%

Step-by-step explanation:

3 0
3 years ago
Help with this please.
spin [16.1K]
The answer would be because
7 0
3 years ago
Use the set of ordered pairs to determine whether the relation is a one-to-one function. {(−6,21),(−23,21),(−12,9),(−24,−10),(−2
GenaCL600 [577]

Answer:

the relation is not one-to-one.

Step-by-step explanation:

it can't because every number is in the 4th quadrant.  

5 0
3 years ago
What is the exact value of the expression the square root of 294. - the square root of 24. + the square root 54.? Simplify if po
dalvyx [7]
My solution to the problem is as follows:

sqrt(294) - sqrt(24) + sqrt(54) 
= sqrt(49 * 6) - sqrt(4 * 6) + sqrt(9 * 6) 
= sqrt(49)*sqrt(6) - sqrt(4)*sqrt(6) + sqrt(9)*sqrt(6) 
= 7*sqrt(6) - 2*sqrt(6) + 3*sqrt(6) 
= (7 - 2 + 3)*sqrt(6) 
= 8*sqrt(6) 
= sqrt(64)*sqrt(6) 
<span>= sqrt(384)

= 8*sqrt(6)

Therefore, the answer is letter B, 8 square root of 6
</span>
I hope my answer has come to your help. God bless and have a nice day ahead!
6 0
3 years ago
Other questions:
  • Let's compare the scientific notation representation of two of these numbers. 0.0000004 = 4.0 x 10 ⁻⁷ and 1,080,000,000 = 1.08 x
    10·1 answer
  • Let f: double-struck R4 → double-struck R and c(t): double-struck R → double-struck R4. Suppose ∇f(1, 1, π, e6) = (0, 1, 5, −2),
    5·1 answer
  • In a September 2019 survey of adults in the U.S., participants were asked if within the last 5 years, they knew of a friend or f
    7·1 answer
  • Should the minimum wage be increased?
    5·2 answers
  • For this week only, you can buy a Dell for $2988, including taxes. Included in the offer is a finance option for 4 years at an a
    6·1 answer
  • Produce Price per Pound
    8·2 answers
  • Serenity picked 75% of the apples of a tree in her backyard. If she picked 30 apples, how many apples were on the tree to begin
    7·1 answer
  • Why do all of my questions get ignored
    13·1 answer
  • Marselie worked 30 hours last week. She received a $300 bonus as part
    11·1 answer
  • Which fraction is equivalent to negative 1 over 6 ? (1 point) 6 over negative 1 negative 6 over 1 negative 6 over negative 1 1 o
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!