similar to: R: ridge regression

Displaying 20 results from an estimated 200 matches similar to: "R: ridge regression"

2011 Mar 12
2
Identifying unique pairs
Dear R helpers Suppose I have a data frame as given below mydat = data.frame(x = c(1,1,1, 2, 2, 2, 2, 2, 5, 5, 6), y = c(10, 10, 10, 8, 8, 8, 7, 7, 2, 2, 4)) mydat         x     y 1      1     10 2      1     10 3      1     10 4      2       8 5      2       8 6      2       8 7      2       7 8      2       7 9      5       2 10    5       2 11    6       4 unique(mydat$x) will give me 1,
2009 Aug 12
3
Obtaining the value of x at a given value of y in a smooth.spline object
I have some data fit to a smooth.spline object as follows: (x=vector of data for the predictor variable, y=vector of data for the response variable) fit <- smooth.spline(x,y) Now, given a spline fit point y_new, I want to be able to find out what value of x_new yielded this fit value. How to do so? (This problem is the inverse of the predict.smooth.spline function, which takes x_new as input
2009 Aug 21
1
applying summary() to an object created with ols()
Hello R-list, I am trying to calculate a ridge regression using first the *lm.ridge()* function from the MASS package and then applying the obtained Hoerl Kennard Baldwin (HKB) estimator as a penalty scalar to the *ols()* function provided by Frank Harrell in his Design package. It looks like this: > rrk1<-lm.ridge(lnbcpc ~ lntex + lnbeerp + lnwinep + lntemp + pop, subset(aa,
2009 Sep 23
1
BLUP with missing data
hello guys, I need to do a BLUP in the simplest model y = Xm + Zg + e however I have missing data in the analysis which I can?t consider as 0(zero). So I need to generate the matrix X'Z, Z'X and Z'Z step by step; I can?t use crossprod(x) #neither X'X <- t(x)%*%x because I should skip the elements with missing data in the matrix I?ll try to be more clear, supposing a matrix x
2005 Jul 20
1
predict.lm - standard error of predicted means?
Simple question. For a simple linear regression, I obtained the "standard error of predicted means", for both a confidence and prediction interval: x<-1:15 y<-x + rnorm(n=15) model<-lm(y~x) predict.lm(model,newdata=data.frame(x=c(10,20)),se.fit=T,interval="confidence")$se.fit 1 2 0.2708064 0.7254615
2010 Nov 07
3
help! kennard-stone algorithm in soil.spec packages does not work for my dataset!!!
http://r.789695.n4.nabble.com/file/n3031344/RSV.Rdata RSV.Rdata I want to split my dataset to training set and test set using kennard-stone(KS) algorithm, it is lucky there is R packages soil.spec to implement it. but when I used it to my dataset, it does not work, who can help me, how reasons is it, below, it is my code, and my data in the attachment.
2004 May 10
1
app_sms - rocks!
Ok, I just thought I'd publicly pat Adrian Kennard (revk) on the back for this application. This is an excellent contribution and gets my vote for app of the year. For those that aren't aware app_sms allows you to send/receive fixed line sms messages from asterisk. ( you can take a look at a quick page showing this http://www.automated.it/asterisk/sms.html ).. I should point out that
2004 Sep 10
2
Asterisk and VoDSL
Hi, I'm new to telephony Software and Hardware, so please excuse my questioning. I plan to set up a little system, using Asterisk and VoDSL via Belcacom or Scarlet here in belgium. We are yust a little 2 man company and we are not always in our office. My idea is, to get VoDSL and set up a system that works as following: A customer sends SMS or phones to our office-numbers, if we are out,
2009 Jan 14
2
Vectorization of three embedded loops
Dear R-programmer, I wrote an adapted implementation of the Kennard-Stone algorithm for sample selection of multivariate data (R 2.7.1 under MacBook Pro, Processor 2.2 GHz Intel Core 2 Duo, Memory 2 GB 667 MHZ DDR2 SDRAM). I used for the heart of the script three embedded loops. This makes it especially for huge datasets very slow. For a datamatrix of 1853*1853 and the selection of 556
2003 Aug 14
2
How to get the pseudo left inverse of a singular square matrix?
Dear R-listers, I have a dxr matrix Z, where d > r. And the product Z*Z' is a singular square matrix. The problem is how to get the left inverse U of this singular matrix Z*Z', such that U*(Z*Z') = I? Is there any to figure it out using matrix decomposition method? Thanks a lot for your help. Fred
2002 Sep 08
2
Rsync fail repeatedly on the same files.
Hello, I?m trying to rsync Windows 2000 to Linux. It fail on the same file every in every try. If I delete from the source the problematic file, then it fail again after a while on other file. The file size vary etc. I install rsync on other Linux for test, and there was no problem to rsync the entire directory to this new destination. The error message on the client site is some
2004 May 13
3
GLMMs & LMEs: dispersion parameters, fixed variances, design matrices
Three related questions on LMEs and GLMMs in R: (1) Is there a way to fix the dispersion parameter (at 1) in either glmmPQL (MASS) or GLMM (lme4)? Note: lme does not let you fix any variances in advance (presumably because it wants to "profile out" an overall sigma^2 parameter) and glmmPQL repeatedly calls lme, so I couldn't see how glmmPQL would be able to fix the dispersion
2010 Nov 16
2
Vectors out of lists?
Hello there I have a list, Y, and each component of that list is a real-valued function (that is, Y[[i]](u) returns a number). I was wishing to build the mean function and the first thing I thought of was Ybar<-function(u){ mean(Y[[1:n]](u)) } but obviously this doesn't work, since Y[[1:n]] is not allowed at all. Any elegant suggestions? I really would like to avoid something like
2008 Jul 20
4
drawing segments through points with pch=1
Please excuse me for asking such basic questions: Here is my code > y=c(1.21,0.51,0.14,1.62,-0.8,0.72,-1.71,0.84,0.02,-0.12) > ybar=mean(y) > ll=length(y); > ybarv=rep(ybar,ll) > x=1:ll > plot(x,ybarv,pch=1) > segments(x[1],ybar,x[ll],ybar) What I get is a collection of small circles, with a segment "on top" of the circles, which is almost what I want. But I
2013 Apr 24
0
Help me make faster R code for Kennard-Stone algorithm [My code is so slow from Matlab]
Hi all, Can you help me change my Kennard-Stone algorithm to faster one? [The original code can run fast in matlab, but when I change matlab code to R code, it is so slow.] Since my code so crude and too many loops (changed from matlab code), it is too slow. I hope that you can help to improve the performance. Thanks. kevin
2008 Jul 20
3
asp and ylim
#See David Williams' book "Weighing the odds", p286 y <- c(1.21, 0.51, 0.14, 1.62, -0.8, 0.72, -1.71, 0.84, 0.02, -0.12) ybar <- mean(y) ylength <- length(y) ybarv <- rep(ybar, ylength) x <- 1:ylength plot(x,y,asp=1,xlab="position",ylab="ybar",type="n",ylim=c(-1,1)) segments(x[1], ybar, x[ylength], ybar) segments(x,ybarv,x,y)
2011 Jun 03
2
Y error bars, dates on the X-axis
Dear forum, Does anyone know any functions for plotting vertical error bars, if the x-axis variable is a date? I can produce a pretty plot with dates on the x-axis, if I don't want to include error bars. I can also produce a nice plot with error bars, if I just use Julian days for the x-axis, but I'd much rather have the actual dates. I have tried writing my own function, plotCI
2008 Sep 06
2
Hopefully an easy error bar question
Hi im trying to add error bars to my barplots, there very basic, i have a few grapghs where the y variable is different but on all the X variable is Age (Adult and Juvenile) however this is split into two levels so i have males and females, so my graph basically has four bars on it. I know how to add eror bars for instance when there is only one level eg lookng at the diffrence between male and
2007 Sep 25
2
Need help with function writing
Hello: If anyone could guide me with this I would greatly appreciate it. Thanking you in advance for your assistance. Using a 3-level input factor alternative so that a function(below) can compute both a two-sided and one-sided p-values. Making the two-sided test the default. And produce output information about which alternative was tested. Where would I place the ifelse statement?
2010 Nov 18
0
On efficiency, Vectorize and loops
In my last e-mails, I have asked for help regarding 1. 'defining functions inside loops' 2. 'integrating functions / vector arithmetics' 3. 'vectors out of lists?' 4. 'numerical integration' Since some of these topics seemed to be relevant (I'm guessing by the # of replies I got), I'm posting a modified section of my code. Any thoughts on improvements would