If v is your vector of sample variances (and assuming that their distribution
is chi-square) you can define
f(df) <- sum(dchisq(v,df,log=TRUE))
and now you need to maximize f, which can be done using any optimization
function (like optim).
--- On Sat, 26/7/08, Julio Rojas <[EMAIL PROTECTED]> wrote:
> From: Julio Rojas <[EMAIL PROTECTED]>
> Subject: [R] Chi-square parameter estimation
> To: r-help@r-project.org
> Received: Saturday, 26 July, 2008, 12:03 AM
> Hi. I have made 100 experiments of an M/M/1 queue, and for
> each one I have calculated both, mean and variance of the
> queue size. Now, a professor has told me that variance is
> usually chi-squared distributed. Is there a way in R that I
> can find the parameter that best fits a chi-square to the
> variance data? I know there's fitdistr()m but this
> function doesn't handle chi-square. I believe the mean
> estimator for the chi-square is df (degrees of freedom).
> The theoretical variance for an M/M/1 queue with
> lambda=30/33 is ~108. So, should I expect the chi-square
> with parameter 108 is the one that best fits the data?
>
> Thanks a lot for your help.
>
>
>
>
>
>
>
> Yahoo! MTV Blog & Rock >¡Cuéntanos tu
> historia, inspira una canción y gánate un viaje a los
> Premios MTV! Participa aquí http://mtvla.yahoo.com/
> [[alternative HTML version
> deleted]]__
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
> reproducible code.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.