Re: [R] maximum likelihood estimation

2007-07-19 Thread Ajay Shah
 I need to perform maximum likelihood estimation on R, but I am not sure
 which command to use. I searched on google, and found an example using the
 function mlogl, but I couldn't find the package on R. Is there such
 function? Or how should i perform my mle?

http://www.mayin.org/ajayshah/KB/R/documents/mle/mle.html might help.

-- 
Ajay Shah  http://www.mayin.org/ajayshah  
[EMAIL PROTECTED] http://ajayshahblog.blogspot.com
*(:-? - wizard who doesn't know the answer.

__
R-help@stat.math.ethz.ch 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] maximum likelihood estimation

2007-07-18 Thread rach.s

Hello!

I need to perform maximum likelihood estimation on R, but I am not sure
which command to use. I searched on google, and found an example using the
function mlogl, but I couldn't find the package on R. Is there such
function? Or how should i perform my mle?

Thank you very much. 
-- 
View this message in context: 
http://www.nabble.com/maximum-likelihood-estimation-tf4103791.html#a11670424
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch 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.


Re: [R] maximum likelihood estimation

2007-07-18 Thread Gabor Csardi
On Wed, Jul 18, 2007 at 08:08:50AM -0700, rach.s wrote:
 
 Hello!
 
 I need to perform maximum likelihood estimation on R, but I am not sure
 which command to use. I searched on google, and found an example using the
 function mlogl, but I couldn't find the package on R. Is there such
 function? Or how should i perform my mle?
   ^^^   :)

library(stats4)
?mle

G.

[...]

-- 
Csardi Gabor [EMAIL PROTECTED]MTA RMKI, ELTE TTK

__
R-help@stat.math.ethz.ch 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] maximum likelihood estimation of 5 parameters

2007-01-05 Thread francogrex

Hi Guys, it would be great if you could help me with a MLE problem in R.

I am trying to evaluate  the maximum likelihood estimates of theta = (a1,
b1, a2, b2, P) which defines a mixture of a Poisson distribution and two
gamma prior distributions (where the Poisson means have a gamma
distribution, actually 2 gammas and P is the mixing factor). The likelihood
function for theta is L(theta) = Pi,j{P f(Nij; a1, b1, Eij) + (1 – P) f(Nij;
a2, b2, Eij),} 
The maximum likelihood estimate of theta is the vector that maximizes the
above equation (the values of N and E are given). The authors of the article
I read say that the maximization involves an iterative search in the five
dimensional parameter space, where each iteration involves computing
log[L(theta)] and its first and second-order derivatives. In test runs it is
suggested that the maximization typically takes between 5 and 15 iterations
from the starting point theta = (a1 = 0.2, b1 = 0.1, a2 = 2, b2 = 4, P =
1/3). 

Now I have done maximization of a gamma-poisson mixture before (1 poisson, 1
gamma) successfully and I could determine correctly alpha (a) and beta(a).
But this one above is giving me ridiculously large unusable values (for
example P should not be above 1 and sometimes I get values of 500!) or even
negative values! I know the values I should be obtaining with my samples
shouldn't be far from the staring points. Is there a way to help me solve
this issue? Thanks.
-- 
View this message in context: 
http://www.nabble.com/maximum-likelihood-estimation-of-5-parameters-tf2925364.html#a8177473
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch 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.


Re: [R] maximum likelihood estimation of 5 parameters

2007-01-05 Thread Ingmar Visser
Franco,
You can provide lower and upper bounds on the parameters if you use optim
with method=L-BFGS-B.
Hth, Ingmar


 From: francogrex [EMAIL PROTECTED]
 Date: Fri, 5 Jan 2007 04:54:50 -0800 (PST)
 To: r-help@stat.math.ethz.ch
 Subject: [R] maximum likelihood estimation of 5 parameters
 
 
Hi Guys, it would be great if you could help me with a MLE problem in R.

I
 am trying to evaluate  the maximum likelihood estimates of theta = (a1,
b1,
 a2, b2, P) which defines a mixture of a Poisson distribution and two
gamma
 prior distributions (where the Poisson means have a gamma
distribution,
 actually 2 gammas and P is the mixing factor). The likelihood
function for
 theta is L(theta) = Pi,j{P f(Nij; a1, b1, Eij) + (1 ­ P) f(Nij;
a2, b2, Eij),}
 
The maximum likelihood estimate of theta is the vector that maximizes
 the
above equation (the values of N and E are given). The authors of the
 article
I read say that the maximization involves an iterative search in the
 five
dimensional parameter space, where each iteration involves
 computing
log[L(theta)] and its first and second-order derivatives. In test
 runs it is
suggested that the maximization typically takes between 5 and 15
 iterations
from the starting point theta = (a1 = 0.2, b1 = 0.1, a2 = 2, b2 =
 4, P =
1/3). 

Now I have done maximization of a gamma-poisson mixture before
 (1 poisson, 1
gamma) successfully and I could determine correctly alpha (a)
 and beta(a).
But this one above is giving me ridiculously large unusable
 values (for
example P should not be above 1 and sometimes I get values of
 500!) or even
negative values! I know the values I should be obtaining with my
 samples
shouldn't be far from the staring points. Is there a way to help me
 solve
