similar to: query on nlm() function

Displaying 20 results from an estimated 70000 matches similar to: "query on nlm() function"

2006 Nov 26
2
Quadratic Optimization
Hi, I need to solve an optimization problem in R having linear objective function and quadratic constraints(number of variables is around 80). What are the possible choices to do this in R. optim() function only allows box constrained problems. Is it possible in nlm()? Or please tell me if there is any other routine. Thanks Amit
2002 Mar 26
1
anova() for nlm or nls
Dear R community, I am currently fitting non-linear models using nlm and nls. 1) I would like to compare the different models analogous to the comparison of linear models with anova(). Is there a function in R which allows to do that? 2) I would like to constrain the parameter ranges to positive values only. Is there an option in nlm or nls which allows to constrain parameter ranges? (So far I
2003 Oct 17
2
nlm, hessian, and derivatives in obj function?
I've been working on a new package and I have a few questions regarding the behaviour of the nlm function. I've been (for better or worse) using the nlm function to fit a linear model without suppling the hessian or gradient attributes in the objective function. I'm curious as to why the nlm requires 31 iterations (for the linear model), and then it doesn't work when I try to add
2004 Aug 21
0
Convergence code in nlm function
Dear R users, I am using the nlm function for minimization of the very non-linear function of four parameters. I am running 100 simulations and almost always I get the convergence code =2 (Successive iterates within tolerance. Current iterate is probably solution.) [about 75 times of 100]. Frequently, 3 of 4 relative gradients are close to zero and the fourth is huge but there are also cases
2003 Oct 06
1
getting names of p vector in nlm function...
Dear R programming folks: I'm trying to finish off a package for non-linear simultaneous system estimation and I've been trying to figure out how to get the names of the parameter vector variables when inside the function that nlm calls to return the objective function value: knls <- function( theta, eqns, data, fitmethod="OLS", instr=NULL, S=NULL ) { ## print(
2007 Jun 15
0
Question with nlm
Hi, I would really appreciate if I could get some help here. I'm using nlm to minimize my negative log likelihood function. What I did is as follows: My log likelihood function (it returns negative log likelihood) with 'gradient' attribute defined inside as follows: # ==========Method definition====================== logLikFunc3 <- function(sigma, object, totalTime) { y <-
2004 Oct 12
2
constrained optimization using nlm/optim?
I'm looking for an example of a simple R script that impliments a contrained nonlinear function using nlm or optim. I'm not exactly sure how to impliment the constraints within the objective function that is passed to nlm/optim. obj.func <- function( p ) { x(p) <- unconstrained obj function value if( constraint1 > something ) { obj.func <- x(p) } else {
2007 Dec 22
1
using solve.qp without a quadratic term
I was playing around with a simple example using solve.qp ( function is in the quadprog package ) and the code is below. ( I'm not even sure there if there is a reasonable solution because I made the problem up ). But, when I try to use solve.QP to solve it, I get the error that D in the quadratic function is not positive definite. This is because Dmat is zero because I don't have a
2009 Sep 20
2
Quadratic Constraints
HI All, I am unable to solve a optimization Problem Please Help Me out of this to solve. The Optimization problem is as follows :- My objective function is linear and one of the constraint is quadratic. Min z = 5 * X1 + 9* X2 + 7.15 *X3 + 2 * X4 subject to X1 + X2 + X3 +X4 = 9 X1 + X4 < = 6.55 X3(X3 - 3.5) >=0 X1,X2,X3,X4 >=0 Now the problem is how to solve this kind of
2011 Apr 23
2
Could I use R function lm or nlm in C code?
Dear R, I'm doing some simulation work and it takes me a lot of time to do it in R. So I try to implement it in C code, but I want to use some R functions directly for my lazy and the robustness of code. For example, I will use lm and nlm in my program. How could I use R's lm and nlm function directly? I thinks these functions are not included in the R's include directory. Do I need
1999 Sep 29
1
nlm recursion problem
Hi I am trying to use nlm with an additional call to nlm within the function but after the first pass, the parameters to the outer call are being passed to the inner call. The inner call is a very trivial problem. ie: test.outer<-function(param.outer){ slope<-nlm(test.inner,param.inner) ... loglikelihood<-sum(...) return(-loglikelihood) } and nlm(test.outer,param.outer) on the
2013 Mar 19
0
linear model with equality and inequality (redundant) constraints
Dear R-users, in the last days I have been trying to estimate a normal linear model with equality and inequality constraints. Please find below a simple example of my problem. Of course, one could easily see that, though the constraints are consistent, there is some redundancy in the specific constraints. Nevertheless my actual applications can get much larger and I would not like to manually
1997 Nov 21
2
R-alpha: nlm and gradients
At present the documentation for nlm refers the reader to Dennis and Schnabel for details on the algorithms. It also states that the function is liable to change. Can anyone tell me if the current version of nlm uses only function values or if it can use gradients and Hessians when they are available? I would like to get an idea of how difficult it would be to port the development versions of
2016 Apr 26
0
Linear Regressions with constraint coefficients
This is a quadratic programming problem that you can solve using either a quadratic programming solver with constraints or a general nonlinear solver with constraints. See https://cran.r-project.org/web/views/Optimization.html for more info on what is available. Here is an example using a nonlinear least squares solver and non-negative bound constraints. The constraint that the coefficients sum
2002 Feb 19
1
Constrained optimisation
Hello, I need to solve a non-linear optimization with non-linear constraints. The 'nlm' routine does not seem to allow constraints. Is there a package for solving such problems in R? Thanks, John. -- ========================================== John Janmaat Department of Economics Acadia University, Wolfville, NS, B0P 1X0 (902)585-1461 All opinions stated are personal, unless
2008 Oct 14
0
nlm return wrong function value - garch fitting
I am using nlm to maximize a likelihood function. When I call the likelihood function (garchLLH) via nlm however, nlm returns the wrong value of the function. When I test the likelihood function manually I get the correct answer. I'm probably doing something really stupid, maybe someone can point it out for me. ###############this is the function i am trying to minimize ############
2003 Nov 17
0
gradient option in 'nlm' function
<FONT face="Default Sans Serif, Verdana, Arial, Helvetica, sans-serif" size=2><DIV>Dear list members,</DIV><DIV>&nbsp;</DIV><DIV>I am trying to use "nlm" function to maximize a mixture likelihood of beta densities. There are five unknown parameters in the likelihood. Since I can get the analytic gradient, I attach the "gradient"
2012 Oct 19
2
likelihood function involving integration, error in nlm
Dear R users, I am trying to find the mle that involves integration. I am using the following code and get an error when I use the nlm function d<-matrix(c(1,1,0,0,0,0,0,0,2,1,0,0,1,1,0,1,2,2,1,0),nrow=10,ncol=2) h<-matrix(runif(20,0,1),10) integ<-matrix(c(0),nrow=10, ncol=2) ll<-function(p){ for (k in 1:2){ for(s in 1:10){ integrand<-function(x)
2007 Sep 16
1
Problem with nlm() function.
In the course of revising a paper I have had occasion to attempt to maximize a rather complicated log likelihood using the function nlm(). This is at the demand of a referee who claims that this will work better than my proposed use of a home- grown implementation of the Levenberg-Marquardt algorithm. I have run into serious hiccups in attempting to apply nlm(). If I provide gradient and
1999 Jan 21
2
nlm question
Hello again Is there any way (or an alternative non-linear minimiser) that arguments to the function called in nlm can be passed in version 0.62.4? Like (I believe) nlmin in a well known other program or optimise in R. Do we use global variables? Shurely not! \John -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read