search for: loglike

Displaying 20 results from an estimated 857 matches for "loglike".

Did you mean: loglik
2004 Jul 01
2
Individual log likelihoods of nlsList objects.
Hello all. I was wondering if the logLike.nls() and logLike.nlme() functions are still being used. Neither function seems to be available in the most recent release of R (1.9.1). The following is contained in the help file for logLik(): "classes which already have methods for this function include: 'glm', 'lm', 'nl...
2011 Jan 24
2
how to get loglik parameter from splm package?
splm package is a r implemention of spatial panel data models. and the loglik paremeter is most important infomation for splm methods. but i found the loglik always been null ,it's craze to get right estimation in splm with null loglik. Any one knows the splm package and can get the right loglik ? please help me. thanks -- View this message in context:
2009 Sep 23
1
Strange behaviour with global variable in C
I understand global variables can be a bad idea, but even so I would like to understand what is going on here... ### DESCRIPTION OF PROGRAM ### ...I have a strange bug on a global variable in some C code which I am compiling using $ MAKEFLAGS="CFLAGS=-g -O0" R CMD SHLIB myProgram.c the global variable in question is the log likelihood. In an old version of the program I initialized
2023 Aug 29
1
logLIk(lme(...))?
Hello, all: I have a dataset with 2 groups. I want to estimate 2 means and 2 standard deviations. I naively think I should be able to use lme to do that, e.g., lme(y~gp, random=y~1|gp, method='ML'). I think I should get the same answer as from lm(y~1, ...) within each level of group. I can get the same means, but I don't know how to extract the within-gp standard
2011 Oct 06
1
sum of functions
Dear all, I would like to create a code for semiparametric Klein and Spady's estimator. For that I created a function that provides the log-likelihood function for each observation (so it is a function of betas and i, where i denotes the observation). Now, in order to maximize the log-likelihood function, I have to sum these log-likelihood functions for each i and so to get another function
2008 Mar 20
1
logLik calculations
Does the ?logLik? function applied to a ?glm? and ?glm.nb? (from MASS package) calculate the complete log-likelihoods, or does it drop the constant terms of the equation? (It?s not clear from the associated help pages, and I?ve found no reference from searching the R help mailing list) Thank you, Kelly Young
2006 Feb 22
2
does multinomial logistic model from multinom (nnet) has logLik?
I want to get the logLik to calculate McFadden.R2 ,ML.R2 and Cragg.Uhler.R2, but the value from multinom does not have logLik.So my quetion is : is logLik meaningful to multinomial logistic model from multinom?If it does, how can I get it? Thank you! ps: I konw VGAM has function to get the multinomial logistic model with logLik, but I prefer use the function from "official" R
2011 Apr 11
1
pseudo-R by hand
hello dear list! since we want to do a model analysis and some people would like to see pseudo-R^2 values for different types of glm of a logistic regression, i've decided to write a function that computes either nagelkerkes normed pseudo-R or cox & snells pseudo-R. however, i am not clear as in the decisive step, i need to calculate the log of (maximum likelihood estimates of model
2001 Aug 28
2
fitting a mixture of distributions with optim and max log likelihood ?
...seq(1:npnt)){ if(runif(1,0,1)<=p2){ rv[i]<-rnorm(1,m2,s2) } else{ rv[i]<-rnorm(1,m1,s1) } } return(rv) } x <- rtwonormals(50000,0,100,500,500,0.05) #and I try to fit these with (based on thread: [R] Estimating Weibull Distribution Parameters - very basic question) loglike<-function(p) -2*sum(log((1-p[5])*dnorm(x,p[1],p[2])+p[5]*dnorm(x,p[3],p[4]))) optim(c(-20,150,400,600,.035),loglike) optim(c(20,70,600,400,.095),loglike) optim(c(0,100,500,500,.05),loglike) optim(c(-20,150,400,600,.035),loglike) # three different starting values (1 and 4 the same to check repro...
2006 Dec 30
3
wrapping mle()
Hi, How can we set the environment for the minuslog function in mle()? The call in this code fails because the "ll" function cannot find the object 'y'. Modifying from the example in ?mle: library(stats4) ll <- function(ymax=15, xhalf=6) { -sum(stats::dpois(y, lambda=ymax/(1+x/xhalf), log=TRUE)) } fit.mle <- function(FUN, x, y) { loglik.fun <- match.fun(FUN)
2005 Apr 19
1
behaviour of logLik and lme
Dear all, when performing a meta analysis I have two results obtained with logLik and lme, which I do not quite understand. The results are based on these data: study or var 1 0.10436 0.299111 2 -0.03046 0.121392 3 0.76547 0.319547 4 -0.19845 0.025400 5 -0.10536 0.025041 6 -0.11653 0.040469 7 0.09531 0.026399 8 0.26236 0.017918 9 -0.26136 0.020901 10 0.45742 0.035877 11
2006 Jun 05
2
Calculation of AIC BIC from mle
R 2.3.0, all packages up to date Linux, SuSE 10.0 Hi I want to calculate AIC or BIC from several results from mle calculation. I found the AIC function, but it does not seem to work with objects of class mle - If I execute the following: ml1 <- mle(...) AIC(ml1) I get the following error messale: Error in logLik(object) : no applicable method for "logLik" Therefore I am using the
2010 May 18
1
BIC() in "stats" {was [R-sig-ME] how to extract the BIC value}
>>>>> "MM" == Martin Maechler <maechler at stat.math.ethz.ch> >>>>> on Tue, 18 May 2010 12:37:21 +0200 writes: >>>>> "GaGr" == Gabor Grothendieck <ggrothendieck at gmail.com> >>>>> on Mon, 17 May 2010 09:45:00 -0400 writes: GaGr> BIC seems like something that would logically go into stats
2009 Jul 15
1
GLM Gamma Family logLik formula?
Hello all, I was wondering if someone can enlighten me as to the difference between the logLik in R vis-a-vis Stata for a GLM model with the gamma family. Stata calculates the loglikelihood of the model as (in R notation) some equivalent function of -1/scale * sum(Y/mu+log(mu)+(scale-1)*log(Y)+log(scale)+scale*lgamma(1/scale)) where scale (or dispersion) = 1, Y = the response variable, and mu is the fitted values given by the fitted model. R seems to use a very similar approa...
2002 Sep 27
2
question regarding lm and logLik in R
It appears that the degrees of freedom reported by logLik changed between R 1.4.1 and R 1.5.1. Is this true? Detail: > I have been using the lm and logLik functions in R to develop code using > version 1.4.1. When I run it on version 1.5.1, I'm getting different > degrees of freedom with the logLik function. Version 1.5.1 seems to give > one extra degree of freedom than
2003 Mar 17
1
help with likelihood contour plot
Can some kind person point out my error here? I'm trying to set up a grid for a countour plot of a likelihood function. > u <- rnorm(20,9.5,2.5) > # sample of size 20 from N(9.5,2.5^2) > loglik <- function(th1,th2) { + n <- length(u) + -(n/2)*log(2*pi*th2^2)-0.5*sum((u-th1)^2/th2^2) + } > x <- seq(4.5,14.5,len=50) > y <- seq(0.5,6,len=50) > f <-
2013 Jan 31
1
LogLik of nls
Hello there, Can anyone point me to the code for logLik of an nls object? I found the code for logLik of an lm but could not find exactly what function is used for calculating the logLik of nls function? I am using the nls to fit the following model to data - Model 1: y ~ Ae^(-mx) + Be^(-nx) +c and want to understand what is the likelihood function used by nls. Presumably it is using -
2012 Jan 20
1
nobs() and logLik()
Dear all, I am studying a bit the various support functions that exist for extracting information from fitted model objects. From the help files it is not completely clear to me whether the number returned by nobs() should be the same as the "nobs" attribute of the object returned by logLik(). If so, then there is a slight inconsistency in the methods for 'nls' objects with
2009 Feb 02
2
logLik for poisson models
Dear all, I have a very basic question: how does the logLik function work for poisson models? Example: I simulate 20 observations from a Poisson distribution with mean 800. y <- rpois(20,800) model <- glm(y ~ 1, family=poisson()) logLik(model) I would like to know what's the exact formula the function logLik uses. I looked at ?extractAIC but I cannot sort it out. Can you please
2008 Oct 16
1
lmer for two models followed by anova to compare the two models
Dear Colleagues, I run this model: mod1 <- lmer(x~category+subcomp+category*subcomp+(1|id),data=impchiefsrm) obtain this summary result: Linear mixed-effects model fit by REML Formula: x ~ category + subcomp + category * subcomp + (1 | id) Data: impchiefsrm AIC BIC logLik MLdeviance REMLdeviance 4102 4670 -1954 3665 3908 Random effects: Groups Name Variance