Data Science Using R
Data Science Using R
gamma (20, 10)
J) (2) 8.322375 is.661ses 10.s27896 18.807450 LD.sa2sE2 B.1E1262 126780455.
{8} 10.709388 11.s49666 11.256586 16,979900 10,419608 15,895826 10.052508
Hal 8.436457 10,269957 6.191293 9.510985 8.270894 14.367074
>
5 recom
Ttretums n random numbers from geomettie distribution.
‘resom(n, prob)
Heren indicates n indicates number of observations and prob indicates probability a success in each
ackages 5 Windover»
> set .seed(2)
>-egeames, 1/6)
6 rlnorm
Il generates random amounts with a multivariate lognormal distribution or density of this particular
distribution at some specific point.
~rinorm(n, meanlog, varlog) :
Here n indicates number of data sets that are to be simulated, meatilog indicates the mean-vector of |
logs and varlog indicates the variance/covariance matrix of the logs.
S$.
é 31
‘Scanned with Cam$cannerData Science Using R
Example
Ble bait Misc Packages: Windows Helo
> doe (ztasen(s))
1) 0.210731885 o.oesa9s6q7
16) -1.246783429 9,99815995 0.580872"
\ 122) =1.4508639¢5 9.3s0909791 ~9.47452602
26) -1.087292503 2,03G203603 -0.926989232 sae
2-763246020 o_zeez02760 ~2.252558924 -1. 29956975
riS08a8sE13 o_s275¢0097 -o.sassae57s -0.9FE37EALS -0.7205¢5
30291196 o.eT7B¢a42 0.452793: 76 earl
2-85600373¢ a ogess922 g.a7G¢03855 9278215449 -2/87790294
~O.B26s26142 Lloia7rog6a 891277732 0-742002772 9147573408
e O-425365565 o.isiesccan o.agi9ae754 9.225422912 -1. 010465085
-a,462689253 0.81083980 ~1.912248796
oo -0.216375791 -2.621957255
35402726:
7. logis
This function depicts information about logic distribution. Kt generates random devia
Hlogis(a, location0, seale=1)
ese minicates numberof observation, eeatonandscalehave0 and 13 Fm values nog
Example ;
}|> vax (=tagas (1000, 0, seals = 5))
8. rmvbin
ereates corretated multivariate binary random variables by thresholding a normal distributing
rvbin(n, bincor, margprob)
Here n indicates number of realization of variables that are to be simulated bincorr isa mains!
margprob indiestes the vector of some length,
Example
rmvbin( 10, margprob = C(03, 0.9))
«pois
Il generates values from poisson distribution and returns the results,
rpols(ob, rate = rate)
Here, ob indicates the number of observations and rate indicates estimated rate ef events for dss
32
‘Scanned with Cam$canner\> Statistical Modeling UMiie2
Example
It generates random compositions with uniform distribution.
if(9, win, max)
Here n indicates number of observations, min and max are by default 0 and | respectively.
Example as
[4] ~0.81133706 ~0.03129085 ~0.s7e