similar to: Elasticnet - Cross validation problem

Displaying 20 results from an estimated 5000 matches similar to: "Elasticnet - Cross validation problem"

2009 Apr 05
2
loop problem for extract coefficients
Dear R users, I have problem with extracting coefficients from a object. Here, X (predictor)and Y (response) are two matrix , I am regressing X ( dimensions 10 x 20) on each of columns of Y[,1] (10 x 1) and want to store the coefficient values. I have performed a Elastic Net regression and I want to store the coeffcients in each iteration. I got an error message . I do not
2009 Aug 04
2
error in Elastic net
Dear R users,   I am new user for elastic net. I am trying to use elasticnet library. I have marker data with 359 markers and 168 samples, and response is metabolites. I am trying to do regression between a metabolite and markers.  But i am getting the following error:   > en<-enet(marker,as.numeric(vio),lambda=0.5,normalize=FALSE,intercept=TRUE) Error in one %*% x : requires numeric
2009 Jul 12
0
Plotting problem [lars()/elasticnet()]
Dear all, I am using modified LARS algorithm (ref: The Adaptive Lasso and Its Oracle Properties, Zou 2006) for adaptive lasso penalized linear regression. 1. w(j) <- |beta_ols(j)|^(-gamma) gamma>0 and j = 1,...,p 2. define x_new(j) <- x(j)*w(j) 3. apply LARS to solve modified lasso problem out.adalasso <- lars(X_new,y,type="lasso") or enet(X_new,
2006 Apr 23
1
help! A quetion about the Elasticnet package in R
Can anybody help me to run the Elasticnet package of R to build some model, i am a freshman to R language , when i use the Elasticnet package to my data, it always reture a error, but i can't settle that problem. I consider if there is any constrant of the data to that package? Can anyone help me to run the elasticnet and check my data as you convenient? I put the data in attachment. Thank
2012 Jun 11
3
Decision Trees or Markov Models for Cost Effectiveness
Hello, I was just assigned to perform a cost effectiveness study in healthcare. We are studying the cost effectiveness of a proposed diagnostic vs. current screening procedures. One of the team members suggest a commercial software package called "TreeAge Pro". Looking at the description, it appears to be a nice GUI to some very simple models that could be easily constructed in R.
2012 May 18
2
Failure building any package
Hello, I'm attempting to build a package using R 2.15.0 on OS X I am getting a generic failure when performing a cran type check on the package. Even with a very simple test package, it still fails int he same place. Example: In R: rm(list=ls()) foo <- function(x){print(x)} package.skeleton(name="foo") Then, at the command line: R CMD build foo R CMD check --as-cran
2012 Oct 09
4
Convert COLON separated format
I have a bunch of data sets that were created for the libsvm tool. They are in "colon separated sparse format". i.e. 1 5:1 27:3 345:10 Is a row with the label of "1" and only has values in columns 5, 27, and 345. I want to read these into a data.frame in R. Is there a simple way to do this? -- Noah Silverman, M.S. UCLA Department of Statistics 8117 Math Sciences
2011 Sep 02
2
Avoiding for Loop for moving average
Hello, I need to calculate a moving average and an exponentially weighted moving average over a fairly large data set (500K rows). Doing this in a for loop works nicely, but is slow. ewma <- data$col[1] N <- dim(data)[1] for(i in 2:N){ data$ewma <- alpha * data$ewma[i-1] + (1-alpha) * data$value[i] } Since the moving average "accumulates" as we move through the data,
2011 Aug 23
2
dummy variables from factors
Hi, Looking at a large data set with many factors. I would like to expand each factor variable into multiple new variables for each level. (0,1) coding. My first though was just to code a big nasty loop, to take each level and cbind a column onto my data set. But, that seems painful. There must be a better way. Is there an "easy" way to do this in R? (Note, I don't want to
2011 Jun 20
1
access objects by name
Hi, I have several data structures (xts structures). I then have a list of the names of those objects. I'd like to access the object by name. For example: foo1 <- as.xts(....) foo2 <- as.xts(...) foo3 <- as.xts(...) structs <- c("foo1", "foo2", "foo3") for (thisOne in structs){ print(thisOne$colA) } The above fails. Clearly I'm missing a
2011 Aug 23
1
Glmnet lambda value choice
Hi, When using the glmnet() function of the package glmnet, A series of coefficients is returned for a list of descending lambda values. I am unable to locate anything in the documentation that explains HOW this choice of lambda series is made. (There is documentation about how to choose my own, but I want to understand how the authors are doing it) Any ideas? -- Noah Silverman UCLA
2011 Sep 14
1
Open file for reading and writing with APPEND
Hi, I want to keep a running file of some statistics generated by a running process. Occasionally the process will be restarted. On restart, I'd like to read the last line of the log file to set some variables to their last state, and then continue to append values to that same file. I can't seem to get the appending part to work. I can read values form the file, but then upon the
2011 Aug 20
1
Raw epoch time from XTS
Hi, I have a very large data set stored as an xts object. xts is very nice about showing row labels as "human readable" dates and times. I want the actual epoch values that are stored internally. The only way I can find to access them is one-at-a-time using the internal function: xcoredata() Calling this in an entire column, the "R" way doesn't work. It will only
2012 May 18
4
Menus - best practices?
Hello, I need to design a fairly simple front-end for someone to use an R script system that I've built. My thought was to just use the text based menus available in the base R package, perhaps in some kind of loop. How have other people done this? Any "best practices" that you can recommend? Thanks! -- Noah Silverman UCLA Department of Statistics 8117 Math Sciences Building
2012 Nov 25
1
rjags and parallel chains
Hello, I have a fairly complex hierarchical model that I using rjags to fit. Short test runs verify that it works and everything appears to be setup correctly. Now that I want to collect a larger sample from the posterior (5,000 or more). This looks like it will take several days to run on my hardware (Intel core i7, 16GB RAM) I read in the rjags documentation that there is an option for
2013 May 13
1
Math problem with xts objects
Hello, I coming across a strange problem doing math on an xts object. If I have an xts object of stock prices (perhaps 5 minute bars of open, high, low,close) and want to do some math, the results fail. For example: d$close[10] - d$open[10] works perfectly d$close[10] - d$open[9] fails. I just get an answer of "numeric(0) Index: numeric(0)". My guess is that xts is breaking
2011 Aug 16
1
Limit when reading in file?
Hello, I'm trying to read in a fairly large file into R, and am getting an odd error (65000 rows, 37 columns) Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 25628 did not have 37 elements That line DOES have 37 elements. As A test, I tried deleting it, and a few surrounding lines. Same error occurs with a different line number. Is there some hard
2011 Sep 12
1
Open a file to APPEND
Hi, I want to store the output of my program to a file. However, With subsequent runs of my code, I'd like to append to the same log file. Currently, I'm using: outfile <- file("log.txt", open="w") cat(results, file=outfile) This works, but will overwrite the log file each time. Is there a way to open a file and have R append to the end? Thanks! -- Noah
2013 Apr 16
2
Strange error with log-normal models
Hi, I have some data, that when plotted looks very close to a log-normal distribution. My goal is to build a regression model to test how this variable responds to several independent variables. To do this, I want to use the fitdistr tool from the MASS package to see how well my data fits the actual distribution, and also build a generalized linear model using the glm command. The summary
2009 Mar 17
1
Double Cross validation for LASSO
Dear R user, I am looking for a code on double cross validation in LASSO , one for optimizing the parameter and other one is for MSEP. If any one have it, please foroward to me. I am using different package like LARS, chemometric etc. Thanks in advance Alex [[alternative HTML version deleted]]