this issue? Thanks.
-- 
View this message in context:
 http://www.nabble.com/maximum-likelihood-estimation-of-5-parameters-tf2925364.
 html#a8177473
Sent from the R help mailing list archive at
 Nabble.com.

__
[EMAIL PROTECTED]
 thz.ch 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@stat.math.ethz.ch 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.


Re: [R] maximum likelihood estimation of 5 parameters

2007-01-05 Thread francogrex


Franco,
You can provide lower and upper bounds on the parameters if you use optim
with method=L-BFGS-B.
Hth, Ingmar

Thanks, but when I use L-BFGS-B it tells me that there is an  error in
optim(start, f, method = method, hessian = TRUE, ...) : L-BFGS-B needs
finite values of 'fn'

-- 
View this message in context: 
http://www.nabble.com/maximum-likelihood-estimation-of-5-parameters-tf2925364.html#a8180120
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch 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.


Re: [R] maximum likelihood estimation of 5 parameters

2007-01-05 Thread Prof Brian Ripley
On Fri, 5 Jan 2007, francogrex wrote:

[quoting Ingmar Vissar without attribution, contrary to the posting 
guide.]

 Franco,
 You can provide lower and upper bounds on the parameters if you use optim
 with method=L-BFGS-B.
 Hth, Ingmar

 Thanks, but when I use L-BFGS-B it tells me that there is an  error in
 optim(start, f, method = method, hessian = TRUE, ...) : L-BFGS-B needs
 finite values of 'fn'

It sounds as if you have ignored the advice to scale the problem via 
control options 'fnscale' and 'parscale'.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
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, UKFax:  +44 1865 272595

__
R-help@stat.math.ethz.ch 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.


Re: [R] maximum likelihood estimation of 5 parameters

2007-01-05 Thread Ravi Varadhan
Franco,
Is it possible that you have failed to provide the negative of loglikelihood
to optim, since optim, by default, minimizes a function?  If you want to
do this withput redefining the log-likelihood, you should set fnscale= -1
(as hinted by Prof. Ripley).  This would turn the problem into a
maximization problem.  

If this doesn't work, you should provide more details (a reproducible code
with actual error message).

Ravi.


---

Ravi Varadhan, Ph.D.

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology 

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

Email: [EMAIL PROTECTED]

Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html

 




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of francogrex
Sent: Friday, January 05, 2007 10:42 AM
To: r-help@stat.math.ethz.ch
Subject: Re: [R] maximum likelihood estimation of 5 parameters



Franco,
You can provide lower and upper bounds on the parameters if you use optim
with method=L-BFGS-B.
Hth, Ingmar

Thanks, but when I use L-BFGS-B it tells me that there is an  error in
optim(start, f, method = method, hessian = TRUE, ...) : L-BFGS-B needs
finite values of 'fn'

-- 
View this message in context:
http://www.nabble.com/maximum-likelihood-estimation-of-5-parameters-tf292536
4.html#a8180120
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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.


Re: [R] maximum likelihood estimation of 5 parameters

2007-01-05 Thread Ken Beath
Using the inverse logistic transform to replace p by exp(xp)/(1+exp(xp)) allows 
unconstrained fitting of xp. There may still be problems where xp tends to + or 
- infinity depending on starting values.

 francogrex [EMAIL PROTECTED] 01/05/07 11:54 PM 

Hi Guys, it would be great if you could help me with a MLE problem in R.

I am trying to evaluate  the maximum likelihood estimates of theta = (a1,
b1, a2, b2, P) which defines a mixture of a Poisson distribution and two
gamma prior distributions (where the Poisson means have a gamma
distribution, actually 2 gammas and P is the mixing factor). The likelihood
function for theta is L(theta) = Pi,j{P f(Nij; a1, b1, Eij) + (1 * P) f(Nij;
a2, b2, Eij),} 
The maximum likelihood estimate of theta is the vector that maximizes the
above equation (the values of N and E are given). The authors of the article
I read say that the maximization involves an iterative search in the five
dimensional parameter space, where each iteration involves computing
log[L(theta)] and its first and second-order derivatives. In test runs it is
suggested that the maximization typically takes between 5 and 15 iterations
from the starting point theta = (a1 = 0.2, b1 = 0.1, a2 = 2, b2 = 4, P =
1/3). 

Now I have done maximization of a gamma-poisson mixture before (1 poisson, 1
gamma) successfully and I could determine correctly alpha (a) and beta(a).
But this one above is giving me ridiculously large unusable values (for
example P should not be above 1 and sometimes I get values of 500!) or even
negative values! I know the values I should be obtaining with my samples
shouldn't be far from the staring points. Is there a way to help me solve
this issue? Thanks.
-- 
View this message in context: 
http://www.nabble.com/maximum-likelihood-estimation-of-5-parameters-tf2925364.html#a8177473
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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.


Re: [R] maximum likelihood estimation of 5 parameters

2007-01-05 Thread francogrex

No I have not forgotten to use a negative fnscale to optimize, so as you
suggest I will post some parts of the code I am running to show you the
errors:

 n
 [1]   3   1   4  54   6  58  20  14   3  14   4  65   1   7   9  10   2   4 
