similar to: GLM output for deviance and loglikelihood

Displaying 20 results from an estimated 1300 matches similar to: "GLM output for deviance and loglikelihood"

2011 Oct 12
1
monotonic factors
Hello all, I have an ordered factor that I would like to include in the linear predictor of a binomial glm, where the estimated coefficients are constrained to be monotonic. Does anyone know how to do this? I've tried using an ordered factor but this does not have the desired effect, an (artificial) example of this follows; n <- 100 strings <- sample(c("low",
2011 May 12
1
Maximization of a loglikelihood function with double sums
Dear R experts, Attached you can find the expression of a loglikelihood function which I would like to maximize in R. So far, I have done maximization with the combined use of the mathematical programming language AMPL (www.ampl.com) and the solver SNOPT (http://www.sbsi-sol-optimize.com/manuals/SNOPT%20Manual.pdf). With these tools, maximization is carried out in a few seconds. I wonder if that
2006 Mar 31
1
loglikelihood and lmer
Dear R users, I am estimating Poisson mixed models using glmmPQL (MASS) and lmer (lme4). We know that glmmPQL do not provide the correct loglikelihood for such models (it gives the loglike of a 'pseudo' or working linear mixed model). I would like to know how the loglike is calculated by lmer. A minor question is: why do glmmPQL and lmer give different degrees-of-freedom for the same
2008 Jul 09
1
Loglikelihood for x factorial?
Hi Rers, I have a silly question. I don't know how to express the loglikelihood function of 1/(x!) where x=x1,x2,....xn in R. Could anyone give me a hint? Thank you in advance. Chunhao Tu
2012 Mar 29
2
How to calculate the Deviance for test data based on Cox model
Dear List, If I got a Cox model based on training set, then how should I calculate the Cox log partial likelihood for the test data? Actually I am trying to calculate the deviance on test dataset to evaluate the performance of prediction model, the equation is as follows: D = -2{L(test)[beta_train] - L(test)[0]}. It means using the beta coefficients got from training set to calculate the
2007 Feb 25
6
Wildcard expansion in remote files or recursion?
Hi all, [Please CC me in replies, I am not subscribed to this list.] First of all, thanks for puppet! It is a very nice tool and I''m in the (slow) process of using it to manage my new Xen-based virtual server farm with it. Most of the "simple" tasks worked well so far, and I may be able to add a few recipies to the Wiki when I find time to do so. However, is there any way
2011 Mar 14
0
nlysystemfit and loglikelihood values
Dear R-help, The documentation for systemfit shows that logLik() can be used to obtain loglikelihood values from linear systems estimated by systemfit(). It seems to me that logLik() cannot be used for nlsystemfit(). Does anyone know of any other packages that might let me obtain the loglikelihood of a model estimated with nlsystemfit()? Kind regards, Alex Olssen
2008 Jul 17
0
How to compute loglikelihood of Lognormal distribution
Hi, I am trying to learn lognormal mixture models with EM. I was wondering how does one compute the log likelihood. The current implementation I have is as follows, which perform really bad in learning the mixture models. __BEGIN__ # compute probably density of lognormal. dens <- function(lambda, theta, k){ temp<-NULL meanl=theta[1:k] sdl=theta[(k+1):(2*k)]
2008 May 22
1
Computing Maximum Loglikelihood With "nlm" Problem
Hi, I tried to compute maximum likelihood under gamma distribution, using nlm function. The code is this: __BEGIN__ vsamples<- c(103.9, 88.5, 242.9, 206.6, 175.7, 164.4) mlogl <- function(alpha, x) { if (length(alpha) > 1) stop("alpha must be scalar") if (alpha <= 0) stop("alpha must be positive") return(- sum(dgamma(x, shape = alpha, log = TRUE)))
2009 Jun 06
0
loglikelihood and AIC
Hi,  I tried fitting loglinear model using the glm(catspec). The data used is FHtab. . An independence model was fitted. Here summary() and fitmacro( ) give different values for AIC.   I understand that fitmacro( ) takes the likelilhood ratio L2(deviance) to calculate AIC and uses the formula AIC= L2- d.f(deviance)*2 and this AIC is used for comparison of nested models. (Am I right?)   The value
2009 Oct 27
1
Poisson dpois value is too small for double precision thus corrupts loglikelihood
Hi - I have a likelihood function that involves sums of two possions: L = a*dpois(Xi,theta1)*dpois(Yi,theta2)+b*(1-c)*a*dpois(Xi,theta1+theta3)*dpois(Yi,theta2) where a,b,c,theta1,theta2,theta3 are parameters to be estimated. (Xi,Yi) are observations. However, Xi and Yi are usually big (> 20000). This causes dpois to returns 0 depending on values of theta1, theta2 and theta3. My first
2011 Apr 10
1
MLE where loglikelihood function is a function of numerical solutions
Hi there, I'm trying to solve a ML problem where the likelihood function is a function of two numerical procedures and I'm having some problems figuring out how to do this. The log-likelihood function is of the form L(c,psi) = 1/T sum [log (f(c, psi)) - log(g(c,psi))], where c is a 2xT matrix of data and psi is the parameter vector. f(c, psi) is the transition density which can be
2001 Feb 15
2
deviance vs entropy
Hello, The question looks like simple. It's probably even stupid. But I spent several hours searching Internet, downloaded tons of papers, where deviance is mentioned and... And haven't found an answer. Well, it is clear for me the using of entropy when I split some node of a classification tree. The sense is clear, because entropy is an old good measure of how uniform is distribution.
2012 May 10
0
disagreement in loglikelihood and deviace in GLM with weights leads to different models selected using step()
In species distribution modeling where one uses a large sample of background points to capture background variation in presence\pseudo-absence or use\available models (0\1 response) it is frequently recommended that one weight the data so the sum of the absence weights is equal to the sum of presence weights so that the model isn?t swamped by an overwhelming and arbitrary number of background
2004 Sep 07
3
OT: firewalls
What is everyone using for a firewall? I'm currently using www.astaro.com but their recent releases have soured me on ASL as a practical solution on my hardware (1.2MHz Athlon, 30G, and 256M). I only have 4 computers going through the firewall wall but it's consistently at 50% cpu load. There is very little network traffic (<10k bits per second on the wan connection, < 40k
2011 Jun 08
2
Results of CFA with Lavaan
I've just found the lavaan package, and I really appreciate it, as it seems to succeed with models that were failing in sem::sem. I need some clarification, however, in the output, and I was hoping the list could help me. I'll go with the standard example from the help documentation, as my problem is much larger but no more complicated than that. My question is, why is there one latent
2012 Nov 30
2
NA return to NLM routine
Hello, I am trying to understand a small quirk I came across in R. The following code results in an error: k <- c(2, 1, 1, 5, 5) f <- c(1, 1, 1, 3, 2) loglikelihood <- function(theta,k,f){ if( theta<1 && theta>0 ) return(-1*sum(log(choose(k,f))+f*log(theta)+(k-f)*log(1-theta))) return(NA) } nlm(loglikelihood ,0.5, k, f ) Running this code results in: Error
2004 Sep 22
3
Strange DNAT problems with shorewall 1.4.8
I''ve had some issues with my network, and I''ve had to reconfigure my Gibraltar CD. It runs shorewall 1.4.8, and I have a 2-interface setup, so I downloaded the relevant files from the install page. Masq and such works, but I''m having a problem with my port forwarding. It works for port 22, but it doesn''t seem to work for any other port. I''ve turned
2007 May 24
3
Problem with numerical integration and optimization with BFGS
Hi R users, I have a couple of questions about some problems that I am facing with regard to numerical integration and optimization of likelihood functions. Let me provide a little background information: I am trying to do maximum likelihood estimation of an econometric model that I have developed recently. I estimate the parameters of the model using the monthly US unemployment rate series
2010 Dec 07
1
Using nlminb for maximum likelihood estimation
I'm trying to estimate the parameters for GARCH(1,1) process. Here's my code: loglikelihood <-function(theta) { h=((r[1]-theta[1])^2) p=0 for (t in 2:length(r)) { h=c(h,theta[2]+theta[3]*((r[t-1]-theta[1])^2)+theta[4]*h[t-1]) p=c(p,dnorm(r[t],theta[1],sqrt(h[t]),log=TRUE)) } -sum(p) } Then I use nlminb to minimize the function loglikelihood: nlminb(