Displaying 20 results from an estimated 6000 matches similar to: "Optimization in R"
2007 May 13
2
relist, an inverse operator to unlist
Hi all,
I wrote a function called relist, which is an inverse to the existing
unlist function:
http://www.econ.upenn.edu/~clausen/computing/relist.R
Some functions need many parameters, which are most easily represented in
complex structures. Unfortunately, many mathematical functions in R,
including optim, nlm, and grad can only operate on functions whose domain is
a vector. R has a
2007 May 13
1
symbollic differentiation in R
Hi all,
I wrote a symbollic differentiation function in R, which can be downloaded
here:
http://www.econ.upenn.edu/~clausen/computing/Deriv.R
http://www.econ.upenn.edu/~clausen/computing/Simplify.R
It is just a prototype. Of course, R already contains two differentiation
functions: D and deriv. However, these functions have several limitations.
They can probably be fixed, but
2000 Mar 17
1
optim: problem with additional arguments (PR#493)
The R function "optim" fails when a function requires additional
arguments, if the option "hessian=T" is specified. I am using R Version
1.0.0 on Windows 98.
Here is an example of the Rosenbrock Banana function from the optim help
example, with the function and gradient modified to take an additonal
argument. Note that the call to optim works fine unless a hessian is
2008 Oct 22
1
optim bug/help?
In the documentation for 'optim' it gives the following function:
fr <- function(x) { ## Rosenbrock Banana function
x1 <- x[1]
x2 <- x[2]
100 * (x2 - x1 * x1)^2 + (1 - x1)^2
}
optim(c(-1.2,1), fr)
When I run this code I get:
$par
[1] 1.000260 1.000506
I am sure I am missing something but why isn't 1,1 a better answer? If I plug 1,1 in the function it seems
2007 Apr 23
4
Estimates at each iteration of optim()?
I am trying to maximise a complicated loglikelihood function with the "optim" command. Is there some way to get to know the estiamtes at each iteration? When I put "control=list(trace=TRUE)" as an option in "optim", I just got the initial and final values of the loglikelihood, number of iterations and whether the routine has converged or not. I need to know the
2023 Aug 13
4
Noisy objective functions
While working on 'random walk' applications, I got interested in
optimizing noisy objective functions. As an (artificial) example, the
following is the Rosenbrock function, where Gaussian noise of standard
deviation `sd = 0.01` is added to the function value.
fn <- function(x)
(1+rnorm(1, sd=0.01)) * adagio::fnRosenbrock(x)
To smooth out the noise, define another
2007 May 29
1
Help with optim
Dear Friends,
I'm using the optim command to maximize a likelihood function. My optim command is as follows
estim.out <- optim(beta, loglike, X=Xmain, Y=Y, hessian=T, method="BFGS", control=c(fnscale=-1, trace=1, REPORT=1))
Setting the report=1, gives me the likelihood function value (if i'm correct) at each step. The output from running this is as follows
initial value
2011 Sep 16
4
Dual Authentication: Local and Active Directory
I was wondering if it was possible to get a Samba server that was
acting as an AD member server to also be able to authenticate local
users, or is stuck just serving AD users?
--
Aaron Clausen
mightymartianca at gmail.com
2011 Apr 20
2
Folder Encryption and Samba
It's been passed to me from on high that one of our file servers needs
to be encrypted. I'm considering either whole-disk encryption or
folder encryption. I like the latter since, well, it's less work.
Is there any particular folder encryption systems out there that the
folks around here can recommend?
--
Aaron Clausen
mightymartianca at gmail.com
2011 Jul 26
2
Incoming External Trust
I'm running a Samba domain (Samba 3.4.7) with OpenLDAP. I also have
an Server 2003 AD domain, and want to set up an external trust so that
AD users can access resources on the Samba domain, but not visa versa
(I believe this is called a one-way incoming external trust). I'm not
finding a lot of information out there that makes sense. Does anybody
have any hints?
--
Aaron Clausen
2002 Dec 02
1
IMQ
Has anybody got imq running on iptables 1.2.7a. The home page for imq only
seems to have a patch for 1.2.6a.
--
Aaron Clausen
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
2011 Sep 02
5
Hessian Matrix Issue
Dear All,
I am running a simulation to obtain coverage probability of Wald type
confidence intervals for my parameter d in a function of two parameters
(mu,d).
I am optimizing it using "optim" method "L-BFGS-B" to obtain MLE. As, I
want to invert the Hessian matrix to get Standard errors of the two
parameter estimates. However, my Hessian matrix at times becomes
2018 Apr 17
1
Minor glitch in optim()
Having worked with optim() and related programs for years, it surprised me
that I haven't noticed this before, but optim() is inconsistent in how it
deals with bounds constraints specified at infinity. Here's an example:
# optim-glitch-Ex.R
x0<-c(1,2,3,4)
fnt <- function(x, fscale=10){
yy <- length(x):1
val <- sum((yy*x)^2)*fscale
}
grt <- function(x, fscale=10){
nn
2016 Oct 08
4
optim(…, method=‘L-BFGS-B’) stops with an error message while violating the lower bound
Hi, Mark et al.:
Thanks, Mark.
Three comments:
1. Rvmmin was one of the methods I tried after Ravi
directed me to optimx. It returned NAs for essentially everything. See
my email of this subject stamped 4:43 PM Central time = 21:43 UTC.
2. It would be interesting to know if the current
algorithm behind optim and optimx with
2016 Oct 08
4
optim(…, method=‘L-BFGS-B’) stops with an error message while violating the lower bound
Hello:
The development version of Ecdat on R-Forge contains a vignette
in which optim(?, method=?L-BFGS-B?) stops with an error message while
violating the lower bound.
To see all the details, try the following:
install.packages("Ecdat", repos="http://R-Forge.R-project.org")
Then do "help(pac=Ecdat)" -> "User guides, package
2009 Dec 06
5
optim with constraints
Hi, dear R users
I am a newbie in R and I wantto use the method of meximum likelihood
to fit a Weibull distribution to my survival data. I use "optim" as
follows:
optim(c(1, 0.25),weibull.like,mydata=mydata,method="L-BFGS-B",hessian
= TRUE)
My question is: how do I setup the constraints so that the two
parametrs of Weibull to be pisotive? Or should I use other function
2004 Jan 05
3
optim function : "BFGS" vs "L-BFGS-B"
Dear kind R-experts.
Does anybody have an experience to use optim function?
If yes, what is the main difference between two method "BFGS" vs
"L-BFGS-B"?
I used "BFGS" method and got what I wanted. But when I used "L-BFGS-B"
the error message said that "L-BFGS-B needs finite values of fn". So
that means
"BFGS" method can handle even if fn
2008 Mar 09
2
[patch] add=TRUE in plot.default()
Hi all,
As long as I've used R, add=TRUE hasn't worked in contexts like this:
f <- function(x) x^2
X <- seq(0, 1, by=1/4)
plot(f, col="blue")
plot(X, f(X), col="red", type="l", add=TRUE)
I attached a fix for version 2.6.2.
Cheers,
Andrew
-------------- next part --------------
diff --git a/src/library/graphics/R/plot.R
2009 Aug 19
4
Confidence interval on parameters from optim function
Hi everyone,
I have two questions:
I would like to get confidence intervals on the coefficients derived
from the optim() function.
I apply optim() to a given function f
> res <-
optim(c(0.08,0.04,1.),f,NULL,method="L-BFGS-B",lower=c(0.,0.,0.))
And I would like to get the p-value and confidence intervals associated
with
> res$par
My second question deals with error message. I
2007 Apr 05
2
Likelihood returning inf values to optim(L-BFGS-B) other options?
Dear R-help list,
I am working on an optimization with R by evaluating a likelihood
function that contains lots of Gamma calculations (BGNBD: Hardie Fader
Lee 2005 Management Science). Since I am forced to implement lower
bounds for the four parameters included in the model, I chose the
optim() function mith L-BFGS-B as method. But the likelihood often
returns inf-values which L-BFGS-B