search for: xndnorm

Displaying 1 result from an estimated 1 matches for "xndnorm".

Did you mean: x1dnorm
2009 Dec 15
1
Help in R
...in term of calculating the sum below. Is there a function in R that can help doing it faster? x1, x2, ...xn where xi can be 0 or 1. I want to calculate the following: sum{ beta[a+sum(xi), b+n-sum(xi) ]* [ (1-x1)dnorm(0,1)+x1dnorm(2,1) ]* [ (1-x2)dnorm(0,1)+x2dnorm(2,1) ]* ...* [ (1-xn)dnorm(0,1)+xndnorm(2,1) ] } The sum in the beginning is over all 2^n possible values for the vector x1, x2, ...xn . Thank you very much! Hannah [[alternative HTML version deleted]]