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
Dear members,
I fought for several days against an error I was getting with optim in
L-BFGS-B. The error was produced because some parameters were outside
the limits defined by upper and lower.
After investigation, the error is not produced during the optimization
itself but during the calcula
Dear r-helpers,
I'm experiencing some problems in fitting a maximum likelihood binomial
model to some of my data. The error is in optim, which founds: Error in
optim(par = c(0.2, 0.5), fn = function (p) :
initial value in 'vmmin' is not finite
Yes, I know it's a common problem, and I've caref
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
I am trying to run this code and obtain the MLEs for my parameters. However I
am getting this error at the end.
Error in optim(c(1.4, 1.1, 0.8, 0.92, 0.4), poisson.lik, v = v) :
objective function in *optim evaluates to length 100 not 1*
Code:
poisson.lik <- function(theta,v){
v=matrix(c(1,3,2
(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
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(output)
}
binomial.mle <- optim(0.01,
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
Hi all. I'm just starting to explore ordinal multinomial regression. My
dataset is 300,000 rows, with an outcome (ordinal factor from 1 to 9) and five
independent variables (all continuous). My first stab at it was this:
pomod <- polr(Npf ~ o_stddev + o_skewness + o_kurtosis + o_acl_1e + di
Dear R-users
I've got the next problem:
I've got this *function*:
fitcond=function(x,densfun,pcorte,start,...){
myfn <- function(parm,x,pcorte,...) -sum(log(dens(parm,x,pcorte,...)))
Call <- match.call(expand.dots = TRUE)
if (missing(start))
start <- NULL
dots <- names(li
I get the digest, so I apologize if this is a little late.
For your situation (based on the description and what I think your code
is doing, more on that below), it looks like you are modeling a Poisson
flow where the number of hits per unit time is a random integer with
some mean value.
If I
www.cmis.csiro.au/bill.venables/
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> On Behalf Of Aswad Gurjar
> Sent: Sunday, 10 February 2008 4:17 PM
> To: r-help@r-project.org
> Subject: [R] Error in optim while using fitdistr() function
-project.org
Subject: [R] Error in optim while using fitdistr() function for
estimationof parameters
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
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, 0L, 0L, 0L, 0L
>
> 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,
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, 0L, 0L, 0L, 0L,
19 matches
Mail list logo