Displaying 20 results from an estimated 2000 matches similar to: "How to stop the minimization when the condition does not hold"
2004 Sep 09
3
Dyn.load of sharing object with GSL library
Following the recommendation of Prof. Ripley, I have created the Makevars
file with the line:
PKG_LIBS="-L/usr/lib/libm -lm -L/usr/local/lib/libgsl -lgsl -L/usr/local/lib
/libgslcblas -lgslcblas"
in the working directory.
Now I have the code file Example3.c which computes the Bessel function value
(the example is taken from the GSL reference book).
I am running:
R CMD SHLIB Example3.c
2005 Mar 16
8
Summing up matrices in a list
Dear all,
I think that my question is very simple but I failed to solve it.
I have a list which elements are matrices like this:
>mylist
[[1]]
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
[[2]]
[,1] [,2] [,3]
[1,] 7 9 11
[2,] 8 10 12
I'd like to create a matrix M<-mylist[[1]]+mylist[[2]]
[,1] [,2] [,3]
[1,] 8 12 16
[2,] 10 14 18
2006 Dec 08
1
MAXIMIZATION WITH CONSTRAINTS
Dear R users,
I?m a graduate students and in my master thesis I must
obtain the values of the parameters x_i which maximize this
Multinomial log?likelihood function
log(n!)-sum_{i=1]^4 log(n_i!)+sum_
{i=1}^4 n_i log(x_i)
under the following constraints:
a) sum_i x_i=1,
x_i>=0,
b) x_1<=x_2+x_3+x_4
c)x_2<=x_3+x_4
I have been using the
?ConstrOptim? R-function with the instructions
2004 Jul 14
1
Running the optimization on the subset of parameters
Dear all,
I'd like to find a minimum of (-loglik) function which is a function of k parameters. I'd like to run the minimization algorithm for the different subsets of the parameters and assign the fixed values to the complementary subset. How should I define my (-loglik) function such that it can be passed to the optim or other optimization function?
Much thanks for any suggestions.
2004 Aug 10
1
Question about mle function
Dear all,
I'd like to find the mle esttimates using the mle function
mle(negloglik, start = list(), fixed=list(), method="...").
I am using the L-BGFS-B method and I don't supply the gradient function. Is there a way to print the gradients found at the solution value?
I am using R-1.9.1 on Windows and on Unix.
Thank you in advance,
Victoria Landsman.
[[alternative
2005 Mar 24
2
Bivariate lognormal distribution
Dear experts!
Is there a package that enables to create the bivariate log-normal variables?
Thanks a lot,
Vicky Landsman.
[[alternative HTML version deleted]]
2005 Feb 27
2
Help with constrained optimization
Dear all,
I need an advice in the following problem.
I have to maximize two functions of the form f1(x)=f(y1,x,alpha1,beta1) and f2(x)=(y2,x,alpha2,beta2), the maximization is with respect to alpha1, alpha2, beta1, beta2. I can maximize each function separately using nlm.
The problem is that I have to add the constraint of the form g(alpha1)=g(alpha2).
The total number of parameters is
2009 Mar 06
2
Interaction term not significant when using glm???
Dear all,
I have a dataset where the interaction is more than obvious, but I was asked
to give a p-value, so I ran a logistic regression using glm. Very funny, in
the outcome the interaction term is NOT significant, although that's
completely counterintuitive. There are 3 variables : spot (binary response),
constr (gene construct) and vernalized (growth conditions). Only for the FLC
construct
2004 Jul 11
2
How to bring an Splus object into R
>From the `R Data Import/Export' manual, shipped with R, as well as available
from the official R web site (last three paragraphs of Section 3.1,
describing functions in the `foreign' package):
Function read.S which can read binary objects produced by S-PLUS 3.x, 4.x or
2000
on (32-bit) Unix or Windows (and can read them on a di
erent OS). This is able to read
many but not all S
2004 Sep 27
1
Numerical two-dimensional integration
Dear all,
I need to compute (numerically) the two-dimensional integral: int(int f(x,y)dy)dx.
What is the more efficient(fast) way to do it?
Is adapt function appropriate for this problem?
I will much appreciate your help and attention.
Vicky.
[[alternative HTML version deleted]]
2012 Jul 18
4
The best solver for non-smooth functions?
# Hi all,
# consider the following code (please, run it:
# it's fully working and requires just few minutes
# to finish):
require(CreditMetrics)
require(clusterGeneration)
install.packages("Rdonlp2", repos= c("http://R-Forge.R-project.org",
getOption("repos")))
install.packages("Rsolnp2", repos= c("http://R-Forge.R-project.org",
2006 Mar 16
1
lme4/Matrix: Call to .Call("mer_update_y"...) and LMEoptimize gives unexpected side effect...
Dear all
I want to compute Monte Carlo p-values in lmer-models based on sampled data sets. To speed up calculations, I've tried to use internal functions from the Matrix package (as suggested ealier on the list by Doug Bates).
So I did:
fm2 <- lmer(resistance ~ ET + position + (1|Grp), Semiconductor,method='ML')
simdata<-simulate(fm2,nsim=1)
ynew <- simdata[,1]
mer
2004 Sep 09
1
Adding GSL library path to SHLIB
Dear R-list people,
I asked a similar question a few hours before. I will try to be more specific.
We like to add the GSL library to the file SHLIB in order to make it possible to run the C code using GSL functions from R.
We read that the path to the libgsl.a should be added to the line shlib_libadd=' ' in the file SHLIB but it does not work on our system. Dyn.load fails with error
2004 Oct 12
2
Statistical analysis of a large database
Deall all,
We need to perform a statistical analysis of a large database (40,000 entries with approximately 500 fields in each entry) currently handled in Oracle. The data contains categorical variables only.
At the current stage we suggest classification and clustering analysis.
We are planning to perform the analysis in R and would be very grateful for any
2012 Oct 19
2
Which package/function for solving weighted linear least squares with inequality and equality constraints?
Dear All,
Which package/function could i use to solve following linear least square
problem?
A over determined system of linear equations is given. The nnls-function may
would be a possibility BUT:
The solving is constrained with
a inequality that all unknowns are >= 0
and a equality that the sum of all unknowns is 1
The influence of the equations according to the solving process is
2005 Apr 07
1
ks.test for conditional distribution Y|x
Couldn't you do this by subtracting 0.5 + x from your y values and checking
for normality with mean 0 and sd = 1 (using ks.test or another test of
normality).
If you fail, you'll have to do additional work to find out whether pairs
with some particular x value (or range of x values) is causing the problem,
but I think this fits the question as stated.
Of course, if you have discrete x
2010 Nov 19
2
question about constraint minimization
Hi,
I am a beginner of R. There is a question about constraint minimization. A
function, y=f(x1,x2,x3....x12), needs to be minimized. There are 3
requirements for the minimization:
(1) x2+x3+...+x12=1.5 (x1 is excluded);
(2) x1=x3=x4;
(3) x1, x3 and x5 are in the range of -1~0, respectively. The rest variables
(x2, x4, x6, x7, ...., x12) are in the range of 0~1, respectively.
The
2010 Feb 09
2
Double Integral Minimization Problem
Hello all,
I am trying to minimize a function which contains a double integral, using
"nlminb" for the minimization and "adapt" for the integral. The integral is
over two variables (thita and radiusb)
and the 3 free parameters I want to derive from the minimization are
counts0, index and radius_eff.
I have used both tasks in the past successfully but this is the first time
2012 Jul 09
0
Problem in plm package
Hello everyone,
I am working with plm package and I have problem with random and within
models, which are giving errors which says "empty model". However, the model
is not empty. In the source code for plm.fit, where the error originates it
says something like (writing from the top of my head...)
X <- model.matrix(formula,data, lhs=1,...)
if (ncol(X) == 0) stop("empty
2017 Jun 20
1
Can I use tabu search for minimization problem ?
Hi all,
I want to use tabu search to solve my minimization problem. but tabu search in R is for maximization, so I turn my function from f to -f? but the eUtilityKeep always be 0 from the second position. I have go through a part of source code found that it always give the default value to compare,
move <- ifelse(maxTaboo > maxNontaboo & maxTaboo > aspiration,