similar to: linear constraint optim with bounds/reparametrization

Displaying 20 results from an estimated 1100 matches similar to: "linear constraint optim with bounds/reparametrization"

2004 Nov 18
1
gibbs sampling for mixture of normals
hi i'm looking for a gibbs sampling algorithm for R for the case of mixture of K normals, and in particular for the case of bivariate normals. i'd be grateful if anyone could send its own R-routine, at least for the univariate case. thank you in advance matteo
2004 Aug 12
9
Giving a first good impression of R to Social Scientists
Dear all, in the coming Winter Semester, I will be a teaching assistant for a course in Survival Analysis. My job will be to do the lab sessions. The software used for these lab sessions will be R. Most of the students have a background in social sciences and the only stats package they used so far is most likely SPSS. So I assume they might be quite surprised the first time they see R
2004 Aug 04
2
fitting distributions
Hello, I also try to fit a skewed distribution (like skewed student t) to data points. Do you have an idee howto do this??? thank you fabrice dusonchet *********************************************************************************** This email and any files transmitted with it are confidentia...{{dropped}}
2004 Sep 15
6
Bessel function
Dear all Currently, I'm implementing the generalized hyperbolic distribution into Splus. Unfortunately the Bessel function is not implemented in Splus. In R the Bessel function does exist but it is an internal function and I'm not able to look at the code. Is there any possibility to see the code of the Bessel function in R or does anybody has an implementation of the Bessel function in
2006 Feb 01
1
output hessian matrix in constrOptim
Hi, Is there any way to get the hessian matrix from the "constrOptim" function without supplying gradient function? Thanks. --------------------------------- Bring words and photos together (easily) with [[alternative HTML version deleted]]
2004 Sep 22
5
block statistics with POSIX classes
I have a monthly price index series x, the related return series y = diff(log(x)) and a POSIXlt date-time variable dp. I would like to apply annual blocks to compute for example annual block maxima and mean of y. When studying the POSIX classes, in the first stage of the learning curve, I computed the maximum drawdown of x: > mdd <- maxdrawdown(x) > max.dd <- mdd$maxdrawdown > from
2009 Nov 04
3
Constrained Optimization
Hi All, I'm trying to do the following constrained optimization example. Maximize x1*(1-x1) + x2*(1-x2) + x3*(1-x3) s.t. x1 + x2 + x3 = 1 x1 >= 0 and x1 <= 1 x2 >= 0 and x2 <= 1 x3 >= 0 and x3 <= 1 which are the constraints. I'm expecting the answer x1=x2=x3 = 1/3. I tried the "constrOptim" function in R and I'm running into some issues. I first start off
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
2006 Sep 28
1
Nonlinear fitting - reparametrization help
Hi, I am trying to fit a function of the form: y = A0 + A1 * exp( -0.5* ( (X - Mu1) / Sigma1 )^2 ) - A2 * exp ( -0.5* ( (X-Mu2)/Sigma2 )^2 ) i.e. a mean term (A0) + a difference between two gaussians. The constraints are A1,A2 >0, Sigma1,Sigma2>0, and usually Sigma2>Sigma1. The plot looks like a "Mexican Hat". I had trouble (poor fits) fitting this function to toy data
2012 Sep 17
2
Constraint Optimization with constrOptim
Hi, I am having trouble using constrOptim. My target is to do a portfolio optimization and there some constraints have to be fulfilled. 1) The weight of each share of the portfolio has to be greater than 0 2) The sum of these weights has to be 1 I am able to fulfill either the first or the second constraint but not both. One simple way would be to fulfill the first constraint by using optim as
2004 Sep 23
3
R glm
Hello: would you please help me with the following glm question? for the R function glm, what I understand is: once you specify the "family", then the link function is fixed. My question is: is it possible I use, for example, "log" link function, but the estimation approach for the guassian family? Thanks, Shuangge Ma, Ph.D. ******************************************** *
2006 Oct 20
1
Cardinality constraint
Hello, How do I implement a cardinality constraint with constrOptim? I want to minimize (least square) a%*%x = 4 subject to x1<2 x2<1 x3<4 count(x1, x2, x3)= 2 (cardinality constraint) Is there a way to specify binary integer variables with constrOptim? Here's my code so far: a <-matrix(1:3,1,3) fr <- function(x) { (a%*%x-4)^2 }
1998 Oct 07
2
R-beta: R0.62.3 installation on RedHat 5.0
I have R-0.62.3 and RedHat 5.0 with fort77. At the office R is running but when I install a package, eg. 'akima' I get a message make: f77: Command not found 'R INSTALL library' does not accept fort77, but R installation checks f77/g77/fort77. Is there an easy way to edit some file and replace f77/g77 with fort77? At home I have the same R and Linux versions, but when
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
2009 Nov 02
2
a prolem with constrOptim
Hi, I apologize for the long message but the problem I encountered can't be stated in a few lines. I am having some problems with the function constrOptim. My goal is to maximize the likelihood of product of K multinomials, each with four catagories under linear constraints on the parameter values. I have found that the function does not work for many data configurations. #The likelihood
2004 Jul 14
2
constrOptim and function with additional parameters?
How can I use a function with some additional input parameters in constrOptim? For example, something like fr <- function(x,a) { ## Rosenbrock Banana function x1 <- x[1] x2 <- x[2] a * (x2 - x1 * x1)^2 + (1 - x1)^2 } where the optimum is to be found w.r.t. x. Calling optim(c(-1.2,1), fr, NULL, a=100) works as expected, but I fail to provide the a=100 in the constrained case:
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
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 Apr 23
6
Stuck using constrOptim
Trying to use constrOptim to minimize the sum of squared deviations. I put the objective function in as: sum((x %*% Y - Z)^2) so i'm trying to get values for x to minimize the sum of the squared deviations between the product of x and Y and Z. Anyways i have no problem using this when x is a 3x1 test variable. it works great with the constraints and everything. when i actually use it on
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