search for: nleqslv

Displaying 20 results from an estimated 53 matches for "nleqslv".

2017 Jun 12
2
Possible with enableJIT function
In this email to the R-help list: https://stat.ethz.ch/pipermail/r-help/2017-June/447474.html and in this question on Stackoverflow: https://stackoverflow.com/questions/44486643/nleqslv-memory-use-in-r Andrew Leach has raised a question about the memory usage of my package nleqslv. In a model with a loop within a function he has experienced continuously increasing memory usage by package nleqslv leading to an out of memory condition. I have been able to reproduce the continuousl...
2017 Jun 13
0
Possible with enableJIT function
...in R-devel(r72788) and R-patched (r72789) Best, luke On Mon, 12 Jun 2017, Berend Hasselman wrote: > > > In this email to the R-help list: https://stat.ethz.ch/pipermail/r-help/2017-June/447474.html > and in this question on Stackoverflow: https://stackoverflow.com/questions/44486643/nleqslv-memory-use-in-r > > Andrew Leach has raised a question about the memory usage of my package nleqslv. > In a model with a loop within a function he has experienced continuously increasing memory usage > by package nleqslv leading to an out of memory condition. > > I have been able...
2012 Mar 20
2
SE from nleqslv
Dear R-users, I use the "nleqslv" function to get parameter estimates by solving a system of non-linear equations. But I also need standard error for each of estimates. I checked the nleqslv manual but it didn't mention about SE. Is there any way to get the SE for each estimate? Thank you very much. [[alternative HTML...
2017 Jun 11
1
Memory leak in nleqslv()
Hello all, I am relatively new to R, but enjoying it very much. I am hoping that someone on this list can help me with an issue I am having. I am having issues with iterations over nleqslv, in that the solver does not appear to clean up memory used in previous iterations. I believe I've isolated the/my issue in a small sample of code: library(nleqslv) cons_ext_test <- function(x){ rows_x <- length(x)/2 x_1 <- x[1:rows_x] x_2 <- x[(rows_x+1):(rows_x*2)] eq1<- x_1-...
2017 Aug 11
0
Package nleqslv ERROR
Just to set things straight: The error message "Error in nleqslv(xstart, fun) : Length of fn result <> length of x!" is issued by the underlying nleqslv C function. <fn> refers to the second argument of function nleqslv which is named fn. It is not issued by R itself. Other have already pointed out how to resolve the error. Berend Hasselman
2012 Dec 04
1
Solve system of equations (nleqslv) only returns origin
...ecause they are straight from a published paper and I checked them pretty thoroughly. The parameter values I used are from the published paper as well. Any suggestions for how I can find the maximum non-zero solution instead of going straight to the minimum? Thanks! Alicia install.packages("nleqslv", lib="Users/Alicia/Documents/R.Codes/R.Packages/") require(nleqslv) ###### Global Parameters ############ beeta=0.8 pq=10000 L=12600 theta=0.6 psale=0.6 mu=psale*(1-theta) alphah=0.15 Cg=6240 Cs=2820 A= 100 D=0.0001 greekp=0.43 K=100000 ##### Species Parameters ########## b1=0.3...
2014 Aug 25
3
dubious behaviour of match.arg() with nested functions.
Dear all, I initially ran into this problem while rebuilding a package dependent on nleqslv. I got the following error: Error in match.arg(global) : 'arg' must be of length 1 This didn't occur in previous versions of nleqslv, but did in the current one (2.4). I think I pinned the problem down to the following example: Take two functions: test <- function(x=c("q&quo...
2017 Aug 09
2
Package nleqslv ERROR
...f[4] <- 1*x[2] > 1 f } Result <- matrix(0,nrow=9*9*9,ncol=6) startx<-c(16350, 1.33) indx <- 1 for (i in 1:9) { for (j in 1:9) { for (k in 1:9) { f.startx <- fun(startx) if(anyNA(f.startx)) { Result[indx,1:3] <- NA } else { z <- nleqslv(startx,fun) Result[indx,1:3] <- c(z$termcd,z$x) } Result[indx,4:6] <- c(i,j,k) indx <- indx+1 } } } The error i get when solving for specific values of ALPHA, BETA and GAMMA, not using the loop is: Error in nleqslv(xstart, fun) : Length of fn result <&...
2010 Jul 29
7
newton.method
...=-38.4762403). The answer should be around 0.01-0.1. This function should converge.. Even for a simple function like f(x) = exp(-x) * x, it gives answer as 8.89210984 for which f(x) = 0.001222392 and I set tolerance to 10^-12.. Also, is there a non graphical version of newton method? I looked at nleqslv but have no idea how to use it.. Thanks for your help. -- View this message in context: http://r.789695.n4.nabble.com/newton-method-tp2306111p2306111.html Sent from the R help mailing list archive at Nabble.com.
2017 Aug 09
0
Package nleqslv ERROR
...<- matrix(0,nrow=9*9*9,ncol=6) > startx<-c(16350, 1.33) > indx <- 1 > for (i in 1:9) { > for (j in 1:9) { > for (k in 1:9) { > f.startx <- fun(startx) > if(anyNA(f.startx)) { > Result[indx,1:3] <- NA > } else { > z <- nleqslv(startx,fun) > Result[indx,1:3] <- c(z$termcd,z$x) > } > Result[indx,4:6] <- c(i,j,k) > indx <- indx+1 > } > } > } > > > The error i get when solving for specific values of ALPHA, BETA and GAMMA, not using the loop is: > > Error...
2017 Feb 09
3
Ancient C /Fortran code linpack error
...> I'm using the .C interface for calling C code. > > > > Any thoughts on how to best handle the situation? Is this a bug in dpoco? Is there a simple way to test for any NaNs in a vector? > You should/could use macro R_FINITE to test each entry of the hessian. > In package nleqslv I test for a "correct" jacobian like this in file nleqslv.c in function fcnjac: > for (j = 0; j < *n; j++) > for (i = 0; i < *n; i++) { > if( !R_FINITE(REAL(sexp_fjac)[(*n)*j + i]) ) > error("non-finite value(s) returned by j...
2011 Aug 14
1
Solving a equation
Hi there, I have following equations to be solved for a and b: a/(a+b) = x1 ab/((a+b)^2 (a+b+1)) = x2 Is there any direct function available to solve them without disentangling them manually? Thanks for your help.
2012 Jul 23
2
Solving equations in R
Hi there, I would like to solve the following equation in R to estimate 'a'. I have the amp, d, x and y. amp*y^2 = 2*a*(1-a)*(-a*d+(1-a)*x)^2 test data: amp = 0.2370 y= 0.0233 d= 0.002 x= 0.091 Can anyone suggest how I can set this up? Thanks, Diviya [[alternative HTML version deleted]]
2012 Sep 09
1
Solving a system of two equations
Hi, I am trying to find a simple way to numerically solve a system of two equations equal to zero with two unknowns (x_loc and y_loc). Here is a mock data set and below it, the equations I need to solve. theta<-c(180,135,90)/(2*pi) x<-c(0,0,15) y<-c(20,0,0) 0 = -sum((y_loc-y)*(sin(theta)*(x_loc-x)-cos(theta)*(y_loc-y))/(((x_loc-x)^2+(y_loc-y)^2)^0.5)^3) 0 =
2010 Mar 11
4
help about solving two equations
I have two matrix s1 and s2, each of them is 1000*1. and I have two equations: digamma(p)-digamma(p+q)=s1, digamma(q)-digamma(p+q)=s2, and I want to sovle these two equations to get the value of x and y, which are also two 1000*1 matrices. I write a program like this: f <- function(x) { p<- x[1]; q <- x[2]; ((digamma(p)-digamma(p+q)-s1[2,]) )^2 +((digamma(q)-digamma(p+q)-s2[2,]) )^2
2011 Dec 19
1
None-linear equality constrained optimisation problems
Dear R users, I have a problem. I would like to solve the following: I have pL = 1/(1+e^(-b0+b1)) pM = 1/(1+e^(-b0)) pH = 1/(1+e^(-b0-b1)) My target function is TF= mean(pL,pM,pH) which must equal 0.5% My non-linear constraint is nl.Const = 1-(pM/pH), which must equal 20%, and would like the values of both b0 and b1 where these conditions are met. I have searched widely for an answer,
2017 Feb 09
3
Ancient C /Fortran code linpack error
In my package 'glmmML' I'm using old C code and linpack in the optimizing procedure. Specifically, one part of the code looks like this: F77_CALL(dpoco)(*hessian, &bdim, &bdim, &rcond, work, info); if (*info == 0){ F77_CALL(dpodi)(*hessian, &bdim, &bdim, det, &job); ........ This usually works OK, but with an ill-conditioned data
2010 Sep 02
3
Simultaneous equations
Dear all, I am relatively new to R and have had some difficulty in understanding the user manual for a package that I have downloaded to evaluate non-linear simultaneous equations. The package is called systemfit. Does anyone have any experience of this package? What I am trying to do is solve a non linear simultaneous equations... Could anyone give me an example (please) of the code that
2017 Feb 10
1
Ancient C /Fortran code linpack error
...calling C code. >>>> >>>> Any thoughts on how to best handle the situation? Is this a bug in dpoco? Is there a simple way to test for any NaNs in a vector? >> >>> You should/could use macro R_FINITE to test each entry of the hessian. >>> In package nleqslv I test for a "correct" jacobian like this in file nleqslv.c in function fcnjac: >> >>> for (j = 0; j < *n; j++) >>> for (i = 0; i < *n; i++) { >>> if( !R_FINITE(REAL(sexp_fjac)[(*n)*j + i]) ) >>> error(&q...
2012 Jan 22
4
Solving Equations
People, I'm researching some Bayesian statistic topics and in the midle of my study i found a very simple problem and i'm trying to find a simple package to solve this type of equations: Lets say that i need to compute beta values for the beta distribution and i now for example: E(teta)=a/(a+b) = 0,5 Var(teta)=ab/((a+b)^2(a+b+1))=0.05 So if i want to solve this to non-linear system to