similar to: non-negative least-squares

Displaying 20 results from an estimated 300 matches similar to: "non-negative least-squares"

2009 Jun 26
3
panel.text and saving to pdf
Dear all, I am not sure what I am doing wrong, but I have some unexplained behaviour when saving a lattice graph including text to a pdf file. The text seems to move around. It must have something to do with the way coordinates are set in devices other than jpg. Any suggestions would be helpful Willem Here is some example code setwd("c:/willem/research/misc") today <-
2004 Feb 22
0
countourplot background
Hi, Found the answer to the background myself: 'trellis.par.get' and 'trellis.par.set' background<-trellis.par.get("background") background$col<-"white" trellis.par.set("background", background) Willem -- Dr R.W. Vervoort McCaughey Senior Lecturer Hydrology and Catchment Management Faculty of Agriculture, Food and Natural Resources Rm 503,
2010 Dec 06
1
use pcls to solve least square fitting with constraints
Hi, I have a least square fitting problem with linear inequality constraints. pcls seems capable of solving it so I tried it, unfortunately, it is stuck with the following error: > M <- list() > M$y = Dmat[,1] > M$X = Cmat > M$Ain = as.matrix(Amat) > M$bin = rep(0, dim(Amat)[1]) > M$p=qr.solve(as.matrix(Cmat), Dmat[,1]) > M$w = rep(1, length(M$y)) > M$C = matrix(0,0,0)
2009 Feb 25
1
monotonic GAM with more than one term
Hi, Does anyone know how to fit a GAM where one or more smooth terms are constrained to be monotonic, in the presence of "by" variables or other terms? I looked at the example in ?pcls but so far have not been able to adapt it to the case where there is more than one predictor. For example, require(mgcv) set.seed(0) n<-100 # Generate data from a monotonic truth.
1999 Jul 26
1
Logistic regression with coef>0
Hi, recently I saw but did not pay too much attention to a question that concerned regression with positive coefficients. In Splus, thereis the nnls() function that can be used if I am not wrong, but what about R ? Now I have the same problem: doing a logistic regression under constraint that coefs are non negative. What can I do with R? is there a (weighted) nnls() counterpart available? Thanks
2007 Nov 25
1
GAM with constraints
Hi, I am trying to build GAM with linear constraints, for a general link function, not only identity. If I understand it correctly, the function pcls() can solve the problem, if the smoothness penalties are given. What I need is to incorporate the constraints before calculating the penalties. Can this be done in R? Any help would be greately appreciated. -- View this message in context:
2011 Dec 21
3
Non-negativity constraints for logistic regression
Dear R users, I am currently attempting to fit logistic regression models in R, where the slopes should be restricted to positive values. Although I am aware of the package nnls (which does the trick for linear regression models), I did not find any solution for logistic regression. If there is any package available for this purpose, I would be interested to know them. Alternatively, I realize
2013 Mar 11
1
Use pcls in "mgcv" package to achieve constrained cubic spline
Hello everyone,          Dr. wood told me that I can adapting his example to force cubic spline to pass through certain point.          I still have no idea how to achieve this. Suppose we want to force the cubic spline to pass (1,1), how can I achieve this by adapting the following code? # Penalized example: monotonic penalized regression spline ..... # Generate data from a monotonic truth.
1999 Jul 07
1
Linear Models with positive coefficients?
Hi, is it possible in one of the libraries on linear methods to constrain the coefficients to be positive? Thanks Chris -- Christoph M. Friedrich | mailto:friedrich at computer.org Gesellschaft f?r Modulfermenterbau mbH (GfM mbH) | http://www.tussy.uni-wh.de/~chris Alfred-Herrhausen Str. 44 ; D-58455 Witten, Germany
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
2007 Oct 15
0
new package 'nnls'
A new package 'nnls' is now available on CRAN. The package provides an R interface to the Lawson-Hanson NNLS algorithm for non-negative least squares that solves the least squares problem A x = b with the constraint x >= 0. The Lawson-Hanson NNLS algorithm was published in Lawson CL, Hanson RJ (1974). Solving Least Squares Problems. Prentice Hall, Englewood Cliffs, NJ. Lawson CL,
2007 Oct 15
0
new package 'nnls'
A new package 'nnls' is now available on CRAN. The package provides an R interface to the Lawson-Hanson NNLS algorithm for non-negative least squares that solves the least squares problem A x = b with the constraint x >= 0. The Lawson-Hanson NNLS algorithm was published in Lawson CL, Hanson RJ (1974). Solving Least Squares Problems. Prentice Hall, Englewood Cliffs, NJ. Lawson CL,
2013 Mar 19
0
linear model with equality and inequality (redundant) constraints
Dear R-users, in the last days I have been trying to estimate a normal linear model with equality and inequality constraints. Please find below a simple example of my problem. Of course, one could easily see that, though the constraints are consistent, there is some redundancy in the specific constraints. Nevertheless my actual applications can get much larger and I would not like to manually
2012 Jan 04
0
Non Negative Least Squares Regression with nnls
Hello R experts, I have two questions related to the nnls library (http://www.inside-r.org/packages/cran/nnls), and more broadly to linear regression with positive coefficients. Sample code is below the Qs. Q1: Regular regression (with lm) gives me the significance of each variable. How do I get variable significance with nnls? If there's no ready function, any easy way to manually derive
2007 Aug 30
7
Behaviour of very large numbers
Dear all, I am struggling to understand this. What happens when you raise a negative value to a power and the result is a very large number? B [1] 47.73092 > -51^B [1] -3.190824e+81 # seems fine # now this: > x <- seq(-51,-49,length=100) > x^B [1] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN <snip> > is.numeric(x^B) [1] TRUE > is.real(x^B) [1]
2020 Nov 03
2
Query on constrained regressions using -mgcv- and -pcls-
Hello all, I'll level with you: I'm puzzled! How is it that this constrained regression routine using -pcls- runs satisfactorily (courtesy of Tian Zheng): library(mgcv) options(digits=3) x.1=rnorm(100, 0, 1) x.2=rnorm(100, 0, 1) x.3=rnorm(100, 0, 1) x.4=rnorm(100, 0, 1) y=1+0.5*x.1-0.2*x.2+0.3*x.3+0.1*x.4+rnorm(100, 0, 0.01) x.mat=cbind(rep(1, length(y)), x.1, x.2, x.3, x.4)
2007 Dec 03
0
new package 'bvls', update of 'nnls'
A new package 'bvls' is available on CRAN. The package provides an R interface to the Stark-Parker algorithm for bounded-variable least squares (BVLS) that solves A x = b with the constraint l <= x <= u under least squares criteria, where l,x,u \in R^n, b \in R^m and A is an m \times n matrix. The Stark-Parker BVLS algorithm was published in Stark PB, Parker RL (1995).
2007 Dec 03
0
new package 'bvls', update of 'nnls'
A new package 'bvls' is available on CRAN. The package provides an R interface to the Stark-Parker algorithm for bounded-variable least squares (BVLS) that solves A x = b with the constraint l <= x <= u under least squares criteria, where l,x,u \in R^n, b \in R^m and A is an m \times n matrix. The Stark-Parker BVLS algorithm was published in Stark PB, Parker RL (1995).
2013 Jul 19
0
mgcv: Impose monotonicity constraint on single or more smooth terms
Dear R help list, This is a long post so apologies in advance. I am estimating a model with the mgcv package, which has several covariates both linear and smooth terms. For 1 or 2 of these smooth terms, I "know" that the truth is monotonic and downward sloping. I am aware that a new package "scam" exists for this kind of thing, but I am in the unfortunate situation that I am
2006 Sep 04
2
Fitting generalized additive models with constraints?
Hello, I am trying to fit a GAM for a simple model, a simple model, y ~ s(x0) + s(x1) ; with a constraint that the fitted smooth functions s(x0) and s(x1) have to each always be >0. >From the library documentation and a search of the R-site and R-help archives I have not been able to decipher whether the following is possible using this, or other GAM libraries, or whether I will have to try