creveu:
>> Then what's wrong with centering your initial values around the mean?
>>
>>
>>
>> Marc Marí Dell'Olmo
>> 04/01/2014 10:56 AM
>>
>> To
>> Boris Steipe ,
>> cc
>> jlu...@ria.buffalo.edu, "r-help@r-projec
-Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
> On Behalf Of Marc Marí Dell'Olmo
> Sent: 1. april 2014 16:57
> To: Boris Steipe
> Cc: r-help@r-project.org
> Subject: Re: [R] A vector of normal distributed values with a s
Here is one approach to generating a set (or in this case multiple
sets) of normals that sum to 0 (with a little round off error) and
works for an odd number of points:
v <- matrix(-1/8, 9, 9)
diag(v) <- 1
eigen(v)
x <- mvrnorm(100,mu=rep(0,9), Sigma=v, empirical=TRUE)
rowSums(x)
range(.Last.value
escreveu:
Then what's wrong with centering your initial values around the mean?
Marc Marí Dell'Olmo
04/01/2014 10:56 AM
To
Boris Steipe ,
cc
jlu...@ria.buffalo.edu, "r-help@r-project.org"
Subject
Re: [R] A vector of normal distributed values with a sum-to-zero
constraint
Then what's wrong with centering your initial values around the mean?
Marc Marí Dell'Olmo
04/01/2014 10:56 AM
To
Boris Steipe ,
cc
jlu...@ria.buffalo.edu, "r-help@r-project.org"
Subject
Re: [R] A vector of normal distributed values with a sum-to-zero
constraint
04/01/2014 09:29 AM
To
Marc Marí Dell'Olmo ,
cc
"r-help@r-project.org"
Subject
Re: [R] A vector of normal distributed values with a sum-to-zero
constraint
Make a copy with opposite sign. This is Normal, symmetric, but no longer random.
set.seed(112358)
x <- rno
Thus the solution is
>> > N <- 100
>> > x <- rnorm(N-1)
>> > x <- c(x, -sum(x))
>> > sum(x)
>> [1] -7.199102e-17
>>
>> >
>>
>>
>>
>>
>>
>>
>>
>>
>> Boris Stei
>
>
>
>
>
>
>
>
> Boris Steipe
> Sent by: r-help-boun...@r-project.org
> 04/01/2014 09:29 AM
>
> To
> Marc Marí Dell'Olmo ,
> cc
> "r-help@r-project.org"
> Subject
> Re: [R] A vector of normal distributed values with a
ect.org
04/01/2014 09:29 AM
To
Marc Marí Dell'Olmo ,
cc
"r-help@r-project.org"
Subject
Re: [R] A vector of normal distributed values with a sum-to-zero
constraint
Make a copy with opposite sign. This is Normal, symmetric, but no longer
random.
set.seed(112358)
x <- r
Make a copy with opposite sign. This is Normal, symmetric, but no longer random.
set.seed(112358)
x <- rnorm(5000, 0, 0.5)
x <- c(x, -x)
sum(x)
hist(x)
B.
On 2014-04-01, at 8:56 AM, Marc Marí Dell'Olmo wrote:
> Dear all,
>
> Anyone knows how to generate a vector of Normal distributed
You are on a fool's errand. Read FAQ 7.31.
---
Jeff NewmillerThe . . Go Live...
DCN:Basics: ##.#. ##.#. Live Go...
Live: OO#.. De
11 matches
Mail list logo