similar to: LogLik of nls

Displaying 20 results from an estimated 20000 matches similar to: "LogLik of nls"

2012 Dec 16
1
nls for sum of exponentials
Hi there, I am trying to fit the following model with a sum of exponentials - y ~ Ae^(-md) + B e^(-nd) + c the model has 5 parameters A, b, m, n, c I am using nls to fit the data and I am using DEoptim package to pick the most optimal start values - fm4 <- function(x) x[1] + x[2]*exp(x[3] * -dist) + x[4]*exp(x[5] * -dist) fm5 <- function(x) sum((wcorr-fm4(x))^2) fm6 <- DEoptim(fm5,
2002 Nov 15
2
bug in logLik.nls (PR#2295)
logLik.nls does not count the df's correct. I get df=1 although I fit a probit-model with 3 parameters. Example: x <- c(-2.3, -2.0, -1.3, -1.0, -0.7, -0.3, 0.0, 0.3) y <- c(80, 80, 54, 43, 24, 18, 12, 12) fit.nls <- nls(y ~ diff * pnorm(beta * (x - alpha)), start=c(alpha=-1, beta=-1, diff=100)) logLik.nls(fit.nls) # `log Lik.' -21.43369 (df=1) Sincerely
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
2011 Jun 12
1
Error in NLS example in the documentation
Hello there, I am trying to use R function NLS to analyze my data and one of the examples in the documentation is - ## the nls() internal cheap guess for starting values can be sufficient: x <- -(1:100)/10 y <- 100 + 10 * exp(x / 2) + rnorm(x)/10 nlmod <- nls(y ~ Const + A * exp(B * x), trace=TRUE) plot(x,y, main = "nls(*), data, true function and fit, n=100") curve(100 +
2011 Jun 12
2
NLS fit for exponential distribution
Hello there, I am trying to fit an exponential fit using Least squares to some data. #data x <- c(1 ,10, 20, 30, 40, 50, 60, 70, 80, 90, 100) y <- c(0.033823, 0.014779, 0.004698, 0.001584, -0.002017, -0.003436, -0.000006, -0.004626, -0.004626, -0.004626, -0.004626) sub <- data.frame(x,y) #If model is y = a*exp(-x) + b then fit <- nls(y ~ a*exp(-x) + b, data = sub, start
2011 Sep 20
1
NLS error
Hello there, I am using NLS for fitting a complex model to some data to estimate a couple of the missing parameters. The model is - y ~ (C+((log(1-r))*exp(-A*d)*(-1+r+exp(d*(A-B)))/(r*(-A*d+d*B+log(1-r))))) where A, B and C are unknown. In order to test the model, I generate data by setting values for all parameters and add some noise (C). A <- 20 B <- 500 r <- 0.6881 d <-
2006 Feb 07
1
sampling and nls formula
Hello, I am trying to bootstrap a function that extracts the log-likelihood value and the nls coefficients from an nls object. I want to sample my dataset (pdd) with replacement and for each sampled dataset, I want to run nls and output the nls coefficients and the log-likelihood value. Code: x<-c(1,2,3,4,5,6,7,8,9,10) y<-c(10,11,12,15,19,23,26,28,28,30) pdd<-data.frame(x,y)
2003 Jan 15
2
Bug or Feature? LogLik.nls and non-central F distribution.
I have a dataset that I am running non-linear regression on via the following code: Hill <- function(E0,Em,C50,g,C){ # # Hill is the hill interaction function. # # E0 Represents the minimum interaction Effect # # Em Represents the Maximum Interaction Effect # # C50 represents the concentration at which 50% of the effect occurs. # # gamma represents the cooperativity of the
2004 Jul 16
1
Does AIC() applied to a nls() object use the correct number of estimated parameters?
I'm wondering whether AIC scores extracted from nls() objects using AIC() are based on the correct number of estimated parameters. Using the example under nls() documentation: > data( DNase ) > DNase1 <- DNase[ DNase$Run == 1, ] > ## using a selfStart model > fm1DNase1 <- nls( density ~ SSlogis( log(conc), Asym, xmid, scal ), DNase1 ) Using AIC() function: >
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', 'nls' and 'gls', 'lme' and others in
2006 Jan 19
1
nls profiling with algorithm="port" may violate bounds (PR#8508)
[posted to R-devel, no discussion: resubmitting it as a bug, just so it gets logged appropriately] Sorry to report further difficulties with nls and profiling and constraints ... the problem this time (which I didn't check for in my last round of testing) is that the nls profiler doesn't seem to respect constraints that have been set when using the port algorithm. See test code
2012 Mar 19
1
Linear regression
Hello there, I am new to using regression in R. I wanted to solve a simple regression problem where I have 2 equations and 2 unknowns. So lets say - y1 = alpha1*A + beta1*B y2 = alpha2*A + beta2*B y1 <- runif(100000, 0,1) y2 <- runif(100000,0,1) alpha1 <- 0.6 alpha2 <- 0.75 beta1 <- 1-alpha1 beta2 <- 1-apha2 I now want this equation to estimate the values of A and B. Both A
2008 Jun 16
1
Error in maximum likelihood estimation.
Dear UseRs, I wrote the following function to use MLE. --------------------------------------------- mlog <- function(theta, nx = 1, nz = 1, dt){ beta <- matrix(theta[1:(nx+1)], ncol = 1) delta <- matrix(theta[(nx+2):(nx+nz+1)], ncol = 1) sigma2 <- theta[nx+nz+2] gamma <- theta[nx+nz+3] y <- as.matrix(dt[, 1], ncol = 1) x <- as.matrix(data.frame(1,
2010 Feb 16
1
nls.lm & AIC
Hi there, I'm a PhD student investigating growth patterns in fish. I've been using the minpack.lm package to fit extended von Bertalanffy growth models that include explanatory covariates (temperature and density). I found the nls.lm comand a powerful tool to fit models with a lot of parameters. However, in order to select the best model over the possible candidates (without covariates,
2013 Jan 03
1
nls problem with iterations
Hi, I am using the nls function and it stops because the number of iterations exceeded 50, but i used the nls.control argument to allow for 500 iterations. Do you have any idea why it's not working? fm1 <- nls(npe ~ SSgompertz(npo, Asym, b2, b3), data=f,control=nls.control(maxiter=500)) Thanks for your help, Cheers, Karine.
2005 Apr 18
2
Why no BIC.default function?
I'm using R 2.0.1. I looked in the email archives but didn't see anything on this topic. I've noticed a surprising (to me) difference between AIC and BIC: > methods("AIC") [1] AIC.default* AIC.logLik* > methods("BIC") [1] BIC.gls* BIC.lm* BIC.lme* BIC.lmList* BIC.logLik* BIC.nls* The BIC.gls BIC.lm BIC.lme BIC.lmList and BIC.nls functions appear
2012 Jun 05
1
nls: how do you know if the model is significant?
Hi all, I'm struggling with nls. How do you know if your model is significant? For a lm, you get a p-value, but you don't get it for a nls. Is there a way to calculate it? For a lm I use this: a<-summary(lm(model ~obs)) f.stat<-a$fstatistic p.value<-1-pf(f.stat["value"],f.stat["numdf"],f.stat["dendf"]) Is there something similar for a nls?
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
2012 Jul 12
2
nls question
 Hi:  Using nls how can I increase the numbers of iterations to go beyond 50.  I just want to be able to predict for the last two weeks of the year.  This is what I have:  weight_random <- runif(50,1,24)  weight <- sort(weight_random);weight weightData <- data.frame(weight,week=1:50)                          weightData plot(weight ~ week, weightData) M_model <- nls(weight ~ alpha +
2012 May 02
2
Problem with 'nls' fitting logistic model (5PL)
Dear R-Helpers, I'm working with immunoassay data and 5PL logistic model. I wanted to experiment with different forms of weighting and parameter selection, which is not possible in instrument software, so I turned to R. I am using R 2.14.2 under Win7 64bit, and the 'nls' library to fit the model - I started with the same model and weighting type (1/y) as in the instrument to see