66
[20]   5   9   7  12   7  55 105   2   5  10  55   5  28   1   1   6   2   1 
30
[39]   6  49   7  21   8   7
 e
 [1] 21.763201  1.209070  4.836270 32.644798 19.546600 24.584400 30.226700
 [8]  6.045340 14.010100  3.113350 21.015100 12.583100 15.826200 19.458401
[15]  3.891690  1.329970  0.241814  3.143580 13.057900  0.725441 18.136000
[22]  2.187660  6.319900  1.701510 29.654900 36.460999  7.292190  1.215370
[29]  3.209070 19.995001 11.972300  3.455920  0.138539  0.113350  1.360200
[36]  1.889170  1.518890 18.226700  4.050380 27.340099  1.181360 16.370300
[43] 20.589399 25.314899

 fr-function(a1,b1,a2,b2,p){
+ 
+ w-((gamma(a1+n)))/((gamma(a1)*factorial(n))*(1+(e/b1)^a1)*(1+(b1/e)^n))
+ z-((gamma(a2+n)))/((gamma(a2)*factorial(n))*(1+(e/b2)^a2)*(1+(b2/e)^n))
+ 
+ sum (log( (p*w)+ ((1-p)*z) ))
+ 
+ }
 
 mle((fr),
 start=list(a1=0.2,b1=0.1,a2=2,b2=4,p=0.33),method=BFGS,control=list(fnscale=-1))
Error in optim(start, f, method = method, hessian = TRUE, ...) : 
non-finite finite-difference value [2]

And with the L-BFGS-B:

Error in optim(start, f, method = method, hessian = TRUE, ...) : 
L-BFGS-B needs finite values of 'fn'

AND WITH NELDER-MEAD it doesn't work either (same error), but when I change
intial parameters (though I shouldn't, it gives something very weird
(negatives or sometimes huge values).

Call:
mle(minuslogl = (fr), start = list(a1 = 1, b1 = 1, a2 = 10, b2 = 10, 
p = 0.9), method = Nelder-Mead, control = list(fnscale = -1))

Coefficients:
a1 b1 a2 b2  p 
-2.5035823  0.6236359 26.5562988 12.9604112 -0.1383767 

Thanks



Ravi Varadhan wrote:
 
 Franco,
 Is it possible that you have failed to provide the negative of
 loglikelihood
 to optim, since optim, by default, minimizes a function?  If you want to
 do this withput redefining the log-likelihood, you should set fnscale= -1
 (as hinted by Prof. Ripley).  This would turn the problem into a
 maximization problem.  
 
 If this doesn't work, you should provide more details (a reproducible code
 with actual error message).
 
 Ravi.
 
 
 ---
 
 Ravi Varadhan, Ph.D.
 
 Assistant Professor, The Center on Aging and Health
 
 Division of Geriatric Medicine and Gerontology 
 
 Johns Hopkins University
 
 Ph: (410) 502-2619
 
 Fax: (410) 614-9625
 
 Email: [EMAIL PROTECTED]
 
 Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html
 
  
 
 
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of francogrex
 Sent: Friday, January 05, 2007 10:42 AM
 To: r-help@stat.math.ethz.ch
 Subject: Re: [R] maximum likelihood estimation of 5 parameters
 
 
 
 Franco,
 You can provide lower and upper bounds on the parameters if you use optim
 with method=L-BFGS-B.
 Hth, Ingmar
 
 Thanks, but when I use L-BFGS-B it tells me that there is an  error in
 optim(start, f, method = method, hessian = TRUE, ...) : L-BFGS-B needs
 finite values of 'fn'
 
 -- 
 View this message in context:
 http://www.nabble.com/maximum-likelihood-estimation-of-5-parameters-tf292536
 4.html#a8180120
 Sent from the R help mailing list archive at Nabble.com.
 
 __
 R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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.
 
 

-- 
View this message in context: 
http://www.nabble.com/maximum-likelihood-estimation-of-5-parameters-tf2925364.html#a8186869
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch 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.


Re: [R] maximum likelihood estimation of 5 parameters

2007-01-05 Thread Charles C. Berry
] maximum likelihood estimation of 5 parameters



 Franco,
 You can provide lower and upper bounds on the parameters if you use optim
 with method=L-BFGS-B.
 Hth, Ingmar

 Thanks, but when I use L-BFGS-B it tells me that there is an  error in
 optim(start, f, method = method, hessian = TRUE, ...) : L-BFGS-B needs
 finite values of 'fn'

 --
 View this message in context:
 http://www.nabble.com/maximum-likelihood-estimation-of-5-parameters-tf292536
 4.html#a8180120
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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.



 -- 
 View this message in context: 
 http://www.nabble.com/maximum-likelihood-estimation-of-5-parameters-tf2925364.html#a8186869
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@stat.math.ethz.ch 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.


Charles C. Berry(858) 534-2098
  Dept of Family/Preventive Medicine
E mailto:[EMAIL PROTECTED]   UC San Diego
http://biostat.ucsd.edu/~cberry/ La Jolla, San Diego 92093-0717

__
R-help@stat.math.ethz.ch 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.


Re: [R] Maximum likelihood estimation of Regression parameters

2006-06-12 Thread Bart Joosen
I'm working with lm for some time, so I know the function.
The problem was that I purchased the book to learn more about linear models
and couldn't find the equivalent for the maximum likelihood in R, I used lm,
mle, and a few others, but it never allow you to set a variance parameter.
But after reading some further, I should be aware of posting to quick, sorry
for that.

