[Yuima-commits] r136 - pkg/yuima/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Nov 1 05:49:16 CET 2010


Author: kamatani
Date: 2010-11-01 05:49:15 +0100 (Mon, 01 Nov 2010)
New Revision: 136

Modified:
   pkg/yuima/man/adaBayes.Rd
Log:
fix bugs in examples for  adaBayes

Modified: pkg/yuima/man/adaBayes.Rd
===================================================================
--- pkg/yuima/man/adaBayes.Rd	2010-11-01 04:47:39 UTC (rev 135)
+++ pkg/yuima/man/adaBayes.Rd	2010-11-01 04:49:15 UTC (rev 136)
@@ -4,8 +4,8 @@
 \title{Adaptive Bayes estimator for the parameters in sde model}
 \description{Adaptive Bayes estimator for the parameters in a specific type of sde.}
 \usage{
-adaBayes(yuima, print = FALSE, start, prior, propose, n.iter = 100, 
-    lower, upper, n.burnin, method = "nomcmc", mhtype = "independent")
+adaBayes(yuima, print = FALSE, start, prior, 
+    lower, upper, method = "nomcmc")
 }
 \arguments{
   \item{yuima}{a 'yuima' object.}
@@ -13,7 +13,7 @@
   \item{start}{ initial suggestion for parameter values }
   \item{propose}{ ... }
   \item{print}{trace optimization?}
-  \item{method}{ \code{nomcmc} requires package \code{adapt} }
+  \item{method}{ \code{nomcmc} requires package \code{cubature} }
   \item{mhtype}{ ... }
   \item{n.burnin}{ ... }
   \item{lower}{ ... }
@@ -30,13 +30,11 @@
   This routine is not stable and accurate. Dr.Kamatani is now working for improvements.
 }
 \examples{
-\dontrun{
-library(yuima)
 set.seed(123)
 
 ymodel <- setModel(drift="(-1)*theta2*x", diffusion="sqrt(theta1^2+1)",
                    time.variable="t", state.variable="x", solve.variable="x")
-n <- 100
+n <- 500
 h <- 1/((n)^(2/3))
 ysamp <- setSampling(Terminal=(n)^(1/3), n=n) 
 yuima <- setYuima(model=ymodel, sampling=ysamp)
@@ -49,18 +47,17 @@
 prior.theta2 <- function(theta1)
   1*(theta1 > 0 & theta1 < 1)
 
-prior <- list(theta1=list(measure.type="density", density=prior.theta1,domain=c(-2,2)),
-theta2=list(measure.type="density", density=prior.theta2,domain=c(-2,2)))
+prior <- list(theta2=list(measure.type="code",df="dunif(z,0,1)"), theta1=list(measure.type="code",df="dunif(z,0,1)"))
 
 param.init <- list(theta2=0.35,theta1=0.52)
 
 lower = c(0,0)
 upper=c(1,1)
 
-bayes1 <- adaBayes(yuima, start=param.init, lower=lower,upper=upper,prior=prior, method="nomcmc")
-bayes1
+bayes1 <- adaBayes(yuima, start=param.init, prior=prior, method="nomcmc")
+bayes1 at coef
 
 mle1 <- qmle(yuima, start=param.init, lower=list(theta1=0,theta2=0), upper=list(theta1=1,theta2=1), method="L-BFGS-B")
 mle1 at coef
-}}
+}
 \keyword{ts}



More information about the Yuima-commits mailing list