Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this r programming i want the full code and answer please 53 - ## Question 2 [2 pts] 54 55 Write a R code that

this r programming i want the full code and answer please image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
53 - ## Question 2 [2 pts] 54 55 Write a R code that creates the truth table of the logical function 56 57 $$!(a I b)$$ >> !(alb) 58 59 (This formula means not(a or b), where a and b are logical variables that can takes 2 values. T or F). I 60 61 - "*'{r} 62 a=NA # replace NA by a vector of 4 logical values 63 b=NA # replace NA by a vector of 4 logical values lan R Markdown CA AIA ARAMA 1 Run A 61 {r} 62 =NA # replace NA by a vector of 4 logical values 63 b=NA # replace NA by a vector of 4 logical values 64 M-NA # replace NA by a column bind of a, b and your logical function 65 # now add a line of code to print M: 66 - 67 I 68 69 - ## Question 3 [5 pts] 70 71 The probability density function of a gamma distribution with 72 shape parameter k and scale parameter theta is the function given by the following formula: 73 74 $$ y=f(xlk, \theta)=\frac{\Gamma(k)}{\theta-k}x^{k-1}^{-x\theta}$$ A r(k) 1.1 - 1 Nur 74 $$ y=f(xlk, \theta)=\frac{\Gamma(k)}{\thetak}x^{k-1}e^{-x\theta}$$ y=f(xk, ) = ok 75 Write a R code to calculate this function for X-3 when kis 2 and theta is 2. 76 Use the variable name y to store the result of your computation and print y. 77 78 You will need to use the exponential function and the gamma function, which are both available in R. 79 80 For example Se138 and $\gamma(5)$ can be calculated like this in R: 81 82 - *{r} I 83 exn(3) R Markdown GO1 Question 2 12 ntsl NUE 84 .. gamma(5) 85 86 87 88 - {r} 89 X-3 90 k2 91 theta-2 92 y=NA # replace this by the correct formula using correct functions 93 y # print the y value Z 94 - 95 96 To check that your calculation is right, you can execute this cell of code and you should find the same result as y: 97 98 99 {r} dgamma(x,k, scale-theta)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions