diff --git a/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/.RData b/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/.RData new file mode 100644 index 000000000..f679e8084 Binary files /dev/null and b/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/.RData differ diff --git a/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/.Rhistory b/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/.Rhistory new file mode 100644 index 000000000..b63e3ac4f --- /dev/null +++ b/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/.Rhistory @@ -0,0 +1,60 @@ +f = function(x) +{ +if(x>=0 & x <= 7) +{ +1/7 +} +else +{0} +} +f(0) +f(-1) +f(7) +f(8) +ibrary(distr6) +d = distr6::Uniform$new(lower = 0 , upper = 7) +#(i) +integrate(d$pdf, lower = -Inf , upper = Inf) +ibrary(distr6) +d = distr6::Uniform$new(lower = 0 , upper = 7) +#(i) +integrate(f, lower = -Inf , upper = Inf) +f = function(x) +{ +(x>=0 & x <= 7) * 1/7 +} +f(2) +f(8) +integrate(f, lower = -Inf , upper = Inf) +ibrary(distr6) +d = distr6::Uniform$new(lower = 0 , upper = 7) +#(i) +integrate(d$pdf, lower = -Inf , upper = Inf) +#(ii) +curve(f) +plot(f) +plot(d) +plot(f) +curve(f) +curve(f, from= 0, to= 7) +curve(f, from= -5, to= 10) +curve(f, from= -5, to= 12) +f = function(x) +{ +(x>=0 & x <= 7) * 1/7 +} +#(i) +integrate(f, lower = -Inf , upper = Inf) +#(ii) +curve(f, from= -5, to= 12) +#(iv) +library(distr6) +d = distr6::Uniform$new(lower = 0 , upper = 7) +d$mgf(t = 1) +x1 = c(12,11,8,14,10) +x2 = c(10,8,5,11,7) +x3= c(8,11,11,13,6) +m = matrix(c(x1,x2,x3), ncol = 3) +vector_means = c(mean(x1), mean(x2), mean(x3)) +vector_means +cov(m) diff --git a/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/960188_andreaierardi.docx b/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/960188_andreaierardi.docx new file mode 100644 index 000000000..cb2ff3d0b Binary files /dev/null and b/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/960188_andreaierardi.docx differ diff --git a/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/assignment1.R b/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/assignment1.R index 77ea42765..d7b4c17c2 100644 --- a/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/assignment1.R +++ b/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/assignment1.R @@ -4,19 +4,25 @@ #============= #Part.a) -library(distr6) -d = distr6::Uniform$new(lower = 0 , upper = 7) +f = function(x) +{ + (x>=0 & x <= 7) * 1/7 + +} + + #(i) -integrate(d$pdf, lower = -Inf , upper = Inf) +integrate(f, lower = -Inf , upper = Inf) #(ii) -curve(d) -plot(d) +curve(f, from= -5, to= 12) #(iii) #The random variable is X #(iv) +library(distr6) +d = distr6::Uniform$new(lower = 0 , upper = 7) d$mgf(t = 1) diff --git a/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/~$0188_andreaierardi.docx b/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/~$0188_andreaierardi.docx new file mode 100644 index 000000000..7e7563bb9 Binary files /dev/null and b/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/~$0188_andreaierardi.docx differ diff --git a/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/~WRL1845.tmp b/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/~WRL1845.tmp new file mode 100644 index 000000000..9f1558837 Binary files /dev/null and b/2year/1trimester/Advanced Multivariate Statistics/Assignment/assignment1/~WRL1845.tmp differ