[Yuima-commits] r605 - pkg/yuima/man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Apr 27 03:52:33 CEST 2017
Author: eguchi
Date: 2017-04-27 03:52:33 +0200 (Thu, 27 Apr 2017)
New Revision: 605
Modified:
pkg/yuima/man/qmleLevy.Rd
Log:
modified
Modified: pkg/yuima/man/qmleLevy.Rd
===================================================================
--- pkg/yuima/man/qmleLevy.Rd 2017-04-27 01:51:48 UTC (rev 604)
+++ pkg/yuima/man/qmleLevy.Rd 2017-04-27 01:52:33 UTC (rev 605)
@@ -61,63 +61,32 @@
-\seealso{
-}
+%\seealso{
+%}
\examples{
-## One-dimensional case 1
+## One-dimensional case
dri<-"-theta0*x" ## set drift
-
jum<-"theta1/(1+x^2)^(-1/2)" ## set jump
-
yuima<-setModel(drift = dri
,jump.coeff = jum
,solve.variable = "x",state.variable = "x"
,measure.type = "code"
,measure = list(df="rbgamma(z,1,sqrt(2),1,sqrt(2))")) ## set true model
+n<-3000
+T<-30 ## terminal
+hn<-T/n ## stepsize
-n<-100000
-tp<-0.1
-N<-floor(n*tp) ## the number of samples
-T<-100 ## terminal
-hn<-T/N ## stepsize
-
sam<-setSampling(Terminal = T, n=n) ## set sampling scheme
-subsam<-setSampling(Terminal = T, n=N)
yuima<-setYuima(model = yuima, sampling = sam) ## model
true<-list(theta0 = 1,theta1 = 2) ## true values
upper<-list(theta0 = 4, theta1 = 4) ## set upper bound
lower<-list(theta0 = 0.5, theta1 = 1) ## set lower bound
set.seed(123)
-yuima<-simulate(yuima, xinit = 0, true.parameter = true,sampling = sam, subsampling = subsam) ## generate a path
+yuima<-simulate(yuima, xinit = 0, true.parameter = true,sampling = sam) ## generate a path
start<-list(theta0 = runif(1,0.5,4), theta1 = runif(1,1,4)) ## set initial values
-qmleLevy(yuima,start=start,lower=lower,upper=upper, joint = FALSE, third = TRUE)
+qmleLevy(yuima,start=start,lower=lower,upper=upper, joint = TRUE)
-## One-dimensional case 2
-
-dri<-"-theta0*x" ## set drift
-jum<-"exp(-theta1/(1+x^2))" ## set jump
-yuima<-setModel(drift = dri ,jump.coeff = jum,solve.variable = "x",
- state.variable = "x",measure.type = "code"
- ,measure = list(df="rNIG(z,5,0,5,0)")) ## set model
-n<-100000 ## the number of total generation
-tp<-0.1
-N<-floor(n*tp) ## the number of samples
-T<-100 ## terminal
-hn<-T/N ## stepsize
-sam<-setSampling(Terminal = T, n=n) ## set sampling scheme
-subsam<-setSampling(Terminal = T, n=N)
-yuima<-setYuima(model = yuima, sampling = sam)
-true<-list(theta0 = 1,theta1 = 2) ## true values
-upper<-list(theta0 = 40, theta1 = 40) ## set upper bound
-lower<-list(theta0 = 0.5, theta1 = 1) ## set lower bound
-set.seed(123)
-yuima<-simulate(yuima, xinit = 0, true.parameter = true,sampling = sam,
-subsampling = subsam) ## generate a path
-plot(yuima)
-start<-list(theta0 = runif(1,0.5,40), theta1 = runif(1,1,40)) ## set initial values
-qmleLevy(yuima,start=start,lower=lower,upper=upper, joint = TRUE)
-
## Multi-dimensional case
lambda<-1/2
@@ -130,29 +99,28 @@
jum<-matrix(c("x1*theta2+1","0","0","1"),2,2) ## set coefficients
yuima <- setModel(drift=dri,
- solve.variable=c("x1","x2"),state.variable = c("x1","x2"), jump.coeff=jum, measure.type="code",
- measure=list(df="rvgamma(z, lambda, alpha, beta, mu, Lambda)"))
+ solve.variable=c("x1","x2"),state.variable = c("x1","x2"),
+ jump.coeff=jum, measure.type="code",
+ measure=list(df="rvgamma(z, lambda, alpha, beta, mu, Lambda
+ )"))
-n<-100000 ## the number of total samples
-tp<-0.1 ## the degree of thinning
-N<-floor(n*tp) ## the number of samples used for optimization
-T<-100 ## terminal
-hn<-T/N ## stepsize
+n<-3000 ## the number of total samples
+T<-30 ## terminal
+hn<-T/n ## stepsize
sam<-setSampling(Terminal = T, n=n) ## set sampling scheme
-subsam<-setSampling(Terminal = T, n=N)
yuima<-setYuima(model = yuima, sampling = sam) ## model
-true<-list(theta0 = 1,theta1 = 2,theta2 = 3,lambda=lambda, alpha=alpha, beta=beta,
- mu=mu, Lambda=Lambda) ## true values
+true<-list(theta0 = 1,theta1 = 2,theta2 = 3,lambda=lambda, alpha=alpha,
+beta=beta,mu=mu, Lambda=Lambda) ## true values
upper<-list(theta0 = 4, theta1 = 4, theta2 = 5) ## set upper bound
lower<-list(theta0 = 0.5, theta1 = 1, theta2 = 1) ## set lower bound
set.seed(123)
-yuima<-simulate(yuima, xinit = c(0,0), true.parameter = true,sampling = sam, subsampling = subsam) ## generate a path
+yuima<-simulate(yuima, xinit = c(0,0), true.parameter = true,sampling = sam) ## generate a path
plot(yuima)
-start<-list(theta0 = runif(1,0.5,4), theta1 = runif(1,1,4), theta2 = runif(1,1,5)) ## set initial values
-qmleLevy(yuima,start=start,lower=lower,upper=upper,joint = FALSE,third = TRUE)
-
+start<-list(theta0 = runif(1,0.5,4), theta1 = runif(1,1,4),
+theta2 = runif(1,1,5)) ## set initial values
+qmleLevy(yuima,start=start,lower=lower,upper=upper,joint = FALSE,third=TRUE)
}
\keyword{ ~kwd1 }% use one of RShowDoc("KEYWORDS")
More information about the Yuima-commits
mailing list