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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Dec 20 20:24:38 CET 2020


Author: lorenzo
Date: 2020-12-20 20:24:37 +0100 (Sun, 20 Dec 2020)
New Revision: 738

Modified:
   pkg/yuima/R/AuxMethodforPPR.R
   pkg/yuima/R/simulateForPpr.R
   pkg/yuima/man/IC.Rd
   pkg/yuima/man/LogSPX.Rd
   pkg/yuima/man/MWK151.Rd
   pkg/yuima/man/qmle.Rd
   pkg/yuima/man/rng.Rd
Log:
Fixed Bugs

Modified: pkg/yuima/R/AuxMethodforPPR.R
===================================================================
--- pkg/yuima/R/AuxMethodforPPR.R	2020-12-20 17:30:43 UTC (rev 737)
+++ pkg/yuima/R/AuxMethodforPPR.R	2020-12-20 19:24:37 UTC (rev 738)
@@ -616,17 +616,29 @@
         start=param[myMod at parameter@all],upper=upper[myMod at parameter@all],
         lower=lower[myMod at parameter@all])
     }else{
-      IntensityData <- Intensity.PPR(final_res at model,
-                                     param=coef(final_res))
-      mylambda <- IntensityData at original.data
-      OrigData <- yuimaPPR at data@original.data
-      NewData0 <- cbind(OrigData,mylambda)
-      colnames(NewData0) <- yuimaPPR at model@state.variable
-      NewData<-setData(zoo(NewData0,
-                           order.by = index(IntensityData at zoo.data[[1]])))
       
-      lengthVar <- length(yuimaPPR at model@state.variable)
+      
+      if(all(yuimaPPR at PPR@additional.info %in% yuimaPPR at model@state.variable)){
+        OrigData <- yuimaPPR at data@original.data
+        IntensityData <- Intensity.PPR(final_res at model,
+                                       param=coef(final_res))
+        mylambda <- IntensityData at original.data
+        
+        NewData0 <- cbind(OrigData,mylambda)
+        colnames(NewData0) <- yuimaPPR at model@state.variable
+        NewData<-setData(zoo(NewData0,
+                             order.by = index(IntensityData at zoo.data[[1]])))
+      }else{
+        NewData <- yuimaPPR at data
+      }
+      
       lengthOrigVar <- length(yuimaPPR at model@solve.variable)
+      if(length(yuimaPPR at model@state.variable)>lengthOrigVar){
+        lengthVar <- length(yuimaPPR at model@state.variable)
+      }else{
+        lengthVar<-lengthOrigVar
+      }
+      
       DummyDrift <- as.character(rep(0,lengthVar))
       DummyDrift[1:lengthOrigVar] <- as.character(yuimaPPR at model@drift) 
       
@@ -640,8 +652,10 @@
                           ncol = length(dummydiff0)/lengthOrigVar)
       
       if(length(yuimaPPR at model@jump.variable)!=0){
-        dummydiff <- rbind(dummydiff,matrix("0",
+        if(lengthVar-lengthOrigVar>0){
+          dummydiff <- rbind(dummydiff,matrix("0",
                                             nrow = lengthVar-lengthOrigVar,dim(dummydiff)[2]))
+          }
       }
       
       dummyJump0 <- NULL
@@ -664,7 +678,7 @@
                         jump.coeff = dummyJump1, jump.variable = yuimaPPR at model@jump.variable,
                         measure = list(df=yuimaPPR at model@measure$df),
                         measure.type = meas.type,
-                        solve.variable = yuimaPPR at model@state.variable,
+                        solve.variable = yuimaPPR at model@solve.variable,
                         state.variable = yuimaPPR at model@state.variable)
       myYuima <- setYuima(data = NewData, model = myMod)
       resCov <- qmleLevy(yuima = myYuima,

Modified: pkg/yuima/R/simulateForPpr.R
===================================================================
--- pkg/yuima/R/simulateForPpr.R	2020-12-20 17:30:43 UTC (rev 737)
+++ pkg/yuima/R/simulateForPpr.R	2020-12-20 19:24:37 UTC (rev 738)
@@ -1286,7 +1286,7 @@
           dimCov <- length(object at PPR@covariates)
           
           if (dimCov>0){
-            for(j in c(1:dimCov)){
+            for(jj in c(1:dimCov)){
               # my.covdata <- simMod at data@original.data[1:i,object at PPR@covariates[j]]
               # names(my.covdata) <-simMod at sampling@grid[[1]][1:i]
               # 
@@ -1294,8 +1294,8 @@
               #        my.covdata,
               #        envir = my.env)
               
-              assign(object at PPR@covariates[j],
-                     as.numeric(simMod at data@original.data[1:inter_i[j],object at PPR@covariates[j]]),
+              assign(object at PPR@covariates[jj],
+                     as.numeric(simMod at data@original.data[1:inter_i[j],object at PPR@covariates[jj]]),
                      envir = my.env)
             }
           }  

Modified: pkg/yuima/man/IC.Rd
===================================================================
--- pkg/yuima/man/IC.Rd	2020-12-20 17:30:43 UTC (rev 737)
+++ pkg/yuima/man/IC.Rd	2020-12-20 19:24:37 UTC (rev 738)
@@ -1,230 +1,230 @@
-\name{IC}
-\alias{IC}
-
-\title{
-Information criteria for the stochastic differential equation
-}
-
-\description{
-Information criteria BIC, Quasi-BIC (QBIC) and CIC for the stochastic differential equation.
-}
-
-\usage{
-IC(drif = NULL, diff = NULL, data = NULL, Terminal = 1, 
-   add.settings = list(), start, lower, upper, ergodic = TRUE,
-   stepwise = FALSE, weight = FALSE, rcpp = FALSE, ...)
-}
-
-\arguments{
-  \item{drif}{
-  a character vector that each element presents the candidate drift coefficient.
-  }
-  \item{diff}{
-  a character vector that each element presents the candidate diffusion coefficient.
-  }
-  \item{data}{
-  the data to be used.
-  }
-  \item{Terminal}{
-  terminal time of the grid.
-  }
-  \item{add.settings}{
-  details of model settings(see \code{\link{setModel}}).
-  }
-  \item{start}{
-  a named list of the initial values of the parameters for optimization.
-  }
-  \item{lower}{
-  a named list for specifying lower bounds of the parameters.
-  }
-  \item{upper}{
-  a named list for specifying upper bounds of the parameters.
-  }
-  \item{ergodic}{
-  whether the candidate models are ergodic SDEs or not(default \code{ergodic=TRUE}).
-  }
-  \item{stepwise}{
-  specifies joint procedure or stepwise procedure(default \code{stepwise=FALSE}).
-  }
-  \item{weight}{
-  calculate model weight? (default \code{weight=FALSE})
-  }
-  \item{rcpp}{
-  use C++ code? (default \code{rcpp=FALSE})
-  }
-  \item{\dots}{
-  
-  }
-}
-
-\details{
-Calculate the information criteria BIC, QBIC, and CIC for stochastic processes.
-The calculation and model selection are performed by joint procedure or stepwise procedure.
-}
-
-\value{
-  \item{BIC}{
-  values of BIC for all candidates.
-  }
-  \item{QBIC}{
-  values of QBIC for all candidates.
-  }
-  \item{CIC}{
-  values of CIC for all candidates.
-  }
-  \item{model}{
-  information of all candidate models.
-  }
-  \item{par}{
-  quasi-maximum likelihood estimator for each candidate.
-  }
-  \item{weight}{
-  model weights for all candidates.
-  }
-  \item{selected}{
-  selected model number and selected drift and diffusion coefficients
-  }
-
-}
-
-\references{
-
-## AIC, BIC
-
-Akaike, H. (1973). Information theory and an extension of the maximum likelihood principle. In Second International Symposium on Information Theory (Tsahkadsor, 1971), 267-281. \href{http://link.springer.com/chapter/10.1007/978-1-4612-1694-0_15}{http://link.springer.com/chapter/10.1007/978-1-4612-1694-0_15}
-
-Schwarz, G. (1978). Estimating the dimension of a model. The Annals of Statistics, 6(2), 461-464. \href{http://projecteuclid.org/euclid.aos/1176344136}{http://projecteuclid.org/euclid.aos/1176344136}
-
-## BIC, Quasi-BIC
-
-Eguchi, S. and Masuda, H. (2018). Schwarz type model comparison for LAQ models. Bernoulli, 24(3), 2278-2327. \href{https://projecteuclid.org/euclid.bj/1517540475}{https://projecteuclid.org/euclid.bj/1517540475}.
-
-## CIC
-
-Uchida, M. (2010). Contrast-based information criterion for ergodic diffusion processes from discrete observations. Annals of the Institute of Statistical Mathematics, 62(1), 161-187. \href{http://link.springer.com/article/10.1007/s10463-009-0245-1}{http://link.springer.com/article/10.1007/s10463-009-0245-1}
-
-## Model weight
-
-Burnham, K. P. and Anderson, D. R. (2002). Model Selection and Multimodel Inference. Springer-Verlag, New York.
-}
-
-\author{
-The YUIMA Project Team
-
-Contacts: Shoichi Eguchi \email{eguchi at sigmath.es.osaka-u.ac.jp}
-}
-
-\note{
-The function \code{IC} uses the function \code{\link{qmle}} with \code{method="L-BFGS-B"} internally.
-}
-
-%% ~Make other sections like Warning with \section{Warning }{....} ~
-
-%\seealso{
-%}
-\examples{
-
-### Ex.1 
-set.seed(123)
-
-N <- 1000   # number of data
-h <- N^(-2/3)  # sampling stepsize
-Ter <- N*h  # terminal sampling time
-
-## Data generate (dXt = -Xt*dt + exp((-2*cos(Xt) + 1)/2)*dWt)
-mod <- setModel(drift="theta21*x", diffusion="exp((theta11*cos(x)+theta12)/2)")
-samp <- setSampling(Terminal=Ter, n = N)
-yuima <- setYuima(model=mod, sampling=setSampling(Terminal=Ter, n=50*N))
-simu.yuima <- simulate(yuima, xinit=1, true.parameter=list(theta11=-2, theta12=1, 
-                       theta21=-1), subsampling=samp)
-Xt <- NULL
-for(i in 1:(N+1)){
-  Xt <- c(Xt, simu.yuima at data@original.data[50*(i-1)+1])
-}
-
-## Candidate coefficients
-diffusion <- c("exp((theta11*cos(x)+theta12*sin(x)+theta13)/2)", 
-               "exp((theta11*cos(x)+theta12*sin(x))/2)", 
-               "exp((theta11*cos(x)+theta13)/2)", "exp((theta12*sin(x)+theta13)/2)")
-drift <- c("theta21*x + theta22", "theta21*x")
-
-## Parameter settings
-para.init <- list(theta11=runif(1,max=5,min=-5), theta12=runif(1,max=5,min=-5), 
-                  theta13=runif(1,max=5,min=-5), theta21=runif(1,max=-0.5,min=-1.5),
-                  theta22=runif(1,max=-0.5,min=-1.5))
-para.low <- list(theta11=-10, theta12=-10, theta13=-10, theta21=-5, theta22=-5)
-para.upp <- list(theta11=10, theta12=10, theta13=10, theta21=-0.001, theta22=-0.001)
-
-## Ex.1.1 Joint
-ic1 <- IC(drif=drift, diff=diffusion, data=Xt, Terminal=Ter, start=para.init, lower=para.low, 
-          upper=para.upp, stepwise = FALSE, weight = FALSE, rcpp = TRUE)
-ic1
-
-## Ex.1.2 Stepwise
-ic2 <- IC(drif=drift, diff=diffusion, data=Xt, Terminal=Ter, 
-          start=para.init, lower=para.low, upper=para.upp,
-          stepwise = TRUE, weight = FALSE, rcpp = TRUE)
-ic2
-
-\dontrun{
-### Ex.2 (multidimansion case) 
-set.seed(123)
-
-N <- 3000   # number of data
-h <- N^(-2/3)  # sampling stepsize
-Ter <- N*h  # terminal sampling time
-
-## Data generate
-diff.coef.matrix <- matrix(c("beta1*x1+beta3", "1", "-1", "beta1*x1+beta3"), 2, 2)
-drif.coef.vec <- c("alpha1*x1", "alpha2*x2")
-mod <- setModel(drift = drif.coef.vec, diffusion = diff.coef.matrix, 
-                state.variable = c("x1", "x2"), solve.variable = c("x1", "x2"))
-samp <- setSampling(Terminal = Ter, n = N)
-yuima <- setYuima(model = mod, sampling = setSampling(Terminal = N^(1/3), n = 50*N))
-simu.yuima <- simulate(yuima, xinit = c(1,1), true.parameter = list(alpha1=-2, alpha2=-1, 
-                       beta1=-1, beta3=2), subsampling = samp)
-Xt <- matrix(0,(N+1),2)
-for(i in 1:(N+1)){
-  Xt[i,] <- simu.yuima at data@original.data[50*(i-1)+1,]
-}
-
-## Candidate coefficients
-diffusion <- list(matrix(c("beta1*x1+beta2*x2+beta3", "1", "-1", "beta1*x1+beta2*x2+beta3"), 2, 2),
-                  matrix(c("beta1*x1+beta2*x2", "1", "-1", "beta1*x1+beta2*x2"), 2, 2),
-                  matrix(c("beta1*x1+beta3", "1", "-1", "beta1*x1+beta3"), 2, 2),
-                  matrix(c("beta2*x2+beta3", "1", "-1", "beta2*x2+beta3"), 2, 2),
-                  matrix(c("beta1*x1", "1", "-1", "beta1*x1"), 2, 2),
-                  matrix(c("beta2*x2", "1", "-1", "beta2*x2"), 2, 2),
-                  matrix(c("beta3", "1", "-1", "beta3"), 2, 2))
-drift <- list(c("alpha1*x1", "alpha2*x2"), c("alpha1*x2", "alpha2*x1"))
-modsettings <- list(state.variable = c("x1", "x2"), solve.variable = c("x1", "x2"))
-
-## Parameter settings
-para.init <- list(alpha1 = runif(1,min=-3,max=-1), alpha2 = runif(1,min=-2,max=0),
-                  beta1 = runif(1,min=-2,max=0), beta2 = runif(1,min=0,max=2), 
-                  beta3 = runif(1,min=1,max=3))
-para.low <- list(alpha1 = -5, alpha2 = -5, beta1 = -5, beta2 = -5, beta3 = 1)
-para.upp <- list(alpha1 = 0.01, alpha2 = -0.01, beta1 = 5, beta2 = 5, beta3 = 10)
-
-## Ex.2.1 Joint
-ic3 <- IC(drif=drift, diff=diffusion, data=Xt, Terminal=Ter, add.settings=modsettings, 
-          start=para.init, lower=para.low, upper=para.upp, 
-          weight=FALSE, rcpp=FALSE)
-ic3
-
-## Ex.2.2 Stepwise
-ic4 <- IC(drif=drift, diff=diffusion, data=Xt, Terminal=Ter, add.settings=modsettings, 
-             start=para.init, lower=para.low, upper=para.upp,
-             stepwise = TRUE, weight=FALSE, rcpp=FALSE)
-ic4
-
-}
-}
-
-\keyword{Information criteria}
-
-
-
-
-
-
+\name{IC}
+\alias{IC}
+
+\title{
+Information criteria for the stochastic differential equation
+}
+
+\description{
+Information criteria BIC, Quasi-BIC (QBIC) and CIC for the stochastic differential equation.
+}
+
+\usage{
+IC(drif = NULL, diff = NULL, data = NULL, Terminal = 1, 
+   add.settings = list(), start, lower, upper, ergodic = TRUE,
+   stepwise = FALSE, weight = FALSE, rcpp = FALSE, ...)
+}
+
+\arguments{
+  \item{drif}{
+  a character vector that each element presents the candidate drift coefficient.
+  }
+  \item{diff}{
+  a character vector that each element presents the candidate diffusion coefficient.
+  }
+  \item{data}{
+  the data to be used.
+  }
+  \item{Terminal}{
+  terminal time of the grid.
+  }
+  \item{add.settings}{
+  details of model settings(see \code{\link{setModel}}).
+  }
+  \item{start}{
+  a named list of the initial values of the parameters for optimization.
+  }
+  \item{lower}{
+  a named list for specifying lower bounds of the parameters.
+  }
+  \item{upper}{
+  a named list for specifying upper bounds of the parameters.
+  }
+  \item{ergodic}{
+  whether the candidate models are ergodic SDEs or not(default \code{ergodic=TRUE}).
+  }
+  \item{stepwise}{
+  specifies joint procedure or stepwise procedure(default \code{stepwise=FALSE}).
+  }
+  \item{weight}{
+  calculate model weight? (default \code{weight=FALSE})
+  }
+  \item{rcpp}{
+  use C++ code? (default \code{rcpp=FALSE})
+  }
+  \item{\dots}{
+  
+  }
+}
+
+\details{
+Calculate the information criteria BIC, QBIC, and CIC for stochastic processes.
+The calculation and model selection are performed by joint procedure or stepwise procedure.
+}
+
+\value{
+  \item{BIC}{
+  values of BIC for all candidates.
+  }
+  \item{QBIC}{
+  values of QBIC for all candidates.
+  }
+  \item{CIC}{
+  values of CIC for all candidates.
+  }
+  \item{model}{
+  information of all candidate models.
+  }
+  \item{par}{
+  quasi-maximum likelihood estimator for each candidate.
+  }
+  \item{weight}{
+  model weights for all candidates.
+  }
+  \item{selected}{
+  selected model number and selected drift and diffusion coefficients
+  }
+
+}
+
+\references{
+
+## AIC, BIC
+
+Akaike, H. (1973). Information theory and an extension of the maximum likelihood principle. In Second International Symposium on Information Theory (Tsahkadsor, 1971), 267-281. \href{https://link.springer.com/chapter/10.1007/978-1-4612-1694-0_15}{https://link.springer.com/chapter/10.1007/978-1-4612-1694-0_15}
+
+Schwarz, G. (1978). Estimating the dimension of a model. The Annals of Statistics, 6(2), 461-464. \href{http://projecteuclid.org/euclid.aos/1176344136}{http://projecteuclid.org/euclid.aos/1176344136}
+
+## BIC, Quasi-BIC
+
+Eguchi, S. and Masuda, H. (2018). Schwarz type model comparison for LAQ models. Bernoulli, 24(3), 2278-2327. \href{https://projecteuclid.org/euclid.bj/1517540475}{https://projecteuclid.org/euclid.bj/1517540475}.
+
+## CIC
+
+Uchida, M. (2010). Contrast-based information criterion for ergodic diffusion processes from discrete observations. Annals of the Institute of Statistical Mathematics, 62(1), 161-187. \href{https://link.springer.com/article/10.1007/s10463-009-0245-1}{https://link.springer.com/article/10.1007/s10463-009-0245-1}
+
+## Model weight
+
+Burnham, K. P. and Anderson, D. R. (2002). Model Selection and Multimodel Inference. Springer-Verlag, New York.
+}
+
+\author{
+The YUIMA Project Team
+
+Contacts: Shoichi Eguchi \email{eguchi at sigmath.es.osaka-u.ac.jp}
+}
+
+\note{
+The function \code{IC} uses the function \code{\link{qmle}} with \code{method="L-BFGS-B"} internally.
+}
+
+%% ~Make other sections like Warning with \section{Warning }{....} ~
+
+%\seealso{
+%}
+\examples{
+
+### Ex.1 
+set.seed(123)
+
+N <- 1000   # number of data
+h <- N^(-2/3)  # sampling stepsize
+Ter <- N*h  # terminal sampling time
+
+## Data generate (dXt = -Xt*dt + exp((-2*cos(Xt) + 1)/2)*dWt)
+mod <- setModel(drift="theta21*x", diffusion="exp((theta11*cos(x)+theta12)/2)")
+samp <- setSampling(Terminal=Ter, n = N)
+yuima <- setYuima(model=mod, sampling=setSampling(Terminal=Ter, n=50*N))
+simu.yuima <- simulate(yuima, xinit=1, true.parameter=list(theta11=-2, theta12=1, 
+                       theta21=-1), subsampling=samp)
+Xt <- NULL
+for(i in 1:(N+1)){
+  Xt <- c(Xt, simu.yuima at data@original.data[50*(i-1)+1])
+}
+
+## Candidate coefficients
+diffusion <- c("exp((theta11*cos(x)+theta12*sin(x)+theta13)/2)", 
+               "exp((theta11*cos(x)+theta12*sin(x))/2)", 
+               "exp((theta11*cos(x)+theta13)/2)", "exp((theta12*sin(x)+theta13)/2)")
+drift <- c("theta21*x + theta22", "theta21*x")
+
+## Parameter settings
+para.init <- list(theta11=runif(1,max=5,min=-5), theta12=runif(1,max=5,min=-5), 
+                  theta13=runif(1,max=5,min=-5), theta21=runif(1,max=-0.5,min=-1.5),
+                  theta22=runif(1,max=-0.5,min=-1.5))
+para.low <- list(theta11=-10, theta12=-10, theta13=-10, theta21=-5, theta22=-5)
+para.upp <- list(theta11=10, theta12=10, theta13=10, theta21=-0.001, theta22=-0.001)
+
+## Ex.1.1 Joint
+ic1 <- IC(drif=drift, diff=diffusion, data=Xt, Terminal=Ter, start=para.init, lower=para.low, 
+          upper=para.upp, stepwise = FALSE, weight = FALSE, rcpp = TRUE)
+ic1
+
+## Ex.1.2 Stepwise
+ic2 <- IC(drif=drift, diff=diffusion, data=Xt, Terminal=Ter, 
+          start=para.init, lower=para.low, upper=para.upp,
+          stepwise = TRUE, weight = FALSE, rcpp = TRUE)
+ic2
+
+\dontrun{
+### Ex.2 (multidimansion case) 
+set.seed(123)
+
+N <- 3000   # number of data
+h <- N^(-2/3)  # sampling stepsize
+Ter <- N*h  # terminal sampling time
+
+## Data generate
+diff.coef.matrix <- matrix(c("beta1*x1+beta3", "1", "-1", "beta1*x1+beta3"), 2, 2)
+drif.coef.vec <- c("alpha1*x1", "alpha2*x2")
+mod <- setModel(drift = drif.coef.vec, diffusion = diff.coef.matrix, 
+                state.variable = c("x1", "x2"), solve.variable = c("x1", "x2"))
+samp <- setSampling(Terminal = Ter, n = N)
+yuima <- setYuima(model = mod, sampling = setSampling(Terminal = N^(1/3), n = 50*N))
+simu.yuima <- simulate(yuima, xinit = c(1,1), true.parameter = list(alpha1=-2, alpha2=-1, 
+                       beta1=-1, beta3=2), subsampling = samp)
+Xt <- matrix(0,(N+1),2)
+for(i in 1:(N+1)){
+  Xt[i,] <- simu.yuima at data@original.data[50*(i-1)+1,]
+}
+
+## Candidate coefficients
+diffusion <- list(matrix(c("beta1*x1+beta2*x2+beta3", "1", "-1", "beta1*x1+beta2*x2+beta3"), 2, 2),
+                  matrix(c("beta1*x1+beta2*x2", "1", "-1", "beta1*x1+beta2*x2"), 2, 2),
+                  matrix(c("beta1*x1+beta3", "1", "-1", "beta1*x1+beta3"), 2, 2),
+                  matrix(c("beta2*x2+beta3", "1", "-1", "beta2*x2+beta3"), 2, 2),
+                  matrix(c("beta1*x1", "1", "-1", "beta1*x1"), 2, 2),
+                  matrix(c("beta2*x2", "1", "-1", "beta2*x2"), 2, 2),
+                  matrix(c("beta3", "1", "-1", "beta3"), 2, 2))
+drift <- list(c("alpha1*x1", "alpha2*x2"), c("alpha1*x2", "alpha2*x1"))
+modsettings <- list(state.variable = c("x1", "x2"), solve.variable = c("x1", "x2"))
+
+## Parameter settings
+para.init <- list(alpha1 = runif(1,min=-3,max=-1), alpha2 = runif(1,min=-2,max=0),
+                  beta1 = runif(1,min=-2,max=0), beta2 = runif(1,min=0,max=2), 
+                  beta3 = runif(1,min=1,max=3))
+para.low <- list(alpha1 = -5, alpha2 = -5, beta1 = -5, beta2 = -5, beta3 = 1)
+para.upp <- list(alpha1 = 0.01, alpha2 = -0.01, beta1 = 5, beta2 = 5, beta3 = 10)
+
+## Ex.2.1 Joint
+ic3 <- IC(drif=drift, diff=diffusion, data=Xt, Terminal=Ter, add.settings=modsettings, 
+          start=para.init, lower=para.low, upper=para.upp, 
+          weight=FALSE, rcpp=FALSE)
+ic3
+
+## Ex.2.2 Stepwise
+ic4 <- IC(drif=drift, diff=diffusion, data=Xt, Terminal=Ter, add.settings=modsettings, 
+             start=para.init, lower=para.low, upper=para.upp,
+             stepwise = TRUE, weight=FALSE, rcpp=FALSE)
+ic4
+
+}
+}
+
+\keyword{Information criteria}
+
+
+
+
+
+

Modified: pkg/yuima/man/LogSPX.Rd
===================================================================
--- pkg/yuima/man/LogSPX.Rd	2020-12-20 17:30:43 UTC (rev 737)
+++ pkg/yuima/man/LogSPX.Rd	2020-12-20 19:24:37 UTC (rev 738)
@@ -10,8 +10,6 @@
 }
 \usage{data(LogSPX)}
 \details{The dataset is composed by a list where the element \code{Data$allObs} contains the intraday five minutes Standard and Poor cumulative Log-return data computed as \code{Log(P_t)-Log(P_0)} and \code{P_0} is the open SPX price at 09 july 2012. \code{Data$logdayprice} contains daily SPX log prices and. Each day we have the same number of observation and the value is reported in \code{Data$obsinday}. 
-The original data are freely available from the
-\url{http://thebonnotgang.com/}
 }
 
 \examples{

Modified: pkg/yuima/man/MWK151.Rd
===================================================================
--- pkg/yuima/man/MWK151.Rd	2020-12-20 17:30:43 UTC (rev 737)
+++ pkg/yuima/man/MWK151.Rd	2020-12-20 19:24:37 UTC (rev 738)
@@ -1,25 +1,25 @@
-\name{MWK151}
-\alias{MWK151}
-\docType{data}
-\title{
-Graybill - Methuselah Walk - PILO - ITRDB CA535
-}
-\description{
-Graybill - Methuselah Walk - PILO - ITRDB CA535, pine tree width in mm from -608 to 1957.
-}
-\usage{data(MWK151)}
-\details{
-The full data records of past temperature, precipitation, and climate and environmental change derived from tree ring measurements. Parameter keywords describe what was measured in this data set. Additional summary information can be found in the abstracts of papers listed in the data set citations, however many of the data sets arise from unpublished research contributed to the International Tree Ring Data Bank. Additional information on data processing and analysis for International Tree Ring Data Bank (ITRDB) data sets can be found on the Tree Ring Page \url{http://www.ncdc.noaa.gov/paleo/treering.html}.
-
-The MWK151 is only a small part of the data relative to one tree and contains measurement of a tree's ring width in mm, from -608 to 1957.
-}
-\source{
-\url{ftp://ftp.ncdc.noaa.gov/pub/data/paleo/treering/measurements/northamerica/usa/ca535.rwl}
-}
-\references{
-Graybill, D.A., and Shiyatov, S.G., Dendroclimatic evidence from the northern Soviet Union, in Climate since A.D. 1500, edited by R.S. Bradley and P.D. Jones, Routledge, London, 393-414, 1992.
-}
-\examples{
-data(MWK151)
-}
-\keyword{datasets}
+\name{MWK151}
+\alias{MWK151}
+\docType{data}
+\title{
+Graybill - Methuselah Walk - PILO - ITRDB CA535
+}
+\description{
+Graybill - Methuselah Walk - PILO - ITRDB CA535, pine tree width in mm from -608 to 1957.
+}
+\usage{data(MWK151)}
+\details{
+The full data records of past temperature, precipitation, and climate and environmental change derived from tree ring measurements. Parameter keywords describe what was measured in this data set. Additional summary information can be found in the abstracts of papers listed in the data set citations, however many of the data sets arise from unpublished research contributed to the International Tree Ring Data Bank. Additional information on data processing and analysis for International Tree Ring Data Bank (ITRDB) data sets can be found on the Tree Ring Page \url{https://www.ncdc.noaa.gov/data-access/paleoclimatology-data}.
+
+The MWK151 is only a small part of the data relative to one tree and contains measurement of a tree's ring width in mm, from -608 to 1957.
+}
+\source{
+\url{ftp://ftp.ncdc.noaa.gov/pub/data/paleo/treering/measurements/northamerica/usa/ca535.rwl}
+}
+\references{
+Graybill, D.A., and Shiyatov, S.G., Dendroclimatic evidence from the northern Soviet Union, in Climate since A.D. 1500, edited by R.S. Bradley and P.D. Jones, Routledge, London, 393-414, 1992.
+}
+\examples{
+data(MWK151)
+}
+\keyword{datasets}

Modified: pkg/yuima/man/qmle.Rd
===================================================================
--- pkg/yuima/man/qmle.Rd	2020-12-20 17:30:43 UTC (rev 737)
+++ pkg/yuima/man/qmle.Rd	2020-12-20 19:24:37 UTC (rev 738)
@@ -91,11 +91,11 @@
 
 ## COGARCH
 
-Iacus S. M., Mercuri L. and Rroji E.(2015) Discrete time approximation of a COGARCH (p, q) model and its estimation. \href{http://arxiv.org/abs/1511.00253}{http://arxiv.org/abs/1511.00253}
+Iacus S. M., Mercuri L. and Rroji E.(2015) Discrete time approximation of a COGARCH (p, q) model and its estimation. \href{https://arxiv.org/abs/1511.00253}{https://arxiv.org/abs/1511.00253}
 
 ## CARMA
 
-Iacus S. M., Mercuri L. (2015) Implementation of Levy CARMA model in Yuima package. Comp. Stat. (30) 1111-1141. \href{http://link.springer.com/article/10.1007/s00180-015-0569-7}{http://link.springer.com/article/10.1007/s00180-015-0569-7}
+Iacus S. M., Mercuri L. (2015) Implementation of Levy CARMA model in Yuima package. Comp. Stat. (30) 1111-1141. \href{https://link.springer.com/article/10.1007/s00180-015-0569-7}{https://link.springer.com/article/10.1007/s00180-015-0569-7}
 }
 
 \author{The YUIMA Project Team}

Modified: pkg/yuima/man/rng.Rd
===================================================================
--- pkg/yuima/man/rng.Rd	2020-12-20 17:30:43 UTC (rev 737)
+++ pkg/yuima/man/rng.Rd	2020-12-20 19:24:37 UTC (rev 738)
@@ -1,265 +1,265 @@
-\encoding{UTF-8}
-\name{rng}
-\alias{rng}
-\alias{rIG}
-\alias{dIG}
-\alias{rNIG}
-\alias{dNIG}
-\alias{rbgamma}
-\alias{dbgamma}
-\alias{rvgamma}
-\alias{dvgamma}
-\alias{rGIG}
-\alias{dGIG}
-\alias{rGH}
-\alias{dGH}
-\alias{rstable}
-\alias{rpts}
-\alias{rnts}
-
-\title{Random numbers and densities}
-\description{\code{simulate} function can use the specific random number generators to generate Levy paths.}
-\usage{
-rGIG(x,lambda,delta,gamma)
-dGIG(x,lambda,delta,gamma)
-rGH(x,lambda,alpha,beta,delta,mu,Lambda)
-dGH(x,lambda,alpha,beta,delta,mu,Lambda)
-rIG(x,delta,gamma)
-dIG(x,delta,gamma)
-rNIG(x,alpha,beta,delta,mu,Lambda)
-dNIG(x,alpha,beta,delta,mu,Lambda)
-rvgamma(x,lambda,alpha,beta,mu,Lambda)
-dvgamma(x,lambda,alpha,beta,mu,Lambda)
-rbgamma(x,delta.plus,gamma.plus,delta.minus,gamma.minus)
-dbgamma(x,delta.plus,gamma.plus,delta.minus,gamma.minus)
-rstable(x,alpha,beta,sigma,gamma)
-rpts(x,alpha,a,b)
-rnts(x,alpha,a,b,beta,mu,Lambda)
-}
-\arguments{
-  \item{x}{Number of R.Ns to be geneated.}
-  \item{a}{parameter}
-  \item{b}{parameter}
-  \item{delta}{parameter}
-  \item{gamma}{parameter}
-  \item{mu}{parameter}
-  \item{Lambda}{parameter}
-  \item{alpha}{parameter}
-  \item{lambda}{parameter}
-  \item{sigma}{parameter}
-  \item{beta}{parameter}
-  \item{delta.plus}{parameter}
-  \item{gamma.plus}{parameter}
-  \item{delta.minus}{parameter}
-  \item{gamma.minus}{parameter}
-
-  % \item{IG (inverse Gaussian)}{delta and gamma are positive valued parameter.}
-  % \item{NIG (normal inverse Gaussian)}{alpha and delta are nonnegative number, beta and mu are vector and Lambda is matrix.}
-  % \item{bgamma (bilateral gamma)}{All of parameters are positive number.}
-  % \item{vgamma (variance gamma)}{lamdba and alpha are positive number, beta and mu are vector and Lambda is matrix.}
-  % \item{stable}{Stable index 0<alpha<=2; Skewness -1<=beta<=1; Scale sigma>0; Location gamma being a real number.}
-}
-
-
-\details{
-
-\code{GIG} (generalized inverse Gaussian): 
-The density function of GIG distribution is expressed as:
-
-\eqn{f(x)= 1/2*(gamma/delta)^lambda*1/bK_lambda(gamma*delta)*x^(lambda-1)*exp(-1/2*(delta^2/x+gamma^2*x))}
-
-where \eqn{bK_lambda()} is the modified Bessel function of the third kind with order lambda.
-The parameters lambda, delta and gamma vary within the following regions:
-
-\eqn{delta>=0, gamma>0 if lambda>0},
-
-\eqn{delta>0, gamma>0 if lambda=0},
-
-\eqn{delta>0, gamma>=0 if lambda<0}.
-
-The corresponding Levy measure is given in Eberlein, E., & Hammerstein, E. A. V. (2004) (it contains IG).
-
-\code{GH} (generalized hyperbolic): Generalized hyperbolic distribution is defined by the normal mean-variance mixture of generalized inverse Gaussian distribution. The parameters alpha, beta, delta, mu express heaviness of tails, degree of asymmetry, scale and location, respectively. Here the parameter Lambda is supposed to be symmetric and positive definite with \eqn{det(Lambda)=1} and the parameters vary within the following region:
-
-\eqn{delta>=0, alpha>0, alpha^2>beta^T Lambda beta if lambda>0},
-
-\eqn{delta>0, alpha>0, alpha^2>beta^T Lambda beta if lambda=0},
-
-\eqn{delta>0, alpha>=0, alpha^2>=beta^T Lambda beta if lambda<0}.
-
-The corresponding Levy measure is given in Eberlein, E., & Hammerstein, E. A. V. (2004) (it contains NIG and vgamma).
-
-
-\code{IG} (inverse Gaussian (the element of GIG)): Delta and gamma are positive (the case of \eqn{gamma=0} corresponds to the positive half stable, provided by the "rstable").
-
-\code{NIG} (normal inverse Gaussian (the element of GH)): Normal inverse Gaussian distribution is defined by the normal mean-variance mixuture of inverse Gaussian distribution. The parameters alpha, beta, delta and mu express the heaviness of tails, degree of asymmetry, scale and location, respectively. They satisfy the following conditions:
-Lambda is symmetric and positive definite with \eqn{det(Lambda)=1; delta>0; alpha>0 with alpha^2-beta^T Lambda beta >0}.
-
-\code{vgamma} (variance gamma (the element of GH)): Variance gamma distribution is defined by the normal mean-variance mixture of gamma distribution. The parameters satisfy the following conditions:
-Lambda is symmetric and positive definite with \eqn{det(Lambda)=1; lambda>0; alpha>0 with alpha^2-beta^T Lambda beta >0}. Especially in the case of \eqn{beta=0} it is variance gamma distribution.
-
-\code{bgamma} (bilateral gamma): Bilateral gamma distribution is defined by the difference of independent gamma distributions Gamma(delta.plus,gamma.plus) and Gamma(delta.minus,gamma.minus). Its Levy density \eqn{f(z)} is given by: 
-\eqn{f(z)=delta.plus/z*exp(-gamma.plus*z)*ind(z>0)+delta.minus/|z|*exp(-gamma.minus*|z|)*ind(z<0)}, where the function \eqn{ind()} denotes an indicator function.
-
-\code{stable} (stable): Parameters alpha, beta, sigma and gamma express stability, degree of skewness, scale and location, respectively. They satisfy the following condition: \eqn{0<alpha<=2; -1<=beta<=1; scale>0; gamma is a real number}.
-
-\code{pts} (positive tempered stable): Positive tempered stable distribution is defined by the tilting of positive stable distribution. The parameters alpha, a and b express stability, scale and degree of tilting, respectively. They satisfy the following condition: \eqn{0<alpha<1; a>0; b>0}. Its Levy density \eqn{f(z)} is given by: \eqn{f(z)=az^(-1-alpha)exp(-bz)}.
-
-\code{nts} (normal tempered stable): Normal tempered stable distribution is defined by the normal mean-variance mixture of positive tempered stable distribution. The parameters alpha, a, b, beta, mu and Lambda express stability, scale, degree of tilting, degree of asymemtry, location and degree of mixture, respectively. They satisfy the following condition: Lambda is symmetric and positive definite with \eqn{det(Lambda)=1; 0<alpha<1; a>0; b>0}. 
-In one-dimensional case, its Levy density \eqn{f(z)} is given by: 
-\eqn{f(z)=2a/(2pi)^(1/2)*exp(beta*z)*(z^2/(2b+beta^2))^(-alpha/2-1/4)*bK_(alpha+1/2)(z^2(2b+beta^2)^(1/2))}.
-
-}
-
-\value{
-\item{rXXX}{Collection of of random numbers or vectors}
-\item{dXXX}{Density dunction}
-}
-
-\author{The YUIMA Project Team
-
-Contacts: Hiroki Masuda \email{hiroki at math.kyushu-u.ac.jp} and Yuma Uehara \email{y-uehara at ism.ac.jp}
-}
-\note{
-  Some density-plot functions are still missing: as for the non-Gaussian stable densities, one can use, e.g., stabledist package.
-  The rejection-acceptance method is used for generating pts and nts. It should be noted that its acceptance rate decreases at exponential order as a and b become larger: specifically, the rate is given by \eqn{exp( a*gamma(-alpha)*b^(alpha) )}
-}
-
-\references{
-
-## rGIG, dGIG, rIG, dIG
-
-Chhikara, R. (1988). The Inverse Gaussian Distribution: Theory: Methodology, and Applications (Vol. 95). CRC Press.
-
-H??rmann, W., & Leydold, J. (2014). Generating generalized inverse Gaussian random variates. Statistics and Computing, 24(4), 547-557.
-\href{http://onlinelibrary.wiley.com/doi/10.1111/1467-9469.00045/abstract}{http://onlinelibrary.wiley.com/doi/10.1111/1467-9469.00045/abstract}
-
-J??rgensen, B. (2012). Statistical properties of the generalized inverse Gaussian distribution (Vol. 9). Springer Science & Business Media.
-\href{http://www.springer.com/la/book/9780387906652}{http://www.springer.com/la/book/9780387906652}
-
-Michael, J. R., Schucany, W. R., & Haas, R. W. (1976). Generating random variates using transformations with multiple roots. The American Statistician, 30(2), 88-90.
-\href{https://www.jstor.org/stable/2683801}{https://www.jstor.org/stable/2683801}
-
-## rGH, dGH, rNIG, dNIG, rvgamma, dvgamma
-
-Barndorff-Nielsen, O. (1977). Exponentially decreasing distributions for the logarithm of particle size. In Proceedings of the Royal Society of London A: Mathematical, Physical and Engineering Sciences (Vol. 353, No. 1674, pp. 401-419). The Royal Society.
-\href{http://rspa.royalsocietypublishing.org/content/353/1674/401}{http://rspa.royalsocietypublishing.org/content/353/1674/401}
-
-Barndorff-Nielsen, O. E. (1997). Processes of normal inverse Gaussian type. Finance and stochastics, 2(1), 41-68.
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/yuima -r 738


More information about the Yuima-commits mailing list