Question

In r make a simulation to verify the following theorem: if X1 ∼ χ2n1 , X2...

In r make a simulation to verify the following theorem: if X1 ∼ χ2n1 , X2 ∼ χ 2n2 , and X1 and X2 are independent, then X1 + X2 ∼ χ 2n1+n2 .

Please provide appropriate code for this problem.

Homework Answers

Answer #1

You can use the code below:

CODE:

check = function(n1,n2,df1,df2){
x1 = rchisq(n1,2*df1)
x2 = rchisq(n2,2*df2)
y = x1+x2
library(e1071)
probplot(y,"qchisq",df = 2*(df1+df2))
}
check(2000,2000,10,20)

The above code will create the probability plot to visualize whether x1+x2 follows the required distribution.

You can see the plots for X1+X2 are falls on the straight lines in the graph, which indicates that they follow the chi-square distribution with df 2(n1 + n2).

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Suppose R: |R^2 -> |R^2 is the linear transformation: R( x1 , x2) = (x2 ,...
Suppose R: |R^2 -> |R^2 is the linear transformation: R( x1 , x2) = (x2 , x1) a) Give a geometric description of R. b) Compute the matrix of R relative to te standard basis of |R^2 c) Let v1 = (1, 1) and v2 = (1, -1) Verify that B = (v1, v2) is a basis for |R^2, and compute the matrix of R relative to the basis B, i.e [R]B
Consider the following linear programming optimization problem: min z = x1 - x2 + x3 x1...
Consider the following linear programming optimization problem: min z = x1 - x2 + x3 x1 + 2x2 - x3 ≤ 3 - x1 + x2 + x3 ≥ 2 x1 - x2 = 10 x1 ≥ 0, x2 ≥ 0 Convert the problem into a standard maximum problem and then write its dual form. Please write the answer clearly and legibly
Use either R or Excel for the following. Provide the formulas or code that you are...
Use either R or Excel for the following. Provide the formulas or code that you are using. Let x1 be a random variable that is N(100, 225). Let x2 be a random variable that is U(50,150) and let x3 be a random variable that is U(500,1500). Set Y = (X1)(X2)/ (X3) a) Use R to create 500 random numbers of each type (X1, X2, X3 and Y). b) Estimate P(0.1 < Y < 0.25) c) Estimate E(Y) and the Standard...
Let X = (X1, X2) T be a two-dim random vector, and (R, Θ) be its...
Let X = (X1, X2) T be a two-dim random vector, and (R, Θ) be its polar coordinates, i.e. X1 = R cos(Θ) and X2 = R sin(Θ). Show that X is spherically symmetric if and only if R and Θ are independent, and Θ ∼Uniform(0, 2π).
Complete the following fact. Suppose X,Y are independent RVs and x1 < x2 and y1 <...
Complete the following fact. Suppose X,Y are independent RVs and x1 < x2 and y1 < y2 are real numbers. Then P(x1 <_?_≤ x2, _?__ <Y≤y2)=P(x1<X≤ _?_ )(y1<+_?_ ≤y2). Please fill in question marks.
function [Ax,Ay,Az]=GravityAcc(M1,X1,Y1,Z1,X2,Y2,Z2) %We are calculating the acceleration for object 2 G=6.67408*1e-11; R=? Am=G*M1/(R^2); Ax=(X1-X2)/R*Am; Ay=(Y1-Y2)/R*Am; Az=(Z1-Z2)/R*Am;...
function [Ax,Ay,Az]=GravityAcc(M1,X1,Y1,Z1,X2,Y2,Z2) %We are calculating the acceleration for object 2 G=6.67408*1e-11; R=? Am=G*M1/(R^2); Ax=(X1-X2)/R*Am; Ay=(Y1-Y2)/R*Am; Az=(Z1-Z2)/R*Am; end What is R in this gravitational acceleration code?
Let x1, x2, ..., xk be linearly independent vectors in R n and let A be...
Let x1, x2, ..., xk be linearly independent vectors in R n and let A be a nonsingular n × n matrix. Define yi = Axi for i = 1, 2, ..., k. Show that y1, y2, ..., yk are linearly independent.
Consider the following linear programming problem Maximize $1 X1 + $3 X2 Subject To X1 +...
Consider the following linear programming problem Maximize $1 X1 + $3 X2 Subject To X1 + X2 ≤ 4 Constraint A X1 - X2 ≤ 1 Constraint B X1, X2 ≥ 0 Constraint C Note: Report two digits after the decimal point. Do NOT use thousands-separators (,) 1 - Which of the following is the correct standard maximization form for the above linear programming problem Answer CorrectNot Correct Answer CorrectNot Correct Answer CorrectNot Correct Answer CorrectNot Correct Z - X1...
Prove the following: Theorem. Let X be a set and {Xi ⊆ X : i ∈...
Prove the following: Theorem. Let X be a set and {Xi ⊆ X : i ∈ I} be a partition of X. Then R = { (x1, x2) ∈ X × X : ∃i ∈ I,(x1 ∈ Xi) ∧ (x2 ∈ Xi) } is an equivalence relation on X.
Consider the following problem.                         Maximize   Z = 2x1 - x2 + x3, subject to x1...
Consider the following problem.                         Maximize   Z = 2x1 - x2 + x3, subject to x1 - x2 + 3x3 ≤   4             2x1 + x2           ≤ 10             x1 - x2 -    x3 ≤   7 and       x1 ≥ 0,   x2 ≥ 0,    x3 ≥ 0. Use Excel Solver to solve this problem. Write out the augmented form of this problem by introducing slack variables. Work through the simplex method step by step in tabular form to solve the problem.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT