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
0
votes
1 answer

doing likelihood plot in R for binomial model

Can anybody tell me how do i plot the maximum likelihood values L(ˆθM, M) versus M for a suitable range of M values for the count data provided in frogs and then estimate the total number of frogs living in the pond and the probability of appearance…
0
votes
1 answer

Log Likelihood in maxLik function

I have a PDF of this where the t I got it from the inverse method. and the x from x<-rnorm(20,0,1). This is model from exponential parallel for survival analysis with covariate where I let lambda= b0+b1*x PDF = 2 * (b0+b1*x) * exp(-(b0+b1*x)*t) *…
0
votes
1 answer

Too large number coming from fortran: ValueError: Could not convert string to float: '0.22738+109'

I'm am trying to extract real values coming from a fortran file using np.loadtxt, the name of the file is fort.31 It seems a number is not taken into account by python: 0.22738+109 Do you have any idea on how to get over it? Here is my…
user10156341
0
votes
1 answer

MATLAB - Error in finding maximum likelihood estimates of parameters

The following MATLAB code is used by Dattatreya et al in the book ‘Angular Statistics’ to find the mle of a certain probability distribution. function [fun]=w_eiw_fminmle(X) th=[8 9 13 13 14 18 22 27 30 34383840 44 45 47 48 48 48 48 50 53 56 57…
Will
  • 190
  • 7
0
votes
1 answer

Calculation of log likelihood function of multinomial logistic regression in R

Suppose I have the following data set df=data.frame(x1=rnorm(100), #predictor 1 x2=rpois(100,2.5), #predictor 2 x3=rgeom(100,prob = 0.48), #predictor 3 y=as.factor(sample(1:3,100,replace = T)) #categorical…
Uddin
  • 754
  • 5
  • 18
0
votes
1 answer

Scipy differential evolution used with likelihood method

In my work, I'm trying to fit a model to data using a likelihood based method. I've had this code work before for slightly different models but for some reason it has been throwing this error when used with this model: "RuntimeError: The map-like…
0
votes
1 answer

Gradient descent isn't working for maximum likelihood with logistic probability in python

So i have been trying to run a gradient based algorathim using python and i am not getting a convergent result. ill take a picture of what i am trying to put into code: My code follows: #base packages #import sympy as sp #from sympy import * import…
0
votes
1 answer

Mixture Density Network (MDN) returning probabilities 1.0 & 0.0 only

I am building a mixture density network that attempts to forecast the distribution of one variable on two covariates. One of the covariates has hourly data while the other doesn't vary during the day (i.e., daily data). Prior work showed that 2…
0
votes
0 answers

emcee MCMC Sampling... Small set of walkers not converging?

I'm running mcmc on a simulation where I know the true parameter values. Suppose I use 100 walkers and 10,000 steps in the chain. The bulk of the walkers converge to the correct parameter values, but ~3 walkers (out of the 100) just trail off into…
Jsn
  • 107
  • 6
0
votes
1 answer

problem with starting values in optim function

I'm working on an optimization problem using the optim function. The function to maximize is a likelihood function. I'm trying a very long list of data sets to be evaluated, and in some cases It gets messy because the lik.function does not converge…
0
votes
1 answer

Maximum likelihood estimation using a step function

I would like to fit a step function (two parameters) to some data. The code below is not doing the job. I wonder if the round() argument is the problem. However, I also tried to divide the parameters to make small (e.g. 0.001) changes in the…
SimeonL
  • 165
  • 6
0
votes
1 answer

Replication of best log pseudolikelihood in Stata

I am running a multinomial logistic regression in Stata, and have found that the modelling procedure seems to finish before the log pseudolikelihood is completely replicated: Iteration 0: log pseudolikelihood = -144989.44 Iteration 1: log…
Alice
  • 99
  • 1
  • 9
0
votes
2 answers

How to keep BIC, AIC and maxloglikelihood in variables when using the method maxLogL

I am fitting some distribution with the method Maximizing the Likelihood. The method implemented in R "maxLogL" is an amazing tools that works great.…
ivangtorre
  • 661
  • 1
  • 8
  • 21
0
votes
1 answer

Is there an R function for evaluating the pdf for an ARIMA model given data and a parameter set?

I'm unfamiliar with R, but I've been able to write code that estimates parameters for an ARIMA model of whatever order to some data I have in a file. It looks like this: data <- read.table("ARMA22-series.csv", sep=" ", header=FALSE, dec=".") data <-…
joelnmdyer
  • 11
  • 2
0
votes
0 answers

How to interpret mle() trace = 6 output and why does the mle() procedure stop after 101 iterations in R?

I am trying to estimate seven constrained parameters with the function mle() using the L-BFGS-B method in R. In order to investigate why I get an non-finite finite-difference value [2] error, I include control = list(trace = 6) in the mle() function…
shofla
  • 43
  • 6