Displaying 20 results from an estimated 1000 matches similar to: "on the output of constrOptim()"
2015 Sep 17
1
names treatment in optim()
Dear both,
I have found that names are not treated in the same way in optim() depending on the optimization method (argument method).
The example below shows the difference between the Brent method and the L-BFGS-B method.
f <- function(x){ y <- x^2;names(y) <-"f(x)";y}
optim(10, f, method="Brent", lower=-1, upper=10)$value
optim(10, f, method="L-BFGS-B",
2016 Apr 04
0
Find the dataset(s) that contain(s) non-ASCII characters
Dear list,
I?m maintainsing a package containing only datasets (152): http://dutangc.free.fr/pub/RRepos/web/CASdatasets-index.html <http://dutangc.free.fr/pub/RRepos/web/CASdatasets-index.html>
When R CMD checking the package, I get the following NOTE
* checking data for non-ASCII characters ... NOTE
Note: found 4 marked UTF-8 strings
I wonder how to find which dataset(s) (all recorded
2017 May 10
3
registering Fortran routines in R packages
Thanks for your email.
I try to change the name in lowercase but it conflicts with a C implementation also named halton. So I rename the C function halton2() and sobol2() while the Fortran function are HALTON() and SOBOL() (I also try lower case in the Fortran code). Unfortunately, it does not help since I get
init.c:97:25: error: use of undeclared identifier 'halton_'; did you mean
2017 May 09
2
registering Fortran routines in R packages
Dear list,
I?m trying to register Fortran routines in randtoolbox (in srt/init.c file), see https://r-forge.r-project.org/scm/viewvc.php/pkg/randtoolbox/src/init.c?view=markup&root=rmetrics.
Reading https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Registering-native-routines and looking at what is done in stats package, I first thought that the following code will do the job:
2017 May 09
0
registering Fortran routines in R packages
> On 9 May 2017, at 13:44, Christophe Dutang <dutangc at gmail.com> wrote:
>
> Dear list,
>
> I?m trying to register Fortran routines in randtoolbox (in srt/init.c file), see https://r-forge.r-project.org/scm/viewvc.php/pkg/randtoolbox/src/init.c?view=markup&root=rmetrics.
>
> Reading
2015 Jan 23
1
Programming Tools CTV
Dear Willem,
Personally, I use the R-forge project for the distribution CTV : https://r-forge.r-project.org/projects/ctv/
It?s an alternative option to github.
Regards, Christophe
---------------------------------------
Christophe Dutang
LMM, UdM, Le Mans, France
web: http://dutangc.free.fr
Le 23 janv. 2015 ? 12:49, Luca Braglia <lbraglia at gmail.com> a ?crit :
> Hi Willem
>
2008 Jan 18
1
constrOptim with method SANN
Hi Everyone,
I'm trying to minimize a function using constrOptim with
the simulated annealing method SANN.
If I understand constrOptim well, it basically passes most
of its arguments to optim while somehow enforcing the constraints.
My problem is, that since SANN does not need gradients,
when using optim with SANN, the gr argument of optim is
used to specify a function to create the next
2004 Jul 14
0
Re: [R] constrOptim and function with additional parameters? (PR#7088)
I've moved this from r-help to r-bugs. If you reply, please be
careful that replies go to the right place: r-bugs if your comment is
specifically about the bug (and it contains the PR# in the subject
that will be added when this is cc'd to r-devel), r-devel if general
discussion, not both.
On Wed, 14 Jul 2004 10:01:45 -0400, "Roger D. Peng" <rpeng@jhsph.edu>
wrote :
2007 Aug 01
1
constrOptim
Hi,
I'm having trouble using the constrOptim function to generate the
9-component vector argmin of the function ELfsds:
ELfsds <- function(pvechat){
LG=0
for(i in 1:9){
LG=LG+log(pvechat[i])
}
return(-LG)
}
with accompanying gradient function:
gradfunc <- function(thetavec){
g=1/(9*thetavec)
return(g)
}
The constraints on the optimization problem are:
1 - components of
2008 Jan 18
0
constrOptim with SANN
Hi Everyone,
I'm trying to minimize a function using constrOptim with
the simulated annealing method SANN.
If I understand constrOptim well, it basically passes most
of its arguments to optim while somehow enforcing the constraints.
My problem is, that since SANN does not need gradients,
when using optim with SANN, the gr argument of optim is
used to specify a function to create the next
2004 Jul 14
0
Re: [R] constrOptim and function with additional parameters? (PR#7089)
Okay, looking at the docs, then it's not a bug, since the "..."
argument is not actually documented as "other arguments passed to f or
grad". However, that *is* how it's document in `optim', so one can
see how this might cause some confusion.
Now, it's not clear to me which other arguments need to be passed to
`optim' except perhaps `hessian'. Am
2003 Oct 29
1
constrOptim doesn´t send arguments to optim!(?)
Hi,
I think that there something wrong with the 'constrOptim' max/minimization
function because she doesn?t send extra arguments to 'optim' call.
Fact: When I use optim in a f(x,theta)-like function, everything goes ok.
But using constrOptim with the same function leads to error...
Proof: Make a small change in the 'Rosenbrock Banana function' (taken from
the Examples
2009 Jun 03
1
Using constrOptim() function
I have a function myFunction(beta,x) where beta is a vector of coefficients
and x is a data frame (think of it as a matrix). I want to optimize the
function myFunction() by ONLY changing beta, i.e. x stays constant, with 4
constraints. I have the following code (with a separate source file for the
function):
rm(list=ls())
source('mySourceFile')
2011 Dec 29
0
problem of "constrOptim.nl", no hessian and convergence values
Dear Helper,
I used "constrOptim.nl" and got the value of par. The estimations looks good
even if the number of iterations is only 16. But the values of hessian and
convergence are both "NULL".
I tested the objective function and gradient function by "optim" and didn't
see any problem there. With these functions, "optim" gives the convergence
value
2011 Dec 20
1
constrOptim and problem with derivative
Dear List,
I am using constrOptim to solve the following
fr1 <- function(x) {
b0 <- x[1]
b1 <- x[2]
((1/(1+exp(-b0+b1))+(1/(1+exp(-b0)))+(1/(1+exp(-b0-b1)))))/3
}
As you can see, my objective function is
((1/(1+exp(-b0+b1))+(1/(1+exp(-b0)))+(1/(1+exp(-b0-b1)))))/3 and I would
like to solve for both b0 and b1.
If I were to use optim then I would derive the gradient of the
2011 Dec 21
1
constrOptim and further arguments
Dear List,
I have the code below, where I am using the constrained optimisation
package, 'constrOptim.nl' to find the values of two values, b0 and b1.
I have no problems when I enter further variable information DIRECTLY into
the functions, fn, and heq. In this instance I require fn to have -0.0075
appended to it, and in the case of heq, h[1] has -0.2.
library(alabama)
2004 Oct 05
1
constrOptim convergence
Hello, I got a question with the R function constrOptim.
>From the R help, it says that the return values of "constrOptim" are the
same as "optim". For the return value "convergence" of the function
"optim", the values should be 0, 1, 10, 51 and 52. See
http://www.maths.lth.se/help/R/.R/library/stats/html/optim.html
When I use constrOptim, I get
2010 Jun 17
2
constrOptim( ): conflict between help page and code
There is a contradiction between what the help page says and what constrOptim actually
does with the constraints. The issue is what happens on the boundary.
The help page says
The feasible region is defined by ?ui %*% theta - ci >= 0?,
but the R code for constrOptim reads
if (any(ui %*% theta - ci <= 0))
stop("initial value not feasible")
The following example
2012 Nov 29
0
constrOptim
Dear R users,
I am using the function "constrOptim" to minimize the -1*log-likelihood
where \beta_i>=0 i=1,...,p and \beta_0 is unconstrained.
I construct u_i as
0 0 0 ... 0
0 1 0 ... 0
0 0 1 ... 0
. . . ... 0
. . . ... 0
.
2009 Sep 11
1
constrOptim parameters
Dear R wizards: I am playing (and struggling) with the example in the
constrOptim function. simple example. let's say I want to constrain my
variables to be within -1 and 1. I believe I want a whole lot of
constraints where ci is -1 and ui is either -1 or 1. That is, I have 2*N
constraints. Should the following work?
N=10
x= rep(1:N)
ci= rep(-1, 2*N)
ui= c(rep(1, N), rep(-1, N))