R Code
n=5000
f=function()
{
M=exp(-4.5)/(3*sqrt(2*pi)*(1-pnorm(3)))
y=numeric(n)
for(i in 1:n)
{
repeat
{
x=3+rexp(1,rate=3)
r=(dnorm(x)/(1-pnorm(3)))/(M*3*exp(-3*x+9))
u=runif(1,0,1)
if(u<=r) break
}
y[i]=x
}
return(y)
}
Really short question! Please help me to solve! It also needs the R code, thank you!...
Really short question! Also need the R code for implementing the bisection method. Thank you! (30%)Q1: Please use the bisection method to find all zero points of the following function, f(x)7.82 - 28.33 39.27
Really short question! Please help me to solve part(b), also need the R code, thank you! Problem 4 [26 points] (Section 2.4): Consider a one-sample z-test (known variance) with hypotheses: Ho: μ lo vs H, μ μο. a/2 where φ(.)Is the CDF of N(0,1), d-layo, and δ is the difference between the true mean and the mean under Ho (a) [10 points] Based on the fact that φ(x) [pdf of N(0,1)] is a decreasing function in x when x> 0,...
Really short question! Please help me to solve ONLY part(b) with R code. Thank you! Problem 4 [26 points] (Section 2.4): Consider a one-sample z-test (known variance) with hypotheses: Ho: μ lo vs H, μ *Ho. The probability of Type II error can be written in the form |ß D(%2_Jnd)-0(-%2_Jnd) where Φ㈠ is the CDF of N(0,1), d Isyo, and δ is the difference between the true mean and the mean under Ho (a) [10 points] Based on the fact...
Really short question! Please help me to solve, thank you! (30%)Q2 (Poisson regression): We collected n 15 independent count observations {Vi : 1,..., 15 and their corresponding covariates (i 1,..., 15). Assume the relationship between Vi and xỉ (for i-: 1, , 15) is yi ~ Poisson(A) and log(A) α+ßxi. Please 1) write down the likelihood function L(a, B|x, y) of the Poisson regression model; 2) derive the Newton method for maxmizing L(a, BIx, y); 3) implement the Newton method...
Really short question! Please help me to solve, thank you! Yet, the data set is too big (n=8000) as I can’t show all of them. Hope that the information of the second picture would be helpful. (30%)Q4 (EM algorithm): The heights of n 8000 students are drawn from a school. Assume the height largely depends on the gender. We denote the height of student i by Yi, and the gender of student i by Z..(Y; : 1 i n) are...
Really short question! Please help me to solve! THANK YOU! d 5 (10%): A ran' loin varialle Z follows the standar(Illinmal di trib"lion/ (0.1). Illol her Wards. the prolmbility deusity function of Z is . Plense (at) derive the probability density funetion of X İZl which we 'lem( te ly 1(r); (b) prove i hal f(r) . t ". 12 0: and (e) give al areqt-rjert alg rihun to sample fra N0. d 5 (10%): A ran' loin varialle Z...
Really short question! Please help me to solve, thank you! (10%)Q3 (Logistic regression): We collected n 15 independent binary observations : i- 1, , 15) and their corresponding covariates {xi : і = 1, , 15). Assume the relationship between yi and zi (for i = 1, , 15) is Vi ~ Bernoulli(p.) and logit(Pi)-α+82i, where logit(t) = log ti. Please 1) write down the likelihood function L(a, B|x, y) of the logistic regression model; 2) derive the Newton method...
Please help me with this question,I need definition , scratch work and proof,pls have a good handwriting. Thank you so much.... 1. Prove: If lim f (x) = L and C E R, then lim cf(x) = cL. xa x-a Definition. Scratch Work. Proof:
Really short question! Please help me to solve, thank you! 5. The following estimates have been made for an investment project: Initial investment: $450,000 Unit price: $40 Product life: 5 years Sales volumes (in units): ye Unit cost of a commodity: $20 Cost ofcapital: 790 year 2 year 3 year 4 year 5 3000 6000 7000 8000 7000 Calculate the sensitivity (i.e. maximum tolerable unfavorable change as a percentage of the original estimated value) in (a) sales price, (b) unit...
Please show all matlab code inputs if possible, please and thank you 3. Let x (n) = {1,-2,4,6, 5,8,10]. Generate and plot the samples of the following sequence (4 points) a) x1 (n) = 3x (n + 2) + x(n-4)-2x (n)