In: Statistics and Probability
Write a R script that calculates the mean and variance of two random variables
X~F(m=2,n=5) and Y~F(m=10,n=5) from their density functions.
X~ F(m,n)
mean(x) = ;n >2
var(x) = for n > 4
----------------------------------------------------------------------------------------------------------------------
We can calculate mean and variance using R software for that we need to generate random number from F distribution.
R-script
set.seed(1234)
#x ~f(m=2,n=5)
x=rf(1000,2,5) # Generate random sample from F(2,5)
mean(x)
var(x)
# x1~ f(m=10,n=5)
set.seed(12345)
x1=rf(10000,10,5) # Generate random sample from F(10,5)
mean(x1)
var(x1)
Output-
Answer -
If X ~ F(m=2,n=5)
then ,
mean= 1.6
var= 8.2
If X~F(m=10,n=5)
mean=1.6
var=4.8
Note : some variation may come in mean and variance because we have done calculation using random sample .
----------------------------------------------------------------------------------------------------------------------------------------------------
Dear student,
I am waiting for your feedback. I have given my 100% to solve your
queries. If you are satisfied by my given answer. Can you please
help me out by giving thumbs up.
Thank You!