R Combat Series Column
Rnorm Normal distribution (the normal distribution) function
The function Rnorm of the whole distribution function is declared as follows:
Rnorm (n, mean = 0, SD = 1)
N: Produce random number of numbers
Mean: Expectation
SD: Is Variance
Produces 1000 random numbers, obeys the standard normal distribution
> rnorm (1000)
[1] -1.236751e+00 3.366310e-02-1.118280e+00 2.248415e-01 1.036253e+00
[6]- 4.981205e-01 1.417859e+00 7.423066e-01-1.649157e+00 4.752631e-02
[one] 2.947828e-01- 1.693057e+00 3.417998e-01 8.506275e-01 2.413585e-01
[1.205450e-01-1.098822e+00] - 1.944444e-01 1.247038e+00-2.301569e+00
[2.241360e-01] 1.447203e+00 1.045240e+00 8.210854e-01-1.949543e+00
Draw out these 1000 numbers
> x<-rnorm (1000)
> plot (seq (length (x)), X)
To draw a functional image of a standard global distribution
> X<-rnorm (3000) #生成3000个数字, conforms to the standard is too distributed
> Curve (dnorm (x), from=-5,to=5) #dnorm输入x求出其正太分布函数, curve draw the function interval [ -5,5] image on