Please complete using R. Show all code needed to complete exercise. Will Thumbs up if done neatly and correctly.
REQUIRED R CODE
set.seed(100)
n<-5000
a<-0
ans<-c()
while(a<n)
{
sx<-sd(rexp(n = 10,rate = 2))
my<-median(rpois(n = 5,lambda = 3))
ans<-c(ans,sx/my)
a<-a+1
}
hist(x = ans,xlim = c(0,0.6),breaks = 200)
empirically standard deviation of x follows normal
also median of poisson follows normal so
this ration is ration of two normal distributions
and the histogram observed is negatively skewed
here the standard deviation of exp(2) is 0.5 and median of poisson(3) is 3 so this distribution in expected value is 0.5/3 i.e 1.666.
Please complete using R. Show all code needed to complete exercise. Will Thumbs up if done...
Using R, Exercise 4 (CLT Simulation) For this exercise we will simulate from the exponential distribution. If a random variable X has an exponential distribution with rate parameter A, the pdf of X can be written for z 2 0 Also recall, (a) This exercise relies heavily on generating random observations. To make this reproducible we will set a seed for the randomization. Alter the following code to make birthday store your birthday in the format yyyymmdd. For example, William...
Using MATLAB, not R codes, I repeat, please, not in R, just MATLAB codes, write the complete code for: 1. Assume Y is an exponential random variable with rate parameter λ=2. (1) Generate 1000 samples from this exponential distribution using inverse transform method (2) Compare the histogram of your samples with the true density of Y.
show me all work for the problem i,ii,iii Exercise 1 (Sample size for estimating the mean). Let X1,...,x, be i.i.d. samples from some un- known distribution of mean u. Let X and S denote the sample mean and sample variance. Fix a E (0,1) and € >0. (i) Suppose the population distribution is N(uo?) for known op > 0. Recall that we have the following 100(1 - a)% confidence interval for : (1) Deduce that plue (x-Zalze in 2+ zarze...
Solve d,e and f please using R code Part I: qqplots This part deals with qqplots of all kinds. Let's do some easy expe riments, first. Let's take a sample from a normal distribution with mu-2, sigma 3, and then look at the hist and the qqplot of that data: set.seed(3) n 100 # Sample size x norm(n,2,3) # Sample from N(mu-2, sigma-3) hist(x) # Looks normal. But that depends on breaks. qqnorm(x) # This doesn't depend on binsize, and...
# 3. The following code draws a sample of size $n=30$ from a chi-square distribution with 15 degrees of freedom, and then puts $B=200$ bootstrap samples into a matrix M. After that, the 'apply' function is used to calculate the median of each bootstrap sample, giving a bootstrap sample of 200 medians. "{r} set.seed (117888) data=rchisq(30,15) M=matrix(rep(0,30*200), byrow=T, ncol=30) for (i in 1:200 M[i,]=sample(data, 30, replace=T) bootstrapmedians=apply(M,1,median) (3a) Use the 'var' command to calculate the variance of the bootstrapped medians....
Please use R Part I: qqplots. This part deals with qaplots of al inds. Let's do some easy experiments, first. Let's take a sample from a normal distribution with mu-2, sigma -3, and then look at the hist and the qqplot of that data: set.seed(3) n 100 # Sample size # Sample from N(mu-2, sigma-3) # Looks normal. But that depends on breaks. x morm(n,2.3) hist(x) qqnorm(x) # This doesn't depend on binsize, and it looks linear. abline(2,3, col-2) What...
Please answer these questions and please show your code this assignment is all correlated so feel free to use whatever program you'd like. Thank you very much. This is a programming assignment. You can use any programming language you like You have to submit your computer codes along with the homework. 1. We will now have a look at computer simulations of continuous random variables. (a) Let X be a continuous random variable that is uniformly distributed on 0, 1]....
For this exercise we will run a regression using Swiss demographic data from around 1888. The sample is a cross-section of French speaking counties in Switzerland This data come with the R package datasets. The first step is to load the package into your current environment by typing the command libraryldatasets) in to the R console. This loads a number of datasets including one called swiss. Type help/swiss) in the console for additional details. The basic variable definitions are as...
In this exercise you will work with LU factorization of an matrix A. Theory: Any matrix A can be reduced to an echelon form by using only row replacement and row interchanging operations. Row interchanging is almost always necessary for a computer realization because it reduces the round off errors in calculations - this strategy in computer calculation is called partial pivoting, which refers to selecting for a pivot the largest by absolute value entry in a column. The MATLAB...