MonteCarlo | R Documentation |
This function implements Monte Carlo integration with n
steps,
estimating the area of a function, f
, under the unit square.
With sample_y = TRUE
, the default, the method in the text is used.
With sample_y = FALSE
, the x points are sampled but f(x) is directly evaluated.
MonteCarlo(n, f = function(x) x^2, sample_y = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.