Dear Friends,

I'm trying to see if there is some possibility that I can do the following
computations without a loop. I have attached a toy example below.

A <- c(1,2,3,4,5)
B <- rnorm(100)
store <- matrix(0,5,2)

for (i in 1:5)
{
  store[i,1] <- mean(pnorm(A[i]*B))
  store[i,2] <- var(pnorm(A[i]*B))
}
store

Thanks in advance for your help.

Kind Regards

Anup

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to