Learn R Programming

agricolae (version 1.2-0)

montecarlo: Random generation by Montecarlo

Description

Random generation form data, use function density and parameters

Usage

montecarlo(data, k, ...)

Arguments

data
vector or object(hist, graph.freq)
k
number of simulations
...
Other parameters of the function density, only if data is vector

Value

  • Generates random.

See Also

density

Examples

Run this code
library(agricolae)
r<-rnorm(50, 10,2)
montecarlo(r, k=100, kernel="epanechnikov")
# other example
h<-hist(r,plot=FALSE)
montecarlo(h, k=100)
# other example
breaks<-c(0, 150, 200, 250, 300)
counts<-c(10, 20, 40, 30)
h<-graph.freq(x=breaks,counts=counts,plot=FALSE)
montecarlo(h, k=100)

Run the code above in your browser using DataLab