Skip to content

R help

4 messages · Shutnik, Spencer Graves, Peter Dalgaard +1 more

#
No solution exists, because the mean of a sum of n random variables 
each with mean mu is n*mu, which is different from mu if n > 1.

	  Beyond this, it is not clear to me what you want, but the following 
might help, if my understanding of your problem is close to correct:

y <- rnorm(1)
n <- 3
x <- rnorm(n)/sqrt(3)
x <- y*x/sum(x)
x; sum(x); y

hth.  spencer graves
Shutnik wrote:
#
Shutnik <shutnik_xx at yahoo.co.uk> writes:
+ x(t,n)
This should work, provided I understand the problem correctly:

x <- rnorm(n,sd=sqrt(sigma.sq/n))
x <- x - mean(x) + y/n
#
On Tue, 29 Apr 2003 20:54:25 +0100 (BST), you wrote in message
<20030429195425.18439.qmail at web10904.mail.yahoo.com>:
+ x(t,n)
Work out the joint distribution of the x's conditional on y, then
sample from that.  This sort of calculation appears in lots of places,
e.g. Searle (1971), Linear Models, p. 47.

Duncan Murdoch