search for: negloglik

Displaying 14 results from an estimated 14 matches for "negloglik".

2009 Aug 20
1
Understanding R code
What is 1. par.ests <- optimfit$par 2. fisher <- hessb(negloglik, par.ests, maxvalue=maxima); 3. varcov <- solve(fisher); 4. par.ses <- sqrt(diag(varcov)); Thanks a lot, fit.GEV <- function(maxima) { sigma0 <- sqrt((6. * var(maxima))/pi) mu0 <- mean(maxima) - 0.57722 * sigma0 xi0 <- 0.1 theta <- c(xi0, mu0, sigma0) #10/5/2007: removed ass...
2009 Jul 02
1
Quantitative Risk Management by McNeil
...v") > Transpose<-t(Return) > fit.NH(Transpose, case="NIG", symmetric=FALSE, se=FALSE) Error: cannot allocate vector of size 57 Kb In addition: Warning messages: 1: In var.default(data) : Reached total allocation of 222Mb: see help(memory.size) 2: In optim(par = theta, fn = negloglik, gr = NULL, datavector = data, : Reached total allocation of 222Mb: see help(memory.size) 3: In optim(par = theta, fn = negloglik, gr = NULL, datavector = data, : Reached total allocation of 222Mb: see help(memory.size) In the attachment you can find the description of the function. the lin...
2004 Jul 14
1
Running the optimization on the subset of parameters
Dear all, I'd like to find a minimum of (-loglik) function which is a function of k parameters. I'd like to run the minimization algorithm for the different subsets of the parameters and assign the fixed values to the complementary subset. How should I define my (-loglik) function such that it can be passed to the optim or other optimization function? Much thanks for any suggestions.
2008 May 23
1
maximizing the gamma likelihood
...und that the analytical mle of the scale is equal to 1/ analytical mle(shape). and my estimates aren't consistent with that fact ? this leads me to assume that my estimates are not correct. can anyone tell me what i'm doing wrong. maybe my starting values are too far off ? thanks. make.negloglik <- function(data, fixed=c(FALSE,FALSE)) { op <- fixed function(p) { op[!fixed] <- p shape <- exp(op[1]) scale <- exp(op[2]) a <- length(data)*shape*log(scale) b <- (shape-1)*sum(log(data)) c <- -1.0*scale*sum(data) -(a + b + c) }...
2007 Dec 04
2
weighted Cox proportional hazards regression
...t;pseudotime"), class = "data.frame", row.names=1:24) coxph( Surv(pseudotime, cc) ~ x + strata(riskset), weights=wt, robust=T, method="breslow",data=d2) I'm expecting a value of about 0.63 to 0.64 based on the data source (simulated) and the following hand-coded MLE: negloglik = function(beta,dat) { dat$wexb = dat$wt * exp(dat$x * beta) agged = aggregate(dat$wexb,list(riskset=dat$riskset),sum) names(agged)[2] = "denom" dat = merge(dat[dat$cc==1,],agged,by="riskset") -sum(log(dat$wexb)-log(dat$denom)) } nlm(negloglik,0,hessian=T,dat=d2) Am...
2006 Sep 14
1
EBAM ERROR
...-missing values. The d-value of these genes is set to NA. The following object(s) are masked _by_ .GlobalEnv : n The following object(s) are masked from mat.repeat ( position 5 ) : center log.bino n p success x1 x2 x3 x4 x5 Error in optim(rep(0, 6), neglogLik.repeat, method = "BFGS") : non-finite finite-difference value [1] In addition: Warning message: collapsing to unique 'x' values in: approx(Z, Z.norm, z, rule = 2) ------------------------------------------------------------------------------------------------------------...
2004 Aug 10
1
Question about mle function
Dear all, I'd like to find the mle esttimates using the mle function mle(negloglik, start = list(), fixed=list(), method="..."). I am using the L-BGFS-B method and I don't supply the gradient function. Is there a way to print the gradients found at the solution value? I am using R-1.9.1 on Windows and on Unix. Thank you in advance, Victoria Landsman. [[...
2006 Sep 14
0
Help On EBAM
...-missing values. The d-value of these genes is set to NA. The following object(s) are masked _by_ .GlobalEnv : n The following object(s) are masked from mat.repeat ( position 5 ) : center log.bino n p success x1 x2 x3 x4 x5 Error in optim(rep(0, 6), neglogLik.repeat, method = "BFGS") : non-finite finite-difference value [1] In addition: Warning message: collapsing to unique 'x' values in: approx(Z, Z.norm, z, rule = 2) ------------------------------------------------------------------------------------------------------------...
2005 Mar 07
1
information on maximum likelihood
Hello, I have a time series that contains 40 years of daily average temperature. I am attempting to create a time series model for the temperature based on a number of papers that do the same. I have an expression that describes the temperature behavior over time but it contains 7 unknown parameters. The authors of the aforementioned papers state that they calculate the parameters using MLE
2004 Oct 05
1
Bug in optim - way to solve problem?
...e data sets, and call the funtion "likfit" (in package geoR) from within a for-loop. "likfit" does again call "optim". After ssuccessfully fitting variograms to some of the data sets, the procedure crashes and I get the error message: Error in optim(par = ini, fn = negloglik.GRF, method = "L-BFGS-B", lower = lower.optim, : non-finite value supplied by optim When I restart the procedure with the data set that first caused the error, it is usually possible to fit the variogram successfully for this data set, but the procedure will crash when fitti...
2010 Jan 26
6
Help
...= 4 > N_T = 6 > > dat$x = log(dat$D) > dat$p = dat$M / (dat$L+dat$M) > dat$InvT = 1/dat$T > dat$glm1= log(1-dat$p) > > negloglike = function(parms, dat){ > > pp = design%*%parms > p = 1-exp(pp) > > obj = 0 > t_D = 0 > for(d in 1:N_D){ > for(t i...
2008 Nov 08
3
Fitting a modified logistic with glm?
Hi all, Where f(x) is a logistic function, I have data that follow: g(x) = f(x)*.5 + .5 How would you suggest I modify the standard glm(..., family='binomial') function to fit this? Here's an example of a clearly ill-advised attempt to simply use the standard glm(..., family='binomial') approach: ######## # First generate some data ######## #define the scale and location of
2013 Jul 17
2
error message in gev
  Hi r-users,   I would like to use gev and my data (annual rainfall ) is as follows:   > head(dat,20) A B C D E F G H I J 1 45.1 41.5 58.5 50.1 46.0 49.1 37.7 49.1 59.8 54.0 2 50.3 39.8 49.4 56.4 49.4 48.8 42.1 49.8 49.4 58.3 3 41.7 39.3 44.6 39.1 35.7 41.5 40.8 40.8 38.5 45.6 4 50.7 33.9 48.4 28.2 35.5 39.1 61.4 17.0 30.7 38.3 5 39.3 30.6 46.9 23.8 25.8
2007 May 02
3
ED50 from logistic model with interactions
Hi, I was wondering if someone could please help me. I am doing a logistic regression to compare size at maturity between 3 seasons. My model is: fit <- glm(Mature ~ Season * Size - 1, family = binomial, data=dat) where Mature is a binary response, 0 for immature, 1 for mature. There are 3 Seasons. The Season * Size interaction is significant. I would like to compare the size at 50%