MATLAB: An Introduction with Applications
MATLAB: An Introduction with Applications
6th Edition
ISBN: 9781119256830
Author: Amos Gilat
Publisher: John Wiley & Sons Inc
Bartleby Related Questions Icon

Related questions

Question

Please provide a source code that can be copied into R programming. 

An example code is provided below, please use that as a reference. 

Using R, plot the gamma density function with parameters \( \alpha = 2.2 \), \( \beta = 1.3 \) on interval \( (0, 7) \).
expand button
Transcribed Image Text:Using R, plot the gamma density function with parameters \( \alpha = 2.2 \), \( \beta = 1.3 \) on interval \( (0, 7) \).
Using R-code we can plot the following gamma density function with parameters \((\alpha = 0.8, \beta = 0.5)\).

```r
x <- seq(0.01, 4, 0.01)
y <- dgamma(x, 0.8, 0.5)
plot(x, y, type = "l", col = "blue")
```

**Explanation:**

- `x <- seq(0.01, 4, 0.01)`: This line generates a sequence of numbers from 0.01 to 4, with an increment of 0.01.

- `y <- dgamma(x, 0.8, 0.5)`: This calculates the gamma density for each value in `x` using a shape parameter \(\alpha = 0.8\) and scale parameter \(\beta = 0.5\).

- `plot(x, y, type = "l", col = "blue")`: This command plots the gamma density function with a line type (`type = "l"`) and a blue color (`col = "blue"`).
expand button
Transcribed Image Text:Using R-code we can plot the following gamma density function with parameters \((\alpha = 0.8, \beta = 0.5)\). ```r x <- seq(0.01, 4, 0.01) y <- dgamma(x, 0.8, 0.5) plot(x, y, type = "l", col = "blue") ``` **Explanation:** - `x <- seq(0.01, 4, 0.01)`: This line generates a sequence of numbers from 0.01 to 4, with an increment of 0.01. - `y <- dgamma(x, 0.8, 0.5)`: This calculates the gamma density for each value in `x` using a shape parameter \(\alpha = 0.8\) and scale parameter \(\beta = 0.5\). - `plot(x, y, type = "l", col = "blue")`: This command plots the gamma density function with a line type (`type = "l"`) and a blue color (`col = "blue"`).
Expert Solution
Check Mark
Step 1

Gemma is continuous distribution.

Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
MATLAB: An Introduction with Applications
Statistics
ISBN:9781119256830
Author:Amos Gilat
Publisher:John Wiley & Sons Inc
Text book image
Probability and Statistics for Engineering and th...
Statistics
ISBN:9781305251809
Author:Jay L. Devore
Publisher:Cengage Learning
Text book image
Statistics for The Behavioral Sciences (MindTap C...
Statistics
ISBN:9781305504912
Author:Frederick J Gravetter, Larry B. Wallnau
Publisher:Cengage Learning
Text book image
Elementary Statistics: Picturing the World (7th E...
Statistics
ISBN:9780134683416
Author:Ron Larson, Betsy Farber
Publisher:PEARSON
Text book image
The Basic Practice of Statistics
Statistics
ISBN:9781319042578
Author:David S. Moore, William I. Notz, Michael A. Fligner
Publisher:W. H. Freeman
Text book image
Introduction to the Practice of Statistics
Statistics
ISBN:9781319013387
Author:David S. Moore, George P. McCabe, Bruce A. Craig
Publisher:W. H. Freeman