Displaying 20 results from an estimated 3000 matches similar to: "any more direct-search optimization method in R"
2005 May 22
3
constraints
Is there a package in R that handles general linear (in-)equality + box
constrained optimization?
If it is not there, could anyone advise me which way to go?
And/or point me to packages that solve these problems partially?
best, ingmar
--
Ingmar Visser
Department of Psychology, University of Amsterdam
Roetersstraat 15, 1018 WB Amsterdam
The Netherlands
http://users.fmg.uva.nl/ivisser/
tel:
2007 Sep 07
1
'initial value not feasible' in constrOptim
Dear friends.
I am using function
constrOptim(c(0.5,0.3,0.5), fit.error, fit.error.grr, ui=-1*ui,ci=-1*ci)
and I am confronted with error message "initial value not feasible"
I plug in the initial value of (0.5,0.3,0.5) to function fit.error and
fit.error.grr and have pretty reasonable result. I inequality "ui %*% theta
- ci >= 0" as suggested in the R manual and it is
2004 Aug 09
4
linear constraint optim with bounds/reparametrization
Hello All,
I would like to optimize a (log-)likelihood function subject to a number of
linear constraints between parameters. These constraints are equality
constraints of the form A%*%theta=c, ie (1,1) %*% 0.8,0.2)^t = 1 meaning
that these parameters should sum to one. Moreover, there are bounds on the
individual parameters, in most cases that I am considering parameters are
bound between zero
2005 Mar 23
4
non-derivative based optimization and standard errors.
Hi AlL,
I ahve this problem that my objective function is discontinous in the
paramaters and I need to use methods such as nelder-mead to get around
this. My question is: How do i compute standard errors to a problem that
does not have a gradient?
Any literature on this is greatly appreciated.
Jean,
2005 Mar 22
5
Convert timeseries to transition matrix
Hi All,
Does someone have an idea of how to cleverly convert a categorical
timeseries into a transition matrix?
Ie, I have something like:
x<- c(1,1,2,1,1,2,2,2,1,2),
And I want a matrix with counts and/or probabilities:
> tr <- matrix(c(2,3,2,2),2,2)
> tr
[,1] [,2]
[1,] 2 2
[2,] 3 2
Meaning that there are two transitions from 1 to 1, two from 1 to 2, three
from 2 to 1
2006 Oct 13
3
Barplot legend position
Dear useRs,
I'm trying to create a barplot like so:
x=matrix(1:10,2,5)
barplot(x,leg=c("left","right"),besid=T)
The legend is placed in default position topright, however the data are
plotted there too. I tried controlling the legend position by adding
x="topleft" but this results in an error that x matches multiple formal
arguments.
Leaving out the legend
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 May 12
4
bus error macosx/off-topic
Hi All,
I'm building a package using C/C++ and Fortran code which usually runs fine.
However I do get occasional bus errors around the time of exiting one of the
C functions.
Where do I need to be looking to solve this problem?
Do bus errors stem from unmapped memory exceptions? How can I find out if
that is what is happening while running R?
Any hints greatly appreciated.
Best, ingmar
2008 Jun 26
1
Question about Constraint Optimization
Dear All,
I am having trouble in using R function "constrOptim" to do constraint
optimization. It seems that "constrOptim" calls function "optim" when it
does the optimization, and "optim" allows us to set "method" to be "SANN"
if we want to use simulated annealing. In "optim", the function allows us
to set gradient to be
2005 Apr 12
3
where is internal function of sample()?
Hi there,
I am trying to write a c++ shared library for R. I need a function which has
the same functionality as sample() in R, i.e., does permutation, sample
with/without replacement. Does R have internal sample routine so that I can
call it directly?
I did not find it in R.h, Rinternal.h.
Thanks
2011 Feb 11
2
fitdistr question
Hello,
I tried to fit a poisson distribution but looking at the function
fitdistr() it does not optimize lambda but simply estimates the mean
of the data and returns it as lambda. I'm a bit confused because I was
expecting an optimization of this parameter to gain a good fit...
If I would use mle() of stats4 package or mle2() of bbmle package, I
would have to write the function by myself
2004 Mar 30
1
Console/command line output
Hi all,
I am working on Macos x 10.3 (Panther) to build a package consisting of
C/C++ code that is called from R. In the C/C++-sources I use several
commands to print info to the console:
std::cout << "info" << endl;
and:
Rprintf("info\n");
Both work fine when R is run on the command line but neither works when
running Raqau (I did check the preference boxes
2008 Apr 07
2
tcltk issue remains
Dear R-help,
I'm trying to load the fGarch package and keep running into problems
with tcltk:
After succesfully instaling fGarch (and dependencies) I get:
>library(fGarch)
Loading required package: fBasics
Loading required package: fImport
Loading required package: fSeries
Loading required package: robustbase
Loading required package: fCalendar
Loading required package: MASS
Loading
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')
2009 Mar 12
2
Time-Ordered Clustering
Hello All,
Does anyone know of a package that performs constraint-based clusters?
Ideally the package could perform "Time-Ordered Clustering", a technique
applied in a recent journal article by Runger, Nelson, Harnish (using MS
Excel). Quote, "in our specific implementation of constrained
clustering, the clustering algorithm remains agglomerative and
hierarchical, but observations
2012 Feb 22
4
Week number from a date
Hi
My data looks like this
startDate="2008-06-01"
dateRange =c( "2008-10-01","2008-12-01")
Is there any method to find the week number from the startDate range
-----
Thanks in Advance
Arun
--
View this message in context: http://r.789695.n4.nabble.com/Week-number-from-a-date-tp4410223p4410223.html
Sent from the R help mailing list archive at Nabble.com.
2008 Dec 17
1
repeated measures aov with weights
Dear R-help,
I'm facing a problem with defining a repeated measures anova with
weighted data.
Here's the code to reproduce the problem:
# generate some data
seed=11
rtrep <- data.frame(rt=rnorm(100),ti=rep(1:5,20),subj=gl
(20,5,100),we=runif(100))
# model with within factor for subjects/repeated measurements, no
problem
aov(rt~ti + Error(subj/ti),data=rtrep)
#model with weights
2012 Aug 27
2
randomLCA
Can anybody, please, explain me how many parameter are estimated using
randomLCA?
For examples, model "dentistry.lca2random" estimate 1 scale (or
variance, b_j) parameter and 2 position parameters (a_cj)? Doesn't
it?
Do I need at least 4 diagnostic tests for such a model?
What happens if I specify options blocksize and byclass? How many
diagnostic tests (or rater) I need?
2010 Dec 02
1
Hmm Topology restriction
Dear List,
We are using RHmm to cluster data through HMM. We would like to
restrict the transition matrix of HMM, to get hierarchical connections
between clusters. But, RHmm doesn't seem to support these
restrictions. Can any one suggest a library to do that.
Thanks,
Kishor
2008 Mar 14
1
Optimization with constraint.
Hello.
I have some problems, when I try to model an
optimization problem with some constraints.
The original problem cannot be solved analytically, so
I have to use routines like "Simulated Annealing" or
"Sequential Quadric Programming".
But to see how all this works in R, I would like to
start with some simple problem to get to know the
basics:
The Problem:
min f(x1,x2)=