dgamma() Function
The dgamma() function is used to create a gamma density plot which is basically used due to exponential and normal distribution factors.
Syntax:
dgamma(x_dgamma, shape)
Parameters:
- x_dgamma: defines gamma function
- shape: gamma density of input values
- Returns: Plot dgamma values
Example :
R
# R program to plot gamma distribution # Specify x-values for gamma function x_dgamma <- seq (0, 2, by = 0.04) # Apply dgamma function y_dgamma <- dgamma (x_dgamma, shape = 6) # Plot dgamma values plot (y_dgamma) |
Output :
Gamma Distribution in R Programming – dgamma(), pgamma(), qgamma(), and rgamma() Functions
The Gamma distribution in R Programming Language is defined as a two-parameter family of continuous probability distributions which is used in exponential distribution, Erlang distribution, and chi-squared distribution. This article is about the implementation of functions of the gamma distribution.