Sorry... it is already stated in the help, at the hessian section:
hessian
Only if argument hessian is true. A symmetric matrix giving an estimate
of the Hessian at the solution found. Note that this is the Hessian of
the unconstrained problem even if the box constraints are active.
So no pro
Why don't you try substituting your vector of values and see what comes
out...once you figure out what happened, the sum() command will solve your
problems.
Michael
On Oct 28, 2011, at 5:10 PM, djbanana wrote:
> I understand that the likelihood function is a product and hence the log
> likel
I understand that the likelihood function is a product and hence the log
likelihood function is a sum. However I can't figure out what the problem
is.
Here's the likelihood function:
[(alpha1*beta2*gamma)^v1 exp^(-alpha1*beta2*gamma)]/v1! * [(alpha2*beta1)^v2
exp^(-alpha2*beta1)]/v2!
Isn't the l
The likelihood function is a product. Thus, the log likelihood function is a
sum. Your log.lik statement, however, fails to compute the sum, which it
should minimize. Hence your optim statement does not know what to optimize
because log.lik is a vector of the length of the number of observations in
(a) This is pretty obviously homework; the r-help list is *not* for
giving help with homework.
(b) *Read* the error message!
(c) Your expression for the log likelihood is wrong in more than
one way. (The number of observations is *not* the same thing
as the number of trials for a given observa
jango wrote:
>
> I'm trying to calculate the maximum likelihood estimate for a binomial
> distribution. Here is my code:
>
> y <- c(2, 4, 2, 4, 5, 3)
> n <- length(y)
> binomial.ll <- function (pi, y, n) {## define log-likelihood
> output <- y*log(pi)+(n-y)*(log(1-pi))
> return(outp
An update for the benefit of the list/posterity: I resolved this issue by
switching over to using the lrm() function of package rms. It seems to pick
better starts, or something; in any case, it has been able to converge on a
solution for every model I've tried, although for the most complex
Hello,
Thank You for response.Yes,It is discrete data.I have tried discrete model
using goodfit() test.But that too is not working.Is there any other test for
discrete data?
When I try goodfit() test for discrete distribution:
gf<-goodfit(x[[1]],type= "nbinomial",method= "MinChisq")
where x[[1]]
Chenge your model, most likely.
You are telling us a) the response is discrete and b) there is a
substantial probability that the value is zero. The gamma distributon
is a model for a continuous response, your response is integer valued.
Perhaps you should consider something the Poisson or Negati
>
> Hello,
>
> I am trying to fit distribution for data consisting of 421 readings.It is
> basically no of requests arrived per minute.It contains many 0 entries as
> no of requests.When i use
> fd<-fitdistr(V2,"gamma")
> I get following error:
> Error in optim(x = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
10 matches
Mail list logo