Displaying 20 results from an estimated 2000 matches similar to: "Constrained regressions (suggestions welcome)"
2007 May 18
0
Cross-validation for logistic regression with lasso2
Hello, I am trying to shrink the coefficients of a logistic regression for a
sparse dataset, I am using the lasso (lasso2) and I am trying to determine
the shrinkinage factor by cross-validation. I would like please some of the
experts here to tell me whether i'm doing it correctly or not. Below is my
dataset and the functions I use
w=
a b c d e P A
0 0 0 0 0 1 879
1 0 0 0 0 1 3
0 1 0 0 0 7 7
2004 May 11
1
How to use c routines in the exiting package?
Hi all,
I want to know some details about the c routine “lasso” in the functions
of “gl1ce()” . However, I have following troubles. First, I can not
find the routine in the local directories of this function (or package).
Second, if I found the routine, could I call it just like this way, say,
fit <- .C("lasso", …,PACKAGE = "lasso2") in my own functions. My system
is
2006 May 09
1
Question about match.fun()
Dear all,
I was recently contacted by a user about an alledged problem/bug in
the latest version of lasso2. After some investigation, we found out
that it was a user error which boils down to the following:
> x <- matrix(rnorm(200), ncol=2)
> var <- "fred"
> apply(x, 2, var)
Error in get(x, envir, mode, inherits) : variable "fred" of mode "function"
2007 Nov 09
1
help with lasso2 package
X is a matrix and F is a vector.
F2 <- data.frame(cbind(X,F))
F2
V1 V2 V3 F
1 -0.250536332 -1.4755883 1.9580974 -2.136487
2 -0.009856084 0.4953269 0.5486092 -2.744482
3 -0.406962682 0.7729631 0.1861905 -2.891821
4 1.938780097 0.7469251 1.2537781 -1.212992
5 -0.332370358 1.1943637 0.7114278 -1.830441
modF<-formula(F ~ V1 + V2 + V3) #no error message
2007 Jul 25
1
question on using "gl1ce" from "lasso2" package
Hi,
I tried several settings by using the "family=gaussian"
in "gl1ce", but none of them works.
For the case "glm" can work.
Here is the error message I got:
> glm(Petal.Width~Sepal.Length+Sepal.Width+Petal.Length
,data=iris,family=gaussian())
> gl1ce(Petal.Width~Sepal.Length+Sepal.Width+Petal.Length
,data=iris,family=gaussian())
Error in eval(expr, envir,
2003 Dec 04
2
predict.gl1ce question
Hi,
I'm using gl1ce with family=binomial like so:
>yy
succ fail
[1,] 76 23
[2,] 32 67
[3,] 56 43
...
[24,] 81 18
>xx
c1219 c643
X1 0.04545455 0.64274145
X2 0.17723669 0.90392792
...
X24 0.80629054 0.12239320
>test.gl1ce <- gl1ce(yy ~ xx, family = binomial(link=logit), bound =
0.5 )
or
>omit <- c(2,3)
>test.gl1ce
2010 Apr 21
1
Best subset of models for glm.nb()
Dear List,
I am looking for a function that will find the best subset of negative binomial models. I have a large data set with 15 variables that I am interested in. I want an easy way to run all possible models and find a subset of the "best" models that I can then look at in more detail. I have found two functions that seem to provide what I am looking for, but am not sure which
2005 Nov 04
1
small bug in gl1ce, package lasso2 (PR#8280)
Full_Name: Grant Izmirlian
Version: 2.2.0
OS: SuSe Linux version 9.2
Submission from: (NULL) (156.40.34.177)
Sorry about the last submission, my bug-fix had an error in it because ifelse
doesn't vectorize. I'll repost with the correct bug-fix.
-------------------------------------------------------------------------------
The option exists to include all parameters, including the
2010 Jun 27
1
Dual nw card problem again
I have had problems like this before. Probably there is something
important that I don't know about routing.
Let me introduce to you "Lasso2", a CentOS 4 www server that has been
working perfectly well for years.
Now I added a second nw card (eth1), automatically using kudzu. I cannot
get this dual nw setup to work. The first nw card (eth0) stopped at once
working properly,
2003 Sep 25
1
data lost in cv.tree?
Greetings -- I'm programming a data mining system
in R for protein structural data. As a seasoned
Perl and Python and Ada and ML, et al., programmer,
I am severely befuddled by the environment problem,
where data is not found in a 3rd level nested
function. I did peruse the parent frame not on the
search path idea, and came up with a hack which
kinda works, also below with the code which
2005 Jul 01
1
scope argument in step function
Thanks a lot for help in advance. I am switching from matlab to R and I guess I need some time to get rolling. I was wondering why this code :
> fit.0 <- lm( Response ~ 1, data = ds3)
> step(fit.0,scope=list(upper=~.,lower=~1),data=ds3)
Start: AIC= -32.66
Response ~ 1
Call:
lm(formula = Response ~ 1, data = ds3)
Coefficients:
(Intercept)
1.301
is not working
2004 Oct 11
0
scoping problem when calling step inside a function
Hi everyone -
I'm trying to do a forward stepwise regression (I've tried both step
and stepAIC) inside of a function. I can do it outside the function
with no problems (first example in code below). I can also do a
backward stepwise regression inside a function (second example), but
forward stepwise regression ( third example ) fails with the error:
"Error in
2005 Aug 16
4
as.character and a formula
Dear list,
given this formula:
> fmla <- formula(y1 ~ spp1 + spp2 + spp3 + spp5)
> fmla[[3]]
spp1 + spp2 + spp3 + spp5
is this the intended behaviour of as.character:
> as.character(fmla[[3]])
[1] "+" "spp1 + spp2 + spp3" "spp5"
? Where does the extra "+" come from?
> as.character(fmla)
[1] "~"
2012 Feb 28
2
update.formula has 512 char buffer?
Hello,
I am trying to "paste" together a formula to use in the mob function of
party. This means the formula will be of the form y ~ x1+ ...+xM | z1+..zN.
I am doing some preliminary fits of y ~ x1+ ...+xM, then want to add the
conditional part of the equation using update().
Here's the test code:
var1 <- 1:78
x1 <- paste("x", var1, sep="")
f1 <-
2011 Dec 19
1
pls help to print out first row of terms(model) output in example program
Greetings.
I've written a convenience function for multicollinearity diagnosis.
I'd like to report to the user the formula that is used in a
regression. I get output like this:
> mcDiagnose(m1)
[1] "The following auxiliary models are being estimated and returned in a list:"
[1] "`x1` ~ ."
formula(fmla)()
[1] "`x2` ~ ."
I'd like to fill in the period
2019 Sep 05
2
ARM vectorized fp16 support
Hi,
I'm trying to compile half precision program for ARM, while it seems
LLVM fails to automatically generate fused-multiply-add instructions
for c += a * b. I'm wondering whether I did something wrong, if not,
is it a missing feature that will be supported later? (I know there're
fp16 FMLA intrinsics though)
Test programs and outputs,
$ clang -O3 -march=armv8.2-a+fp16fml
2011 May 17
5
Feed a list of filenames to vim
There are some googlable ways to feed a list of filenames to vim, but I
stumble on weird results.
With my filelist, I try to do
cat list | xargs vim
...to edit the files listed in the file "list". Here's what happens:
[root at lasso2 tempdir]# ls -l
total 8
-rw-r--r-- 1 root root 0 May 17 18:28 a
-rw-r--r-- 1 root root 0 May 17 18:28 b
-rw-r--r-- 1 root root 3 May 17
2012 Jan 25
4
formula error inside function
I want use survfit() and basehaz() inside a function, but it doesn't work.
Could you take a look at this problem. Thanks for your help. Following is my
codes:
library(survival)
n <- 50 # total sample size
nclust <- 5 # number of clusters
clusters <- rep(1:nclust,each=n/nclust)
beta0 <- c(1,2)
set.seed(13)
#generate phmm data set
Z <- cbind(Z1=sample(0:1,n,replace=TRUE),
2008 Aug 29
1
nls() fails on a simple exponential fit, when lm() gets it right?
Dear R-help,
Here's a simple example of nonlinear curve fitting where nls seems to get
the answer wrong on a very simple exponential fit (my R version 2.7.2).
Look at this code below for a very basic curve fit using nls to fit to (a)
a logarithmic and (b) an exponential curve. I did the fits using
self-start functions and I compared the results with a more simple fit
using a straight lm()
2005 Jul 20
1
aregImpute in Hmisc
Hi,
I have a dataframe ds1.2 - 503 categorial variables
and 1 continuous response variables. I ran aregImpute
to deal with NA's and got the followig error:
> fmla = terms( Response ~ . ,data=ds1.2)
> ds.i = aregImpute(fmla,data=ds1.2)
Error in matrix(as.double(1), nrow = n, ncol = p,
dimnames = list(rnam, :
length of dimnames [2] not equal to array
extent
Could you explain