Questions tagged [log-likelihood]

Only questions related to the implementation and usage of the mathematical function - log-Likelihood should use this tag.

Given a sample and a parametric family of distributions (i.e., a set of distributions indexed by a parameter) that could have generated the sample, the Likelihood is a function that associates to each parameter the probability (or probability density) of observing the given sample.

The log-Likelihood a function which is the natural logarithm of the Likelihood function

For many applications, the log-Likelihood, is more convenient to work with as compared to the Likelihood. This is because we are generally interested in where the Likelihood reaches its maximum value. Since the logarithm is a strictly increasing function, the logarithm of a function achieves its maximum value at the same points as the function itself, hence the log-likelihood can be used in place of the likelihood for maximum likelihood estimation and related techniques.

Finding the maximum of a function often involves taking the derivative of a function and solving for the parameter being maximized, and this is often easier when the function being maximized is a log-likelihood rather than the original likelihood function, because the probability of the conjunction of several independent variables is the product of probabilities of the variables and solving an additive equation is usually easier than a multiplicative one.

232 questions
1
vote
1 answer

Optimization of piecewise functions in Julia

Extremely new to Julia, so please pardon any obvious oversights on my end I am trying to estimate a piecewise likelihood function through optimization. I have the code functional in R, but have begun translating it to Julia in the hopes of faster…
1
vote
1 answer

maximizing loglikelihood function with 3 parameters

i would like to find a,b, and c value that maximize this function. enter image description here which the constraint of enter image description here W are collected from a column of a dataframe, and a,b,c are the parameters that i need to find. help…
luca ronel
  • 11
  • 1
1
vote
0 answers

Assign cluster members using log-likelihood distance metric in python

I have 100 clusters, each with a mean and standard deviation value. These clusters are predefined using the SPSS software package, by using the 2-step cluster method. Therefore, the optimisation of these cluster distributions to fit the data has…
1
vote
0 answers

Error in application of the Rascola-Wagner model in R

I hope I don't have a big gap in education. I need to get the final best alpha - learning rate of the model, but I can't manage to get the function right. I have a data that looks something like this: ID Turn_no p_mean t_mean 1 1 170 99 1 …
LoveDekel
  • 21
  • 2
1
vote
0 answers

How to determine which starting values result in optimr() error message: L-BFGS-B needs finite values of 'fn'

I am using optimr to minimize a function that calculates the negative log likelihood for choice behavior. On some iterations, I receive the error message: ` Error in optim(par = par, fn = efn, gr = egr, lower = lower, upper = upper, : L-BFGS-B…
chester108
  • 11
  • 3
1
vote
0 answers

Tobit regressions in Ox

I'm trying to perform a tobit regression with the lower limited (left-)censoring at 0, in Ox (Cramer, 1987, chap 11). I followed the Ox documentation, but I'm still struggling to make it work. Here is my code: #include #include…
Tande
  • 31
  • 5
1
vote
0 answers

constrained optimisation using maxLik

I have read the maxLik document on how to do constrained optimization. However, I do not understand how I can do it. I have a custom likelihood function as below. The value of rho should be between 0 and 1 (making that two constraints). Now how…
Masimba
  • 31
  • 3
1
vote
0 answers

Linear Transformation of Dirichlet Distribution

I am wondering what is the best way to represent the probability distribution of a linearly transformed Dirichlet distribution: let {X = [x1, x2 ... xn] | Σxi = 1} be a set of multinomial probabilities that follow a Dirichlet distribution…
1
vote
0 answers

How To Use Multivariable Newton Raphson Method for Functions With Sum Loop

I'm currently trying to estimate parameters of a distribution with the mle method in Python. These are the derivative of my loglikelihood function: Loglikelihood Partial Derivatives As you can see it has a quite complicated formula and I would need…
1
vote
1 answer

Non-linear least squares in R: Error in eval(predvars, data, env) : object not found

I am trying to fit a gnls function in R and throws me an error that says: Error in eval(predvars, data, env) : object A not found Not sure where I am going wrong. set.seed(111) y.size <- rnorm(100,4,1) p <- rnorm(100,5,1) df <- data.frame(p,…
Rspacer
  • 2,369
  • 1
  • 14
  • 40
1
vote
1 answer

How to get coefficients from a model in R?

I am trying to store coefficients from a mle model just like a normally do for other models. Surprisingly, it throws an error. Any other methods to store it? set.seed(111) y.size <- rnorm(100,4,1) p <- rnorm(100,5,1) df <- data.frame(p,…
Rspacer
  • 2,369
  • 1
  • 14
  • 40
1
vote
1 answer

Estimating PDF with monotonically declining density at tails

tldr: I am numerically estimating a PDF from simulated data and I need the density to monotonically decrease outside of the 'main' density region (as x-> infinity). What I have yields a close to zero density, but which does not monotonically…
1
vote
0 answers

Estimating multiple interrelated parameters with mle2 (bbmle) and custom log likelihood function

To cut a long story short: I would like to estimate the parameter r of a utility function, which depends on demographic variables. I wrote a code for the utility function - that should be maximised -, transformed it into a log lik function and use…
Annika T
  • 11
  • 2
1
vote
0 answers

R cannot replicate results from Stata for log-likelihood maximization

I have been working on this algorithm all week, and I do not seem to find the problem. I employ Stata's NLSUR command for a simple QUAIDS maximization. Stata requires me to write a program evaluator in which I parametrize my system of equations as…
1
vote
1 answer

How to fit non-linear function to data in ggplot2 using maximum likelihood model in R?

The data set (x.test, y.test) is an exponential fit. I'm trying to fit a custom non-linear function and attached is the code. The regular points plot just fine but I'm unable to get the fit line to work. Any suggestions? x.test <-…
Rspacer
  • 2,369
  • 1
  • 14
  • 40