[R] Mixture normal distribution

Brian D Ripley ripley at stats.ox.ac.uk
Wed Feb 8 14:28:39 CET 2006


We did get your previous message.  See the posting guide about what to do
if you do not get an answer.

See MASS4, chapter 16 (and see the FAQ for what MASS4 is) for fitting
mixtures of normals and testing their fit.

> I want to know how to read the data to txt file.

What does that mean?  (You 'read from' or 'write to'.)

On Wed, 8 Feb 2006 aleid2001 at yahoo.com wrote:

> Dear R helper,
>
>
> I hope that u can help me to sort out my problem
> because I sent an E-mail last night to R-list but I
> have not receive any help and at the same time I think
> this problem is not so hard.
>
> I have used the following functions before
>
> > K<-10
> > prime<-c(2,3,5,7,11,13,17)
> > UN<-seq(1:K)%*%t(sqrt(prime))
> > U1<-UN-as.integer(UN)
> > U<-matrix(qnorm(U1),K,7)
> > U
>
>             [,1]        [,2]        [,3]        [,4]
>      [,5]       [,6]
>  [1,] -0.2167193  0.61902728 -0.71900806  0.37387492
> -0.47715805  0.2677426
>  [2,]  0.9479680 -0.09010569 -0.06990169 -0.54900030
> 0.34047235 -0.8026015
>  [3,] -0.6978334 -0.85544499  0.54814530  1.53212280
> 1.64363675  0.9026864
>  [4,]  0.4038929  1.46253909  1.59168198  0.20958766
> -0.62343558 -0.1962555
>  [5,] -1.4678844  0.41315654 -0.91407055 -0.74294809
> 0.20989183 -1.9148412
>  [6,] -0.0369025 -0.27331681 -0.21109168  1.14796196
> 1.28012119  0.3406266
>  [7,]  1.2786790 -1.15348516  0.39201340  0.05080407
> -0.78449952 -0.7099779
>  [8,] -0.4853656  1.06431267  1.21882042 -0.97005119
> 0.08280907  1.0127500
>  [9,]  0.6065405  0.22357828 -1.15223725  0.88440727
> 1.03481830 -0.1257587
> [10,] -1.0707736 -0.46627852 -0.35664238 -0.10670096
> -0.96909898 -1.5936006
>              [,7]
>  [1,] -1.15960110
>  [2,] -0.68646092
>  [3,] -0.33366316
>  [4,] -0.01899511
>  [5,]  0.29375681
>  [6,]  0.63913903
>  [7,]  1.08816734
>  [8,]  2.16601566
>  [9,] -1.23750068
> [10,] -0.73537275
>
>
> Now I want instead of using (qnorm) the inverse of
> slandered normal distribution, I want to use the
> mixture of normal distribution, and also, I want to
> know how to read the data to txt file.
>
>
> Many thanks for your help in advance.
>
> Al-Eid
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list