Help with the modified Monte Carlo method

Hello, I made a graph with random data, but my tutor asked me to do the following and I don't really know how

"You must do ten thousand times the randomization (in the graphs that you showed us you only did one). And in each randomization you must obtain the mean of the matrix and save it. That way you end up with ten thousand means. Graphs the histogram of the ten thousand medias and that's it, this method is called montecarlo, but it is modified "

I leave you the script of my random and my histograms.
Thanks .

Random database script.
datos<- read.csv("BASENUTRCPP.csv", row.names = "Symbol", sep = ","
datosRandcpp <- apply(datos, MARGIN = 2, FUN=permute

Histogram script

HCPPRD1 <- hist(x = e$Peso.T,xlim = c(-1,+1), xlab = "Coeficiente de correlacion", ylab = "Frecuencia", main = "Histograma de Correlacion_miRNAs-Macros_CPP_Peso Total_RD", col = "red")

I think you need to give the iteration level 10,000. and save results of all iteration and in the last calculate the mean to plot hist plot.

Yeah, but how do I do it, I have no idea how to start, I'm new to this :frowning:
Could you guide me with some script?

It sounds like you need to repeatly sample the data for 10000 times, and only take the mean from each time, then draw a new histogram with all means. If you are using only one set of samples to draw this histogram, then it is indeed from only one iteration.

Hola , Realice una gráficas con datos random, pero mi tutor me pidió que hiciera lo siguiente y la verdad no se como :frowning: :frowning:

*"Debes hacer diez mil veces la aleatorizacion ( en las gráficas que nos mostraste solo hiciste una). Y en cada aleatorizacion debes obtener la media de la matriz y guardarla. De ese modo acabas con diez mil medias. *
Gráficas el histograma de las diez mil medias y ya, este metodo se llama montecarlo, pero es modificado"

Les dejo el scritpt de mis random y de mis histogramas.
De ante mano gracias :slight_smile:

Script random base de datos.

datos<- read.csv("BASENUTRCPP.csv", row.names = "Symbol", sep = ","
datosRandcpp <- apply(datos, MARGIN = 2, FUN=permute)

Script de histograma

HCPPRD1 <- hist(x = e$Peso.T,xlim = c(-1,+1), xlab = "Coeficiente de correlacion", ylab = "Frecuencia", main = "Histograma de Correlacion_miRNAs-Macros_CPP_Peso Total_RD", col = "red")