Abstract
It is remarkable that the normal distribution, described by the bell curve, or Gaussian function, is quite relevant to many situations that have very little in common with each other. Things like gambling winnings, people height or weight, blood pressure, standardized test scores or experimental measurement errors in the physics lab, are accurately modeled by normal distributions. All mathematical details about normal distributions are packaged in R, ready to use, through the four basic functions, available for all distributions in R. We have dnorm(), pnorm(), qnorm() and rnorm(), that help us with the density, cumulative density, quantile and random variate generation, respectively. Any normal distribution is completely defined by just two parameters: mean and sd (sd in R stands for "standard deviation"). If these parameters are given as positional arguments, in this order, or as keywords, to a *norm type function, then that function will operate on the normal distribution specified by that mean and standard deviation. Otherwise R operates on the default standard distribution that have the mean = 0 and sd = 1, with density given the function exp(−z 2 /2)/ √ 2π. dnorm() This function gives the density of probability for the normal distribution. This function is less useful than the corresponding function for discrete distributions, because the probability of obtaining an exact given value is zero. However, the ratio between the probability of getting a value within an interval and size of that interval has a well defined meaning when the intervals become smaller and smaller. This limit process defines the density of probability for any continous distribution, including the normal distribution. The function dnorm(x, m, s) is invoked with three arguments: x the value at which we need to know the density, 'm' the mean of the distribution and s the standard deviation. dnorm(2, 2.0, 1.0) == 1/sqrt(2*pi) ## [1] TRUE dnorm(1) == 1/sqrt(2*pi*exp(1)) ## [1] TRUE In the first example we obtain the density at 2, which is the same for the mean value, where the normal distribution has its maximum. In the second example, we get the density for x=1, when mean and sd have their default values. In both cases we compared the results with what we expect mathematically. Note that the use equality test operator == is not safe in general for comparing floating point numbers due to the limited representation of these numbers in a computer. A better way is to use the function …
Cite
CITATION STYLE
Correia, V. de P., Costa, D. da, Profumo, G. B., Costa, A. M. N. da, & Gomes, G. S. (2023). Impact and Opportunities of Conservation Agriculture on Food and Nutrition Security in Timor-Leste. In METHODOLOGY FOCUSED ON THE AREA OF INTERDISCIPLINARITY- V1. Seven Editora. https://doi.org/10.56238/methofocusinterv1-072
Register to see more suggestions
Mendeley helps you to discover research relevant for your work.