search for: normalmixem

Displaying 13 results from an estimated 13 matches for "normalmixem".

2007 Oct 15
1
how to use normalmixEM to get correct result?
Dear R-Users, I have a large number of data(54000) and the field of data is 50 to 2.0e9. I want to use normalmixEM (package:mixtools) to fit them in finite mixture narmal distributions,but get some mistakes.I don't know which steps make the error. I have used the following functions before >x<-read.table("data") >log.x<-log10(x$V1) >log.x<-sort(log.x) >outx = norma...
2013 Mar 31
0
Standard error of normalmixEM fit?
...rors of the estimates via the boot.se command of the mixtools package. My question is now, if the output is correct? It seems a bit odd to me, so is this correct what I am doing and can I rely on the values? My data: http://s000.tinyupload.com/?file_id=09285782882980618119 My code: normalmix<-normalmixEM(dat,k=2,lambda=c(0.99024,(1-0.99024)),fast=FALSE,maxit=10000,epsilon = 1e-16,maxrestarts=1000) normalmix$loglik normalmix$lambda se<-boot.se(normalmix,B=1000) se$lambda.se se$mu.se se$sigma.se final results: lambdahat = 0.990238663 mu1hat= -0.00115 mu2hat= 0.040176949 sigma...
2013 Apr 04
0
Std. error of normalmixEM with boot.se
...rors of the estimates via the boot.se command of the mixtools package. My question is now, if the output is correct? It seems a bit odd to me, so is this correct what I am doing and can I rely on the values? My data: http://s000.tinyupload.com/?file_id=09285782882980618119 My code: normalmix<-normalmixEM(dat,k=2,lambda=c(0.99024,(1-0.99024)),fast=FALSE,maxit=10000,epsilon = 1e-16,maxrestarts=1000) normalmix$loglik normalmix$lambda se<-boot.se(normalmix,B=1000) se$lambda.se se$mu.se se$sigma.se final results: lambdahat = 0.990238663 mu1hat= -0.00115 mu2hat= 0.040176949 sigma...
2013 Apr 04
0
Std. error normalmixEM using boot.se
...mates via the boot.se command of the mixtools package. My question is now, if the output is correct? It seems a bit odd to me, so is this correct what I am doing and can I rely on the values? My data can be found at: http://s000.tinyupload.com/?file_id=09285782882980618119 my code: normalmix<-normalmixEM(dat,k=2,lambda=c(0.99024,(1-0.99024)),fast=FALSE,maxit=10000,epsilon=1e-16,maxrestarts=1000) normalmix$loglik normalmix$lambda se<-boot.se(normalmix,B=1000) se$lambda.se se$mu.se se$sigma.se final results: labmdahat=0.99024 mu1hat=-0.00115 mu2hat=0.040177 sigma1hat=0.01222 sigma2hat=0.00325...
2013 Mar 30
1
normal mixture EM not working?
...currently working on fitting a mixture density to financial data. I have the following data: http://s000.tinyupload.com/?file_id=00083355432555420222 I want to fit a mixture density of two normal distributions. I have the formula: f(l)=πϕ(l;μ1,σ21)+(1−π)ϕ(l;μ2,σ22) my R code is: normalmix<-normalmixEM(dat,k=2,fast=TRUE) pi<-normalmix$lambda[1] mu1<-normalmix$mu[1] mu2<-normalmix$mu[2] sigma1<-normalmix$sigma[1] sigma2<-normalmix$sigma[2] Now I have the problem, that the output is not consistent, i.e. every time I run the code, I get different outputs! And they are very d...
2011 Oct 01
1
Fitting 3 beta distributions
Hi, I want to fit 3 beta distributions to my data which ranges between 0 and 1. What are the functions that I can easily call and specify that 3 beta distributions should be fitted? I have already looked at normalmixEM and fitdistr but they dont seem to be applicable (normalmixEM is only for fitting normal dist and fitdistr will only fit 1 distribution, not 3). Is that right? Also, my data has 26 million data points. What can I do to reduce the computation time with the suggested function? thanks a lot in advanc...
2013 Apr 09
0
[R-SIG-Finance] EM algorithm with R manually implemented?
...d to R-help because there's no obvious financial content. Michael On Sat, Apr 6, 2013 at 10:56 AM, Stat Tistician <statisticiangermany at gmail.com> wrote: > Hi, > I want to implement the EM algorithm manually, with my own loops and so. > Afterwards, I want to compare it to the normalmixEM output of mixtools > package. > > Since the notation is very advanced, I used LaTex and attached the two > screenshots I also attached the data. Alternatively, the data can be found > here:http://uploadeasy.net/upload/py6j4.rar and the screenshots here: > http://uploadeasy.net/upl...
2013 Mar 31
0
Skewness of fitted mixture not correct?
...here: http://uploadeasy.net/upload/32xzq.rar I look at the density with plot(density(dat),col="red",lwd=2) this has a skew of library(e1071) skewness(dat) -0.1284311 Now, I fit a gaussian mixture according to: f(l)=πϕ(l;μ1,σ21)+(1−π)ϕ(l;μ2,σ22) with: datnormalmixturegaussian<-normalmixEM(dat,lambda=c(0.3828,(1-0.3828)),k=2,fast=TRUE) save the values with: pi<-datnormalmixturegaussian$lambda[1] mu1<-datnormalmixturegaussian$mu[1] mu2<-datnormalmixturegaussian$mu[2] sigma1<-datnormalmixturegaussian$sigma[1] sigma2<-datnormalmixturegaussian$sigma[2] the values are: pi...
2008 Jul 16
2
Howto view function's source code of an installed package
Hi, Is there a way I can view the functions source code of a package I installed in my PC. For example I downloaded the great "mixtools" package. I want to see the source code of one of its function "normalmixEM" Is there a way to do it? Presumably from R command prompt? I tried to take a look at the zip file, but somehow I can't seem to find the file on which I can find the source code. Please advice. - Gundala Viswanath Jakarta - Indonesia
2013 Mar 18
2
Fit a mixture of lognormal and normal distributions
...;s a simulated example: x.1<-rnorm(6000, 2.4, 0.6)x.2<-rlnorm(10000, 1.3,0.1)X<-c(x.1, x.2) hist(X,100,freq=FALSE, ylim=c(0,1.5))lines(density(x.1), lty=2, lwd=2)lines(density(x.2), lty=2, lwd=2)lines(density(X), lty=4) Currently i am using mixtools and just run: library(mixtools)mixmdl = normalmixEM(X, k=2, epsilon = 1e-08, maxit = 1000, maxrestarts=20, verb = TRUE, fast=FALSE, ECM = FALSE, arbmean = TRUE, arbvar = TRUE) plot(mixmdl,which=2)lines(density(X), lty=2, lwd=2) This is obviously not the best way of doing this. The estimates it gives me are:mu 3.6595737(x.2 log()=1.29) 2.3113135(x.1)...
2007 Oct 03
1
FW: help with mclust
> No HTML this time. Sorry Dear all, I am attempting to model some one-dimensional data using Gaussian mixture model with mclust.? Generally, the data that I have have 3 overlapping populations (with one of them being the majority, and the other two combining to less than 15%) and for some reason, mclust consistently ignores the smaller peaks, giving me strange values for the means
2011 Jan 06
0
Set axis limits in mixtools plot
...7,-0.0681,-0.0716,-0.0732,-0.0736,-0.0740 ,-0.0750,-0.0760,-0.0758,-0.0732,-0.0677,-0.0603,-0.0531,-0.0481,-0.0459 ,-0.0448,-0.0421,-0.0364,-0.0285,-0.0219,-0.0202,-0.0245,-0.0321,-0.0386 ,-0.0399,-0.0352,-0.0272,-0.0206,-0.0187,-0.0220,-0.0280,-0.0330 ) library(mixtools) fit <- normalmixEM(test.data) plot(fit ,whichplots=2 # ,xlim2=c(-0.1, 0.15) # ,ylim2=c(0, 20) # ,xlim=c(-0.1, 0.15) # ,ylim=c(0, 20) ) grid()
2013 Mar 11
1
Distribution plus background fitting
Hi All, I apologise if this question has been answered before, but my background is a little different from most people using R, and the language we use seems to be different! I am trying to analyse some nuclear physics data, which consists of an ensemble of "energy" readings in a detector that, when binned, form a number of Gaussian shaped peaks superimposed on a varying background