),2,function(x)
> c(Mean=mean(x),Var=var(x
>
>
> HTH,
>
> Jorge
>
>
>
> On Thu, Nov 20, 2008 at 10:09 PM, Anup Menon <[EMAIL PROTECTED]>wrote:
>
>> Dear Friends,
>>
>> I'm trying to see if there is some possibility that I can do the fol
Hi Ezhil,
Maybe this will help. There might be an easier way to do this but here is
one solution.
tril <- function(A)
{
A <- as.matrix(A)
cmats <- matrix(rep(1,length(A)),dim(A)[1],dim(A)[2])
upper.tri(cmats,diag=T)
cmats[upper.tri(cmats)] <- 0
out <- A*cmats
return(out)
}
tril(correlation
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]*
3 matches
Mail list logo