similar to: Constrained linear regression

Displaying 20 results from an estimated 10000 matches similar to: "Constrained linear regression"

2011 Jan 20
1
Constrained Regression
Hi everyone, I'm trying to perform a linear regression y = b1x1 + b2x2 + b3x3 + b4x4 + b5x5 while constraining the coefficients such that -3 <= bi <= 3, and the sum of bi =1. I've searched R-help and have found solutions for constrained regression using quadratic programming (solve.QP) where the coefficients are between 0 and 1 and sum to 1, but unfortunately do not understand
2010 Oct 07
3
quantile regression
Dear all, I am a new user in r and I am facing some problems with the quantile regression specification. I have two matrix (mresultb and mresultx) with nrow=1000 and ncol=nsim, where I specify (let's say) nsim=10. Hence, the columns in my matrix represents each simulation of a determined variable. I need to regress each column of mresultb on mresultx. My codes are the following:
2008 Mar 03
2
Constrained regression
Dear list members, I am trying to get information on how to fit a linear regression with constrained parameters. Specifically, I have 8 predictors , their coeffiecients should all be non-negative and add up to 1. I understand it is a quadratic programming problem but I have no experience in the subject. I searched the archives but the results were inconclusive. Could someone provide suggestions
2011 Nov 05
2
linear against nonlinear alternatives - quantile regression
Dear all, I would like to know whether any specification test for linear against nonlinear model hypothesis has been implemented in R using the quantreg package. I could read papers concerning this issue, but they haven't been implemented at R. As far as I know, we only have two specification tests in this line: anova.rq and Khmaladze.test. The first one test equality and significance of
2010 Oct 13
1
(no subject)
Dear all, I have just sent an email with my problem, but I think no one can see the red part, beacuse it is black. So, i am writing again the codes: rm(list=ls()) #remove almost everything in the memory set.seed(180185) nsim <- 10 mresultx <- matrix(-99, nrow=1000, ncol=nsim) mresultb <- matrix(-99, nrow=1000, ncol=nsim) N <- 200 I <- 5 taus <- c(0.480:0.520) h <-
2011 Dec 05
1
extract cov matrix in summary.rq and use as a matrix.
Dear all, I need to extract the covariance matrix of my quantile regression estimation to use in a test. My regression is: qf2_1 <- summary(rq(wb2 ~ apv2 + vol2, tau = phi2[1]), cov = TRUE) I can extract the covaraince matrix by using: qf2_1 [3]. However, if I try to use it in the test, it does not work. I only need to transform qf2_1[3] in a matrix 3x3. I have already tried:
2010 Oct 06
4
loop in R
Dear all, I need to do a loop in R, but I am not sure the software is generating "n" times the variables I request differently. When I ask to print the last matrix created, I just can see the loop for n=1. To be more precise, supose I need to simulate 10 times one variable and I want to fit the 10 variables simulated in a matrix. I dont really know what I am doing wrong, but I just
2010 Feb 23
2
significance of coefficients in Constrained regression
I am fittting a linner regression with constrained parameters, saying, all parameters are non-negative and sum up to 1. I have searched historical R-help and found that this can be done by solve.QP from the quadprog package. I need to assess the significance of the coefficient estimates, but there is no standard error of the coefficient estimates in the output. So I can not compute the p-value.
2011 Dec 19
1
None-linear equality constrained optimisation problems
Dear R users, I have a problem. I would like to solve the following: I have pL = 1/(1+e^(-b0+b1)) pM = 1/(1+e^(-b0)) pH = 1/(1+e^(-b0-b1)) My target function is TF= mean(pL,pM,pH) which must equal 0.5% My non-linear constraint is nl.Const = 1-(pM/pH), which must equal 20%, and would like the values of both b0 and b1 where these conditions are met. I have searched widely for an answer,
2009 Feb 16
2
solve.QP with box and equality constraints
Dear list, I am trying to follow an example that estimates a 2x2 markov transition matrix across several periods from aggregate data using restricted least squares. I seem to be making headway using solve.QP(quadprog) as the unrestricted solution matches the example I am following, and I can specify simple equality and inequality constraints. However, I cannot correctly specify a constraint
2007 Dec 22
1
using solve.qp without a quadratic term
I was playing around with a simple example using solve.qp ( function is in the quadprog package ) and the code is below. ( I'm not even sure there if there is a reasonable solution because I made the problem up ). But, when I try to use solve.QP to solve it, I get the error that D in the quadratic function is not positive definite. This is because Dmat is zero because I don't have a
2011 Oct 16
1
nlrq {quantreg}
Dear all, I sent an email on Friday asking about nlrq {quantreg}, but I haven't received any answer. I need to estimate the quantile regression estimators of a model as: y = exp(b0+x'b1+u). The model is nonlinear in parameters, although I can linearise it by using log.When I write: fitnl <- nlrq(y ~ exp(x), tau=0.5) I have the following error: Error in match.call(func, call = cll) :
2011 Sep 19
1
Constrained regressions (suggestions welcome)
All, Could anyone recommend a package that allows the user to constrain the coefficients from a multiple regression equation? I tried using the gl1ce function in lasso2, but couldn't get it to work. I created a contrived example to illustrate my starting point. data(cars) fmla <- formula(dist ~ speed) gl1c.E <- gl1ce(fmla, data = cars) gl1c.E gl1c.E <- gl1ce(fmla, data =
2010 Oct 13
1
Loop in columns by group
Dear all, I need to do a loop as following: #Consider a matrix: M <- matrix(1, nrow=10, ncol=20) #Matrices to store the looping results M1 <- matrix(0, nrow=10, ncol=400) h <- c(1:20/1000) #loop for (j in h){ M1 <- M/(2*j) } But this means that the first 20 columns of matrix M1 (that is, columns 1:20) should show the results of M/(2*0.001). Then, the following 20
2011 Nov 19
1
wald test: compare quantile regression estimators from different samples
Dear all, I am trying to compare the estimated coefficients of a quantile regression model between two different samples. It is a Wald test, but I cannot find one way to do that in R.The samples are collected conditional on a specific characteristic and I would like to test whether such characteristic indeed affect the estimators. The problem in the test anova.rq is that the response variable
2010 Dec 04
1
Quadratic programming with semi-definite matrix
Hello. I'm trying to solve a quadratic programming problem of the form min ||Hx - y||^2 s.t. x >= 0 and x <= t using solve.QP in the quadprog package but I'm having problems with Dmat not being positive definite, which is kinda okay since I expect it to be numerically semi-definite in most cases. As far as I'm aware the problem arises because the Goldfarb and Idnani method first
2010 Oct 13
4
loop
Dear all, I am trying to run a loop in my codes, but the software returns an error: "subscript out of bounds" I dont understand exactly why this is happenning. My codes are the following: rm(list=ls()) #remove almost everything in the memory set.seed(180185) nsim <- 10 mresultx <- matrix(-99, nrow=1000, ncol=nsim) mresultb <- matrix(-99, nrow=1000, ncol=nsim) N
2006 Sep 24
1
[patch] buffer overflow in q_parser.y
Hi Dave, The patch below corrects a buffer overflow bug in q_parser.y. Since it is triggered by excessively long query strings, I believe that this bug could be exploited to allow arbitrary code execution if a query string supplied by a user is passed in directly to Ferret and not truncatated. If I''m right, you should consider a new release asap. I''ve fixed it to simply
2009 May 27
1
Constrained fits: y~a+b*x-c*x^2, with a,b,c >=0
I wonder whether R has methods for constrained fitting of linear models. I am trying fm<-lm(y~x+I(x^2), data=dat) which most of the time gives indeed the coefficients of an inverted parabola. I know in advance that it has to be an inverted parabola with the maximum constrained to positive (or zero) values of x. The help pages for lm do not contain any info on constrained fitting. Does anyone
2005 Sep 08
1
clustering: Multivariate t mixtures
Hi, Before I write code to do it does anyone know of code for fitting mixtures of multivariate-t distributions. I can't use McLachan's EMMIX code because the license is "For non commercial use only". I checked, mclust and flexmix but both only do Gaussian. Thanks Nicholas