[Yuima-commits] r151 - in pkg/yuima: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Apr 30 05:44:25 CEST 2011


Author: iacus
Date: 2011-04-30 05:44:24 +0200 (Sat, 30 Apr 2011)
New Revision: 151

Modified:
   pkg/yuima/DESCRIPTION
   pkg/yuima/R/lasso.R
   pkg/yuima/man/lasso.Rd
Log:
updated LASSO

Modified: pkg/yuima/DESCRIPTION
===================================================================
--- pkg/yuima/DESCRIPTION	2011-04-25 04:31:57 UTC (rev 150)
+++ pkg/yuima/DESCRIPTION	2011-04-30 03:44:24 UTC (rev 151)
@@ -1,8 +1,8 @@
 Package: yuima
 Type: Package
 Title: The YUIMA Project package (unstable version)
-Version: 0.1.186
-Date: 2011-04-25
+Version: 0.1.187
+Date: 2011-04-29
 Depends: methods, zoo, stats4, utils
 Suggests: cubature, mvtnorm
 Author: YUIMA Project Team.

Modified: pkg/yuima/R/lasso.R
===================================================================
--- pkg/yuima/R/lasso.R	2011-04-25 04:31:57 UTC (rev 150)
+++ pkg/yuima/R/lasso.R	2011-04-30 03:44:24 UTC (rev 151)
@@ -1,6 +1,6 @@
 # Initial version of lasso estimation for SDEs
 
-lasso <- function(yuima, lambda0, start, ...){
+lasso <- function(yuima, lambda0, start, delta=1, ...){
 	
 	call <- match.call()
 	
@@ -39,7 +39,11 @@
 	return(list(mle=fail, sd.mle=NA, lasso=fail, sd.lasso=NA))
 	
 	
-	lambda <- unlist(lambda0[names(theta.mle)])/abs(theta.mle)
+#	lambda <- unlist(lambda0[names(theta.mle)])/abs(theta.mle)
+	lambda <- unlist(lambda0[names(theta.mle)])/abs(theta.mle)^delta
+    lambda1 <- unlist(lambda0[names(theta.mle)])/abs(theta.mle)
+	idx <- which(lambda>1e7)
+	lambda[idx] <- lambda1[idx]
 	
 	f2 <- function( theta ) as.numeric( t(theta-theta.mle) %*% H %*% (theta-theta.mle) + lambda %*% abs(theta) )
 	
@@ -55,7 +59,8 @@
 	SIGMA1 <- try(sqrt(diag(solve(fit2$hessian))), silent=TRUE)
 	
 	if(class(SIGMA1)=="try-error")
-	return(list(mle=fail, sd.mle=NA, lasso=fail, sd.lasso=NA))
+	return(list(mle = theta.mle, sd.mle = NA, lasso = theta.lasso, sd.lasso = NA))
+#	return(list(mle=fail, sd.mle=NA, lasso=fail, sd.lasso=NA))
 	
 	return(list(mle=theta.mle, sd.mle=SIGMA, lasso=theta.lasso, sd.lasso=SIGMA1,call=call, lambda0=lambda0))
 }

Modified: pkg/yuima/man/lasso.Rd
===================================================================
--- pkg/yuima/man/lasso.Rd	2011-04-25 04:31:57 UTC (rev 150)
+++ pkg/yuima/man/lasso.Rd	2011-04-30 03:44:24 UTC (rev 151)
@@ -3,12 +3,13 @@
 \title{Adaptive LASSO estimation for stochastic differential equations}
 \description{Adaptive LASSO estimation for stochastic differential equations.}
 \usage{
-lasso(yuima, lambda0, start, ...)
+lasso(yuima, lambda0, start, delta=1, ...)
 }
 \arguments{
   \item{yuima}{a yuima object.}
   \item{lambda0}{a named list with penalty for each parameter.}
   \item{start}{initial values to be passed to the optimizer.}
+  \item{delta}{controls the amount of shrinking in the adaptive sequences.}
   \item{...}{passed to \code{\link{optim}} method. See Examples.}
 }
 \details{



More information about the Yuima-commits mailing list