Displaying 20 results from an estimated 8000 matches similar to: "selection of optim parameters"
2003 Jul 16
2
numerical differentiation in R? (for optim "SANN" parscale)
Dear R users,
I am running a maximum likelihood model with optim. I chose the
simulated annealing method (method="SANN").
SANN is not performing bad, but I guess it would be much more effecive
if I could set the `parscale' parameter.
The help sais:
`parscale' A vector of scaling values for the parameters.
Optimization is performed on `par/parscale' and these
2005 Apr 26
2
"wild" function example in optim
Dear all,
Firstly, I do apologize if my question is simple and posted in the wrong place but I had no reply from the R-help mailing list (maybe it is too simple!).
I was wondering why parscale is set to 20 in the "wild" function example used in ?optim. This function has only one parameter and if we set parscale equal to 1 then the solution near the global minimum is not found.
I
2008 Mar 23
2
scaling problems in "optim"
Dear R users,
I am trying to figure out the control parameter in "optim," especially,
"fnscale" and "parscale."
In the R docu.,
------------------------------------------------------
fnscale
An overall scaling to be applied to the value of fn and gr during
optimization. If negative, turns the problem into a maximization problem.
Optimization is performed on
2005 Apr 19
1
Optim(...parscale...)
Hi there,
The optim(par, fn, ...parscale...) function in R requires 'parscale' which is defined as:
"A vector of scaling values for the parameters. Optimisation is performed on 'par/parscale' and these should be comparable in the sense that a unit change in any element (??) produces a unit change in the scaled value".
I am just not understanding the
2008 Apr 05
2
How to improve the "OPTIM" results
Dear R users,
I used to "OPTIM" to minimize the obj. function below. Even though I used
the true parameter values as initial values, the results are not very good.
How could I improve my results? Any suggestion will be greatly appreciated.
Regards,
Kathryn Lord
#------------------------------------------------------------------------------------------
x = c(0.35938587,
2008 Apr 05
2
How to improve the "OPTIM" results
Dear R users,
I used to "OPTIM" to minimize the obj. function below. Even though I used
the true parameter values as initial values, the results are not very good.
How could I improve my results? Any suggestion will be greatly appreciated.
Regards,
Kathryn Lord
#------------------------------------------------------------------------------------------
x = c(0.35938587,
2006 May 01
1
Problem with optim()
I am having a problem with optim() using the "L-BFGS-B" method. When I
set the lower limit for the third parameter equal to zero I get an
error message:
> low.lim.3 <- 0
> phi_opt <- optim(phi_, model_lik, NULL, method = "L-BFGS-B", lower=c(0.2, -100, low.lim.3, 0), upper= c(10, 100, 10, 10), control = list(maxit = 1000, parscale = c(0.2, u1, 0.002, 0.002), trace =
2012 Aug 18
1
Parameter scaling problems with optim and Nelder-Mead method (bug?)
Dear all,
I?m having some problems getting optim with method="Nelder-Mead" to work
properly. It seems like there is no way of controlling the step size,
and the step size seems to depend on the *difference* between the
initial values, which makes no sense. Example:
f=function(xy, mu1, mu2) {
print(xy)
dnorm(xy[1]-mu1)*dnorm(xy[2]-mu2)
}
f1=function(xy) -f(xy, 0,
2008 Jul 21
1
Control parameter of the optim( ): parscale
Hi everybody,
I am using the L-BFGS-B method of the mle2() function to estimate the values
of 6 parameters. mle2 uses the methods implemented in optim. As I got it
from the descriptions available online, one can use the parscale
parameter to tell R somehow what the values of the estimated parameters
should be . . .
Could somebody please help me understand what one has to do actually with
the
2011 Aug 14
2
Scaling problem in optim()
I am using the function optim and I get the error message ABNORMAL_TERMINATION_IN_LNSRCH. Reason for this could be a scaling problem. Thus, I used parscale in order to scale the parameters. But I still have the error message. For example, with parscale=c(rep(1,n), 0.01,1,0.01):
return(optim(c(mu1,b,k,phi), neg2loglikelihood, method = "L-BFGS-B",
2008 Mar 13
3
Use of ellipses ... in argument list of optim(), integrate(), etc.
Hi,
I have noticed that there is a change in the use of ellipses or . in R
versions 2.6.1 and later. In versions 2.5.1 and earlier, the . were always
at the end of the argument list, but in 2.6.1 they are placed after the main
arguments and before method control arguments. This results in the user
having to specify the exact (complete) names of the control arguments, i.e.
partial matching is
2011 May 25
1
L-BFGS-B and parscale in optim()
Hi,
When using method L-BFGS-B along with a parscale argument, should the
lower and upper bounds provided be on the scaled or unscaled values?
Thanks.
Cheers,
--
Seb
2008 Jul 05
3
Editing the "..." argument
Dear all,
I'd like tweaking the ... arguments that one user can pass in my
function for fitting a model. More precisely, my objective function is
(really) problematic to optimize using the "optim" function.
Consequently, I'd like to add in the "control" argument of the latter
function a "ndeps = rep(something, #par)" and/or "parscale =
2003 Feb 28
2
optim
Dear all,
I have a function MYFUN which depends on 3 positive parameters TETA[1],
TETA[2], and TETA[3]; x belongs to [0,1].
I integrate the function over [0,0.1], [0.1,0.2] and
[0.2,0.3] and want to choose the three parameters so that
these three integrals are as close to, resp., 2300, 4600 and 5800 as
possible. As I have three equations with three unknowns, I expect the
exact fit, i.e., the SS
2010 Mar 01
2
Advice wanted on using optim with both continuous and discrete par arguments...
Dear R users,
I have a problem for which my objective function depends on both discrete and continuous arguments.
The problem is that the number of combinations for the (multivariate) discrete arguments can become overwhelming (when it is univariate this is not an issue) hence search over the continuous arguments for each possible combination of the discrete arguments may not be feasible. Guided
2020 Oct 28
2
R optim() function
Hi R-Help,
I am using R to do functional outlier detection (using PCA to reduce to 2 dimensions - the functional boxplot methodology used in the Rainbow package), and using Hscv.diag function to calculate the bandwidth matrix where this line of code is run:
result <- optim(diag(Hstart), scv.mat.temp, method = "Nelder-Mead", control = list(trace = as.numeric(verbose)))
Within the
2010 Jun 26
4
optim() not finding optimal values
I am trying to use optim() to minimize a sum-of-squared deviations function based upon four parameters. The basic function is defined as ...
SPsse <- function(par,B,CPE,SSE.only=TRUE) {
n <- length(B) # get number of years of data
B0 <- par["B0"] # isolate B0 parameter
K <- par["K"]
2008 Mar 31
2
L-BFGS-B needs finite values of 'fn'
Dear All,
I am trying to solve the optimization problem below, but I am always
getting the following error:
Error in optim(rep(20, nvar), f, gr, method = "L-BFGS-B", lower = rep(0, :
L-BFGS-B needs finite values of 'fn'
Any ideas?
Thanks in advance,
Paul
-----------------------------------------------
k <- 10000
b <- 0.3
f <- function(x) {
n <- length(x)
2008 Aug 13
2
messing with ...
I'm looking for advice on manipulating parameters that
are going to be passed through to another function.
Specifically, I am working on my version of "mle",
which is a wrapper for optim (among other optimizers).
I would prefer not to replicate the entire argument
list of optim(), so I'm using ... to pass extra arguments
through.
However:
the starting values are
2007 May 19
2
What's wrong with my code ?
I try to code the ULS factor analysis descrbied in
ftp://ftp.spss.com/pub/spss/statistics/spss/algorithms/ factor.pdf
# see PP5-6
factanal.fit.uls <- function(cmat, factors, start=NULL, lower = 0.005,
control = NULL, ...)
{
FAfn <- function(Psi, S, q)
{
Sstar <- S - diag(Psi)
E <- eigen(Sstar, symmetric = TRUE, only.values = TRUE)
e <- E$values[-(1:q)]
e <-