Displaying 20 results from an estimated 300 matches similar to: "Skewness of fitted mixture not correct?"
2013 Apr 09
0
[R-SIG-Finance] EM algorithm with R manually implemented?
Moved 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
2013 Mar 30
1
normal mixture EM not working?
Hi,
I am 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]
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)
2006 Sep 28
1
Nonlinear fitting - reparametrization help
Hi,
I am trying to fit a function of the form:
y = A0 + A1 * exp( -0.5* ( (X - Mu1) / Sigma1 )^2 ) - A2 * exp ( -0.5*
( (X-Mu2)/Sigma2 )^2 )
i.e. a mean term (A0) + a difference between two gaussians.
The constraints are A1,A2 >0, Sigma1,Sigma2>0, and usually Sigma2>Sigma1.
The plot looks like a "Mexican Hat".
I had trouble (poor fits) fitting this function to toy data
2010 Jul 18
2
loop troubles
Hi all, I appreciate the help this list has given me before. I have a
question which has been perplexing me. I have been working on doing a
Bayesian calculating inserting studies sequentially after using a
non-informative prior to get a meta-analysis type result. I created a
function using three iterations of this, my code is below. I insert prior
mean and precision (I add precision manually
2007 Aug 29
3
OT: distribution of a pathological random variate
Folks,
I wonder if anything could be said about the distribution of a random variate x, where
x = N(0,1)/N(0,1)
Obviously x is pathological because it could be 0/0. If we exclude this point, so the set is {x/(0/0)}, does x have a well defined distribution? or does it exist a distribution that approximates x.
(The case could be generalized of course to N(mu1, sigma1)/N(mu2, sigma2) and one
2008 Oct 30
0
a nlm() question
Dear R listers,
I have a very annoying problem using nlm().
I want to find the minimizer of my target function, if written in
\LaTeX is
f(\mu1,\mu2,\sigma1,\sigma2) = \sum_i^n( w_ig_t(z_i) ), where
g_t(z) is a pdf of bivariate normal distribution and z_i is my samples.
I cannot get the estimation result generated by nlm(), and I got
the following errors
"
Error in
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
2008 Nov 11
1
simulate data with binary outcome and correlated predictors
Hi,
I would like to simulate data with a binary outcome and a set of predictors that are correlated. I want to be able to fix the number of event (Y=1) vs. non-event (Y=0). Thus, I fix this and then simulate the predictors. I have 2 questions:
1. When the predictors are continuous, I can use mvrnorm(). However, if I have continuous, ordinal and binary predictors, I'm not sure how to simulate
2007 May 08
0
Question on bivariate GEE fit
Hi,
I have a bivariate longitudinal dataset. As an example say,
i have the data frame with column names
var1 var2 Unit time trt
(trt represents the treatment)
Now suppose I want to fit a joint model of the form for the *i* th unit
var1jk = alpha1 + beta1*timejk + gamma1* trtjk + delta1* timejk:trtjk +
error1jk
var2 = alpha2 + beta2*timejk + gamma2* trtjk + delta2* timejk:trtjk +
2008 Jul 03
0
Random effects and lme4
I'm running some multi-level binomial models with lme4 and have a question
regarding the estimated random effects.
Suppose I have nested data e.g. clinic and then patient within clinic. The
standard deviations of the random effects at each level are roughly equal in
a model for real life data. Attention then turns to examining the individual
random effects at each level. I'm extracting
2013 Apr 22
0
Copula fitMdvc:
Hello,
I am trying to do a fit a loglikelihood function with Multivariate
distribution via copulas with fitMdvc. The problem is that it
doesn't recognize that my beta is a vector of km parameter and when I try
to run it it say that the length of my initial values is not the same as
the parameter.
Can somebody guide me where my mistake is.
Thanks,
Elisa.
#################################
2013 Mar 31
0
Standard error of normalmixEM fit?
I fitted a mixture denstiy of two gaussians two my data. I now want to
calculated the standard errors 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:
2013 Apr 04
0
Std. error of normalmixEM with boot.se
I fitted a mixture denstiy of two gaussians two my data. I now want to
calculated the standard errors 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:
2013 Apr 04
0
Std. error normalmixEM using boot.se
I tried to post this question two times, each time it seemed to fail, since
"
An embedded and charset-unspecified text was scrubbed..."
So I try it again:
I fitted a mixture density of two gaussians two my data. I now want to
caluclate the standard errors 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
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
2013 Mar 18
2
Fit a mixture of lognormal and normal distributions
Hello
I am trying to find an automated way of fitting a mixture of normal and log-normal distributions to data which is clearly bimodal.
Here'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
2006 Jun 01
1
setting the random-effects covariance matrix in lme
Dear R-users,
I have longitudinal data and would like to fit a model where both the variance-covariance matrix of the random effects and the residual variance are conditional on a (binary) grouping variable.
I guess the model would have the following form (in hierarchical notation)
Yi|bi,k ~ N(XiB+Zibi, sigmak*Ident)
bi|k ~ N(0, Dk)
K~Bernoulli(p)
I can obtain different sigmas (sigma0 and
2011 Jan 06
0
Set axis limits in mixtools plot
Hello,
Can the x and y axis limits be specified in a density plot with the
mixtools package for a finite mixture model? Uncommenting the xlim2/
ylim2 lines in the plot command below generates 'not a graphical
parameter' warnings (and does not change the axis settings), and
uncommenting the xlim/ylim lines generates a 'formal argument "ylim"
matched by multiple actual
2008 Jun 19
1
PrettyR (describe)
#is there a way to get NA in the table of descriptive statistics instead of
the function stopping Thank you in advance
#data
x.f <- structure(list(Site = structure(c(9L, 9L, 9L, 9L, 9L, 9L, 9L,
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L,
9L, 9L, 9L, 9L), .Label = c("BC", "HC", "RM119", "RM148", "RM179",
"RM185",