I have read the Practical regression and anova in R by Faraway some month
ago, and I know that the Venable and Ripley book should be the one to buy,
but I think I can't find it for about 10$ as I did with the Applied linear
statistical models.

As I'm not in the position to spend a lot of money an buying books, I should
do my work with the contributed documents, and the wrong book.

Thanks for your help and time both of you

Bart

- Original Message -
From: Spencer Graves [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: Bart Joosen [EMAIL PROTECTED]; r-help@stat.math.ethz.ch
Sent: Sunday, June 11, 2006 5:20 PM
Subject: Re: [R] Maximum likelihood estimation of Regression parameters


   Have you looked at lm?  I think that's what you want.

   Also, have you reviewed the Documentation list at
 www.r-project.org?  Neter, Kutner, nachtsheim  Wasserman has had a
 long and successful run having first appeared in 1974 and having gone
 through several editions since then.  However, it apparently has not
 kept up with the R revolution, and I would not recommend it today.

   Beyond this, if you don't have Venables and Ripley (2002) Modern
 Applied Statistics with S (Springer), I recommend you look at it first.
   It has numerous index entries on regression and is all around my
 favorite book on R generally.

   Also, have you checked the Documentation briefly outlined at
 'www.r-project.org', including the Contributed Documentation on CRAN,
 and Practical Regression and Anova using R by Faraway in particular?

   hope this helps.
   Spencer Graves

 Xiaoting Hua wrote:
  mle(stats4)Maximum Likelihood Estimation
 
  is it list above what you want?
 
  On 6/10/06, Bart Joosen [EMAIL PROTECTED] wrote:
  Hi,
 
  I want to use Maximum likelihood to estimate the parameters from my
  regression line.
  I have purchased the book Applied linear statistical models from
  Neter, Kutner, nachtsheim  Wasserman, and in one of the first
  chapters, they use maximum likelihood to estimate the parameters.
  Now I want to tried it for my self, but couldn't find the right
function.
  In the book, they give a fixed variance to work with, but I couldn't
  find a function where I can estimate the predictor and where I have to
  give the variance.
  Or isn't this neccesairy?
  Also they calculate likelihood values for the different values, used
  to estimate the parameters (like a normal probability curve), is it
  possible to do this with R?
 
  Kind regards
 
  Bart
 [[alternative HTML version deleted]]
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide!
  http://www.R-project.org/posting-guide.html
 
 
 
 
  
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Maximum likelihood estimation of Regression parameters

2006-06-11 Thread Spencer Graves
  Have you looked at lm?  I think that's what you want.

  Also, have you reviewed the Documentation list at 
www.r-project.org?  Neter, Kutner, nachtsheim  Wasserman has had a 
long and successful run having first appeared in 1974 and having gone 
through several editions since then.  However, it apparently has not 
kept up with the R revolution, and I would not recommend it today.

  Beyond this, if you don't have Venables and Ripley (2002) Modern 
Applied Statistics with S (Springer), I recommend you look at it first. 
  It has numerous index entries on regression and is all around my 
favorite book on R generally.

  Also, have you checked the Documentation briefly outlined at 
'www.r-project.org', including the Contributed Documentation on CRAN, 
and Practical Regression and Anova using R by Faraway in particular?

  hope this helps.
  Spencer Graves

Xiaoting Hua wrote:
 mle(stats4)Maximum Likelihood Estimation
 
 is it list above what you want?
 
 On 6/10/06, Bart Joosen [EMAIL PROTECTED] wrote:
 Hi,

 I want to use Maximum likelihood to estimate the parameters from my 
 regression line.
 I have purchased the book Applied linear statistical models from 
 Neter, Kutner, nachtsheim  Wasserman, and in one of the first 
 chapters, they use maximum likelihood to estimate the parameters.
 Now I want to tried it for my self, but couldn't find the right function.
 In the book, they give a fixed variance to work with, but I couldn't 
 find a function where I can estimate the predictor and where I have to 
 give the variance.
 Or isn't this neccesairy?
 Also they calculate likelihood values for the different values, used 
 to estimate the parameters (like a normal probability curve), is it 
 possible to do this with R?

 Kind regards

 Bart
[[alternative HTML version deleted]]

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html

 
 
 
 
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Maximum likelihood estimation of Regression parameters

2006-06-10 Thread Bart Joosen
Hi,

I want to use Maximum likelihood to estimate the parameters from my regression 
line.
I have purchased the book Applied linear statistical models from Neter, 
Kutner, nachtsheim  Wasserman, and in one of the first chapters, they use 
maximum likelihood to estimate the parameters.
Now I want to tried it for my self, but couldn't find the right function.
In the book, they give a fixed variance to work with, but I couldn't find a 
function where I can estimate the predictor and where I have to give the 
variance.
Or isn't this neccesairy?
Also they calculate likelihood values for the different values, used to 
estimate the parameters (like a normal probability curve), is it possible to do 
this with R?

Kind regards

Bart
[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Maximum likelihood estimation of Regression parameters

2006-06-10 Thread Xiaoting Hua

mle(stats4)Maximum Likelihood Estimation

is it list above what you want?

On 6/10/06, Bart Joosen [EMAIL PROTECTED] wrote:

Hi,

I want to use Maximum likelihood to estimate the parameters from my regression 
line.
I have purchased the book Applied linear statistical models from Neter, Kutner, 
nachtsheim  Wasserman, and in one of the first chapters, they use maximum likelihood to 
estimate the parameters.
Now I want to tried it for my self, but couldn't find the right function.
In the book, they give a fixed variance to work with, but I couldn't find a 
function where I can estimate the predictor and where I have to give the 
variance.
Or isn't this neccesairy?
Also they calculate likelihood values for the different values, used to 
estimate the parameters (like a normal probability curve), is it possible to do 
this with R?

Kind regards

Bart
   [[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




--
  此致
敬礼!
  华孝挺 Kenneth Hua
浙江大学核农所
杭州,中国
310029

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] Maximum Likelihood Estimation

2006-04-04 Thread Uwe Ligges
Andrej Kastrin wrote:

 Uwe Ligges wrote:
 
[EMAIL PROTECTED] wrote:

  

Hi,

I would like to know how to configure R so that I can enter some values
and compute the Muximum likelihood estimation of my data.


Maximum likelihood estimation of what?
I do not know the definition of Maximum likelihood estimation of [...] 
data.

Uwe Ligges



  

Thanks
Victor.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

  
 
 Google for  Fitting Distributions with R. Excellent intro to your 
 question...


Yes, thanks. I know maximum likelihood estimation, but I do not know 
what the original questioner means with compute the Muximum likelihood 
estimation of my data. I tried to point out that we need some more 
details - maybe using a too subtle way in this case ...


Uwe Ligges



 HTH, Andrej
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Maximum Likelihood Estimation

2006-04-03 Thread vkatoma

Hi,

I would like to know how to configure R so that I can enter some values
and compute the Muximum likelihood estimation of my data.

Thanks
Victor.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Maximum Likelihood Estimation

2006-04-03 Thread Uwe Ligges
[EMAIL PROTECTED] wrote:

 Hi,
 
 I would like to know how to configure R so that I can enter some values
 and compute the Muximum likelihood estimation of my data.

Maximum likelihood estimation of what?
I do not know the definition of Maximum likelihood estimation of [...] 
data.

Uwe Ligges



 Thanks
 Victor.
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Maximum Likelihood Estimation

2006-04-03 Thread Andrej Kastrin
Uwe Ligges wrote:
 [EMAIL PROTECTED] wrote:

   
 Hi,

 I would like to know how to configure R so that I can enter some values
 and compute the Muximum likelihood estimation of my data.
 

 Maximum likelihood estimation of what?
 I do not know the definition of Maximum likelihood estimation of [...] 
 data.

 Uwe Ligges



   
 Thanks
 Victor.

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

   
Google for  Fitting Distributions with R. Excellent intro to your 
question...

HTH, Andrej

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Maximum Likelihood Estimation

2006-03-01 Thread Arun Kumar Saha
hi all,

Can anyone tell me how to do Maximum Likelihood Estimation in R?

Thanks in advance
Arun

--

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Maximum Likelihood Estimation

2006-03-01 Thread Ben Bolker
Arun Kumar Saha arun.kumar.saha at gmail.com writes:

 
 hi all,
 
 Can anyone tell me how to do Maximum Likelihood Estimation in R?
 

  Unfortunately this question is ***way*** too vague for us
to answer adequately.  A short answer is that R provides general-purpose
minimization functions (optim, nlm, nlminb) that you can use to
minimize a negative log-likelihood function; the mle() function
in the stats4 package is a wrapper for this function.  You have
to define your own likelihood function:
http://www.mayin.org/ajayshah/KB/R/documents/mle/mle.html
may be helpful.

   Ben Bolker

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] maximum likelihood estimation

2004-10-15 Thread Martin Maechler
 Roger == Roger D Peng [EMAIL PROTECTED]
 on Thu, 14 Oct 2004 17:06:25 -0400 writes:

Roger What lead you to believe that mle() is defunct?  It's
Roger still in the `stats4' package in my installation of
Roger R.

yes indeed.  Just to clarify possible confusions:

The 'mle' *package* has been merged into the new 'stats4'
package {for 1.9.0 already}.  The mle() function has always been
available and there were even discussions on extension /
generalization of its functioning and the methods working on
mle-class objects (produced by mle(...).

Martin

Roger -roger

Roger T. Murlidharan Nair wrote:

 Since mle is defunct is there anyother function I can use
 for maximum likelihood estimation ?  Thanks ../Murli

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] maximum likelihood estimation

2004-10-14 Thread T. Murlidharan Nair
Since mle is defunct is there anyother function I can use for maximum 
likelihood
estimation ?
Thanks ../Murli

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] maximum likelihood estimation

2004-10-14 Thread Roger D. Peng
What lead you to believe that mle() is defunct?  It's still in the 
`stats4' package in my installation of R.

-roger
T. Murlidharan Nair wrote:
Since mle is defunct is there anyother function I can use for maximum 
likelihood
estimation ?
Thanks ../Murli

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Maximum likelihood estimation in R

2004-02-16 Thread Rau, Roland
Hi,

 -Original Message-
 From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]
 Sent: Sunday, February 15, 2004 10:24 PM
 To:   [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject:  Re: [R] Maximum likelihood estimation in R
 
 Hello,
 
 Use
 
  x=rnorm(100, mean=3, sd=1)
  library(MASS)
 fitdistr(x, normal)
   mean  sd
   2.9331   0.99673982 
  (0.09967398) (0.07048015)
 
For me, this example does not work. As it looks like copy+paste, I
guess this something platform dependent? At least I have to specify some
starting values as shown below. But maybe I did something wrong?

Best,
Roland
(I am using at the moment R 1.8.1 on WinNT)

 x=rnorm(100, mean=3, sd=1)
 library(MASS)
 fitdistr(x, normal)
Error in fitdistr(x, normal) : 'start' must be a named list
 fitdistr(x, normal, start=list(mean=1, sd=0.4))
  mean  sd
  3.03167815   1.06637851 
 (0.10663786) (0.07539617)
 


+
This mail has been sent through the MPI for Demographic Research.  Should you receive 
a mail that is apparently from a MPI user without this text displayed, then the 
address has most likely been faked.   If you are uncertain about the validity of this 
message, please check the mail header or ask your system administrator for assistance.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Maximum likelihood estimation in R

2004-02-16 Thread DivineSAAM
Hello,

Excellent, also the book:

Pawitan, Yudi (2001). In all Likelihood: Statistical Modelling and Inference using 
Likelihood, Clarendon Press, Oxford.

Is very good and the associated Web Site is full of MLE using R.

Hope this also helps.
/oal

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Maximum likelihood estimation in R

2004-02-16 Thread Spencer Graves
 I got the same error message in R 1.8.1 and S-Plus 6.1.  Then I 
read the error message:  'start' must be a named list.  Then I read 
help(fitdistr) and learned that fitdistr required 3 arguments, the 
third of which was start: A named list giving the parameters to be 
optimized with initial values.  This can be omitted for some of the 
named distributions (see Details).  The normal distribution was NOT one 
of the named distributions.  When I supplied a named list for start, 
it worked: 

 fitdistr(x, normal, list(mean=0, sd=1))
 mean  sd   
 2.97093013   0.88852969
(0.08885297) (0.06281083)

 hope this helps.  spencer graves

Rau, Roland wrote:

Hi,

 

-Original Message-
From:   [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]
Sent:   Sunday, February 15, 2004 10:24 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject:Re: [R] Maximum likelihood estimation in R
Hello,

Use

   

x=rnorm(100, mean=3, sd=1)
library(MASS)
fitdistr(x, normal)
 

 mean  sd
 2.9331   0.99673982 
(0.09967398) (0.07048015)

   

For me, this example does not work. As it looks like copy+paste, I
guess this something platform dependent? At least I have to specify some
starting values as shown below. But maybe I did something wrong?
Best,
Roland
(I am using at the moment R 1.8.1 on WinNT)
	 x=rnorm(100, mean=3, sd=1)
	 library(MASS)
	 fitdistr(x, normal)
	Error in fitdistr(x, normal) : 'start' must be a named list
	 fitdistr(x, normal, start=list(mean=1, sd=0.4))
	  mean  sd
	  3.03167815   1.06637851 
	 (0.10663786) (0.07539617)
	 

+
This mail has been sent through the MPI for Demographic Research.  Should you receive 
a mail that is apparently from a MPI user without this text displayed, then the 
address has most likely been faked.   If you are uncertain about the validity of this 
message, please check the mail header or ask your system administrator for assistance.
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Maximum likelihood estimation in R

2004-02-16 Thread Prof Brian Ripley
normal is in the list in the current versions of MASS, but not that 
released with R 1.8.1.  Try update.packages() in R.

On Mon, 16 Feb 2004, Spencer Graves wrote:

   I got the same error message in R 1.8.1 and S-Plus 6.1.  Then I 
 read the error message:  'start' must be a named list.  Then I read 
 help(fitdistr) and learned that fitdistr required 3 arguments, the 
 third of which was start: A named list giving the parameters to be 
 optimized with initial values.  This can be omitted for some of the 
 named distributions (see Details).  The normal distribution was NOT one 
 of the named distributions.  When I supplied a named list for start, 
 it worked: 
 
   fitdistr(x, normal, list(mean=0, sd=1))
   mean  sd   
   2.97093013   0.88852969
  (0.08885297) (0.06281083)
 
   hope this helps.  spencer graves
 
 Rau, Roland wrote:
 
 Hi,
 
   
 
 -Original Message-
 From:   [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]
 Sent:   Sunday, February 15, 2004 10:24 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject:Re: [R] Maximum likelihood estimation in R
 
 Hello,
 
 Use
 
 
 
 x=rnorm(100, mean=3, sd=1)
 library(MASS)
 fitdistr(x, normal)
   
 
   mean  sd
   2.9331   0.99673982 
  (0.09967398) (0.07048015)
 
 
 
  For me, this example does not work. As it looks like copy+paste, I
 guess this something platform dependent? At least I have to specify some
 starting values as shown below. But maybe I did something wrong?
 
  Best,
  Roland
  (I am using at the moment R 1.8.1 on WinNT)
 
   x=rnorm(100, mean=3, sd=1)
   library(MASS)
   fitdistr(x, normal)
  Error in fitdistr(x, normal) : 'start' must be a named list
   fitdistr(x, normal, start=list(mean=1, sd=0.4))
mean  sd
3.03167815   1.06637851 
   (0.10663786) (0.07539617)
   
 
 
 +
 This mail has been sent through the MPI for Demographic Research.  Should you 
 receive a mail that is apparently from a MPI user without this text displayed, then 
 the address has most likely been faked.   If you are uncertain about the validity 
 of this message, please check the mail header or ask your system administrator for 
 assistance.
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
   
 
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 
 

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
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, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Maximum likelihood estimation in R

2004-02-15 Thread Edward Sun
Dear Sir,

I am a new user of R and I am doing a tast, which is: find the maximum 
likelihood estimate of the parameter of Gaussian distribution for generated 
100 numbers by using x=rnorm(100, mean=3, sd=1).

I tried to use following Maximum Likelihood function
fn-function(x)
(-50*log((sd(x))^2))-50*log(sqrt(2*pi))-(1/2*((mean(x))^2))*(sum((x-(mean(x))^2)),
but it did not work.
I am looking for the complete syntax to finish my target task.

Thanks for your help.

Best regards.
Edward Sun
Germany
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Maximum likelihood estimation in R

2004-02-15 Thread DivineSAAM
Hello,

Use

 x=rnorm(100, mean=3, sd=1)
 library(MASS)
fitdistr(x, normal)
  mean  sd
  2.9331   0.99673982 
 (0.09967398) (0.07048015)

Hope this helps,

Shrieb

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Maximum likelihood estimation in R

2004-02-15 Thread Spencer Graves
 If, however, you are more interested in general methods for 
maximizing a likelihood function, I suggest you look at optim, work 
the examples on the help page, etc. 

 hope this helps.  spencer graves

[EMAIL PROTECTED] wrote:

Hello,

Use

 

x=rnorm(100, mean=3, sd=1)
library(MASS)
fitdistr(x, normal)
   

 mean  sd
 2.9331   0.99673982 
(0.09967398) (0.07048015)

Hope this helps,

Shrieb

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Maximum likelihood estimation in R

2004-02-15 Thread Liaw, Andy
Or:

library(mle)
?mle

(which, BTW, uses optim() underneath.)

Also, for those not aware of it, fitdistr(x, normal) just computes mean(x)
and (n-1)/n * var(x) and return them.  (I can't imagine any reason to do
otherwise for normal distribution.)

Best,
Andy

 From: Spencer Graves
 
   If, however, you are more interested in general methods for 
 maximizing a likelihood function, I suggest you look at optim, work 
 the examples on the help page, etc. 
 
   hope this helps.  spencer graves
 
 [EMAIL PROTECTED] wrote:
 
 Hello,
 
 Use
 
   
 
 x=rnorm(100, mean=3, sd=1)
 library(MASS)
 fitdistr(x, normal)
 
 
   mean  sd
   2.9331   0.99673982 
  (0.09967398) (0.07048015)
 
 Hope this helps,
 
 Shrieb
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
   
 
 
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 
 


--
Notice:  This e-mail message, together with any attachments,...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Maximum Likelihood Estimation and Optimisation

2003-07-10 Thread Fohr, Marc [AM]
Hello,

I want to calculate a maximum likelihood funktion in R in order to solve for the 
parameters of an estimator. Is there an easy way to do this in R? How do I get the 
parameters and the value of the maximum likelihood funktion. 

More, I want to specify the algorithm of the optimisation above: BHHH (Berndt Hall 
Hall Hausman). Is this possible?

Thanks a lot for your help and best regards

Marc

-
Marc Fohr, CFA
Equity Portfolio Manager
First Private Investment Management
Neue Mainzer Strasse 75
D-60311 Frankfurt/Main
Phone: ++49 - 69 - 2607 5424
Fax: ++49 - 69 - 2607 5440
Email: [EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Maximum Likelihood Estimation and Optimisation

2003-07-10 Thread Harold Doran
Well, lm() produces an OLS solution, which are also MLE solutions for the fixed 
effects. I think this is an easy way, although maybe not the best. 

BHHH is a numerical approximation that can be used when a closed form solution is not 
available. It is less sophisticated than Newton-Raphson.

Is this helpful?

 
--
Harold C. Doran
Director of Research and Evaluation
New American Schools
675 N. Washington Street, Suite 220
Alexandria, Virginia 22314
703.647.1628 
 
 


-Original Message-
From: Fohr, Marc [AM] [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 10, 2003 10:17 AM
To: [EMAIL PROTECTED]
Subject: [R] Maximum Likelihood Estimation and Optimisation


Hello,

I want to calculate a maximum likelihood funktion in R in order to solve for the 
parameters of an estimator. Is there an easy way to do this in R? How do I get the 
parameters and the value of the maximum likelihood funktion. 

More, I want to specify the algorithm of the optimisation above: BHHH (Berndt Hall 
Hall Hausman). Is this possible?

Thanks a lot for your help and best regards

Marc

-
Marc Fohr, CFA
Equity Portfolio Manager
First Private Investment Management
Neue Mainzer Strasse 75
D-60311 Frankfurt/Main
Phone: ++49 - 69 - 2607 5424
Fax: ++49 - 69 - 2607 5440
Email: [EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


FW: [R] Maximum Likelihood Estimation and Optimisation

2003-07-10 Thread David Barron

Have a look at ?optim.  I don't think it has the BHHH algorithm as an
option, though.

===
David Barron
Jesus College
University of Oxford


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Harold Doran
Sent: 10 July 2003 15:43
To: Fohr, Marc [AM]; [EMAIL PROTECTED]
Subject: RE: [R] Maximum Likelihood Estimation and Optimisation


Well, lm() produces an OLS solution, which are also MLE solutions for the
fixed effects. I think this is an easy way, although maybe not the best.

BHHH is a numerical approximation that can be used when a closed form
solution is not available. It is less sophisticated than Newton-Raphson.

Is this helpful?


--
Harold C. Doran
Director of Research and Evaluation
New American Schools
675 N. Washington Street, Suite 220
Alexandria, Virginia 22314
703.647.1628




-Original Message-
From: Fohr, Marc [AM] [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 10, 2003 10:17 AM
To: [EMAIL PROTECTED]
Subject: [R] Maximum Likelihood Estimation and Optimisation


Hello,

I want to calculate a maximum likelihood funktion in R in order to solve for
the parameters of an estimator. Is there an easy way to do this in R? How do
I get the parameters and the value of the maximum likelihood funktion.

More, I want to specify the algorithm of the optimisation above: BHHH
(Berndt Hall Hall Hausman). Is this possible?

Thanks a lot for your help and best regards

Marc


-
Marc Fohr, CFA
Equity Portfolio Manager
First Private Investment Management
Neue Mainzer Strasse 75
D-60311 Frankfurt/Main
Phone: ++49 - 69 - 2607 5424
Fax: ++49 - 69 - 2607 5440
Email: [EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Maximum Likelihood Estimation and Optimisation

2003-07-10 Thread Spencer Graves
It is not obvious to me what parameters in what model you want to fit. 
Function optim does very well with many different kinds of problems. 
If you just want to estimate parameters of a probability distribution, 
function fitdistr in library(MASS) will do that.  A couple of days 
ago, I needed to fit a Pareto distribution of the first kind.  A 
search of www.r-project.org - search - R site search uncovered 
functions for a Pareto distribtion of a different kind.  So, I wrote the 
following and used them to check fitdistr and then to actually fit the 
distribution to data.

hope this helps.  spencer graves
#
dpareto -
function(x, shape, x0, log=FALSE){
dp - if(log) (log(shape-1)-shape*log(x/x0)-log(x0))
else ((shape-1)*((x0/x)^shape)/x0)
dp[xx0] - 0
dp
}
ppareto -
function(q, shape, x0, lower.tail = TRUE, log.p=FALSE){
q - pmax(x0, q)
if(log.p){
if(lower.tail){
return(log(ppareto(q, shape, x0)))
}
else return((shape-1)*log(x0/q))
}
else{
S.q - (x0/q)^(shape-1)
if(lower.tail)return(1-S.q)
else return(S.q)
}
}
qpareto -
function(p, shape, x0, lower.tail=TRUE){
if(lower.tail) p - (1-p)
x0*exp(-log(p)/(shape-1))
}
rpareto -
function(n, shape, x0)
qpareto(runif(n), shape, x0, lower.tail=FALSE)
fitdistr(rpareto(1, 3, 1), dpareto, list(shape=2.5), x0=1)


Harold Doran wrote:
Well, lm() produces an OLS solution, which are also MLE 
solutions for the fixed effects. I think this is an easy
way, although maybe not the best.
BHHH is a numerical approximation that can be used when 
a closed form solution is not available. It is less
sophisticated than Newton-Raphson.
Is this helpful?

 
--
Harold C. Doran
Director of Research and Evaluation
New American Schools
675 N. Washington Street, Suite 220
Alexandria, Virginia 22314
703.647.1628 

-Original Message-
From: Fohr, Marc [AM] [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 10, 2003 10:17 AM
To: [EMAIL PROTECTED]
Subject: [R] Maximum Likelihood Estimation and Optimisation
Hello,

I want to calculate a maximum likelihood funktion in R in 
order to solve for the parameters of an estimator. Is there
an easy way to do this in R? How do I get the parameters and
the value of the maximum likelihood funktion.
More, I want to specify the algorithm of the optimisation 
above: BHHH (Berndt Hall Hall Hausman). Is this possible?
Thanks a lot for your help and best regards

Marc

-
Marc Fohr, CFA
Equity Portfolio Manager
First Private Investment Management
Neue Mainzer Strasse 75
D-60311 Frankfurt/Main
Phone: ++49 - 69 - 2607 5424
Fax: ++49 - 69 - 2607 5440
Email: [EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Maximum likelihood estimation of a mixture of two weibull distribution

2003-01-22 Thread Ivone Figueiredo
Hi,

I would like to estimate the parameters of a mixture of two Weibull distributions by 
the maximum likelihood method. Is it possible to do it with fitdist?

Thanks
IF
[[alternate HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



[R] Maximum likelihood estimation of a mixture of two weibull distribution

2003-01-22 Thread Ivone Figueiredo
Hi,

I would like to estimate the parameters of a mixture of two Weibull
distributions by the maximum likelihood method. Is it possible to do it with
fitdist?

Thanks
IF

[[alternate HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help