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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Dec 19 06:25:36 CET 2009


Author: iacus
Date: 2009-12-19 06:25:34 +0100 (Sat, 19 Dec 2009)
New Revision: 46

Modified:
   pkg/yuima/DESCRIPTION
   pkg/yuima/man/cce.Rd
   pkg/yuima/man/model.parameter-class.Rd
   pkg/yuima/man/poisson.random.sampling.Rd
   pkg/yuima/man/setData.Rd
   pkg/yuima/man/setModel.Rd
   pkg/yuima/man/yuima.data-class.Rd
Log:
fixed few doc pages

Modified: pkg/yuima/DESCRIPTION
===================================================================
--- pkg/yuima/DESCRIPTION	2009-12-16 10:08:26 UTC (rev 45)
+++ pkg/yuima/DESCRIPTION	2009-12-19 05:25:34 UTC (rev 46)
@@ -1,8 +1,8 @@
 Package: yuima
 Type: Package
 Title: The YUIMA Project package
-Version: 0.0.77
-Date: 2009-12-16
+Version: 0.0.78
+Date: 2009-12-18
 Depends: methods, zoo
 Author: YUIMA Project Team.
 Maintainer: Stefano M. Iacus <stefano.iacus at R-project.org>

Modified: pkg/yuima/man/cce.Rd
===================================================================
--- pkg/yuima/man/cce.Rd	2009-12-16 10:08:26 UTC (rev 45)
+++ pkg/yuima/man/cce.Rd	2009-12-19 05:25:34 UTC (rev 46)
@@ -1,32 +1,40 @@
 \name{cce}
 \alias{cce}
 
-\title{Nonsyncronous Cumulative Covariance Estimator}
+\title{Nonsynchronous Cumulative Covariance Estimator}
 \description{
-\code{cce} is a function to estimate the covariance of some diffusion-type processes when they are observed only at discrete 
-times in a nonsynchronous manner.}
+This function estimates the covariance between two Ito processes when they are
+observed at discrete times possibly nonsynchronously. It can apply to 
+irregularly sampled one-dimensional data as a special case.
+}
 \usage{
 cce(x)
 }
 \arguments{
-  \item{x}{An object of class 'yuima' or 'yuima.data'}
+  \item{x}{an object of class 'yuima' or 'yuima.data'}
 }
 \details{
-  This function is a method of class \code{yuima.data} or \code{yuima}.
-  In the case of \code{yuima} object extracts the \code{data} object from
-  it.
+  This function is a method of class \code{\link{yuima.data-class}} and \code{\link{yuima-class}}.
+  It extracts the \code{data} slot when applied to a an object of
+  class \code{\link{yuima-class}}.
 }
 \value{
-  \item{value}{returns a matrix of estimated covariance}
+  \item{value}{estimate of the covariance matrix}
 }
+\note{The example shows the central limit theorem for the nonsynchronous 
+covariance estimator.  Estimation of the asymptotic variance with p-values and
+the second-order correction will be provided in a future version of the package. 
+}
 \references{
  Hayashi, T and Yoshida, N. (2005)
-\emph{On covariance estimation of non-synchronously observed diffusion processes.}
-\emph{Bernoulli} \bold{11}, no. 2, 359--379.
+  On covariance estimation of non-synchronously observed diffusion processes,
+  \emph{Bernoulli}, \bold{11}, no. 2, 359--379.
+
+ Hayashi, T and Yoshida, N. (2008) Asymptotic normality of a covariance 
+  estimator for  nonsynchronously observed diffusion processes, \emph{Annals 
+  of the Institute of Statistical Mathematics}, \bold{60}, no. 2, 367--406.
 }
 \author{The YUIMA Project Team}
-\note{The example shows CLT for the non synchronous covariance estimator
-}
 \examples{
 ## Set a model
 diff.coef.1 <- function(t, x1 = 0, x2 = 0) sqrt(1+t)

Modified: pkg/yuima/man/model.parameter-class.Rd
===================================================================
--- pkg/yuima/man/model.parameter-class.Rd	2009-12-16 10:08:26 UTC (rev 45)
+++ pkg/yuima/man/model.parameter-class.Rd	2009-12-19 05:25:34 UTC (rev 46)
@@ -28,7 +28,8 @@
 constructed via \code{\link{setModel}}.
 All the terms which are not in the list of \emph{solution, state, time, jump} variables
 are considered as parameters. These parameters are
-identified in the different components of the model (drift, diffusion jump part).
+identified in the different components of the model (drift, diffusion and
+jump part).
 This information is later used to draw inference jointly or separately for
 the different parameters depending on the model in hands. 
 }

Modified: pkg/yuima/man/poisson.random.sampling.Rd
===================================================================
--- pkg/yuima/man/poisson.random.sampling.Rd	2009-12-16 10:08:26 UTC (rev 45)
+++ pkg/yuima/man/poisson.random.sampling.Rd	2009-12-19 05:25:34 UTC (rev 46)
@@ -2,25 +2,46 @@
 \alias{poisson.random.sampling}
 \title{Poisson random sampling method} 
 \description{
-Poisson random sampling method. A method of class 'yuima.data' and 'yuima'.}
+Poisson random sampling method.}
 \usage{
 poisson.random.sampling(x, rate, n)
 }
 \arguments{
-  \item{x}{An object of class 'yuima.data', 'yuima'}
-  \item{rate}{poisson rate}
-  \item{n}{To specify intensity as n * rate}
+  \item{x}{an object of class \code{\link{yuima.data-class}} or \code{\link{yuima-class}}.}
+  \item{rate}{a Poisson intensity or a vector of Poisson intensities.}
+  \item{n}{a common multiplier to the Poisson intensities. The default value is 1.}
 }
 \details{
   It returns an object
-  of type \code{yuima.data} which is a copy of the original input \code{data}
-  (or its \code{zoo.data} field) where observations are sampled according to
-  the poisson process. The remaining observations are set to \code{NA}.
+  of type \code{\link{yuima.data-class}} which is a copy of the original input 
+  data where observations are sampled according to
+  the poisson process. The unsampled data are set to \code{NA}.
 }
 \value{
-  An object of class 'yuima.data'.
+  an object of class \code{\link{yuima.data-class}}.
 }
-\references{Yoshida, Hayashi, etc. ADD CORRECT REFERENCE}
 \author{The YUIMA Project Team}
 \seealso{\link{cce}}
+\examples{
+## Set a model
+diff.coef.1 <- function(t, x1=0, x2) x2*(1+t)
+diff.coef.2 <- function(t, x1, x2=0) x1*sqrt(1+t^2)
+cor.rho <- function(t, x1=0, x2=0) sqrt((1+cos(x1*x2))/2)
+diff.coef.matrix <- matrix(c("diff.coef.1(t,x1,x2)",
+"diff.coef.2(t,x1,x2)*cor.rho(t,x1,x2)", "",
+"diff.coef.2(t,x1,x2)*sqrt(1-cor.rho(t,x1,x2)^2)"),2,2)
+cor.mod <- setModel(drift=c("",""), diffusion=diff.coef.matrix, 
+solve.variable=c("x1", "x2"), xinit=c(3,2))
+set.seed(111)
+
+## We first simulate the two dimensional diffusion model
+yuima.samp <- setSampling(Terminal=1, division=1200)
+yuima <- setYuima(model=cor.mod, sampling=yuima.samp)
+yuima.sim <- simulate(yuima)
+
+## Then we use function poisson.random.sampling to get observations
+## by Poisson sampling.
+psample <- poisson.random.sampling(yuima.sim,  rate = c(0.2, 0.3), n=1000)
+str(psample)
+}
 \keyword{ts}

Modified: pkg/yuima/man/setData.Rd
===================================================================
--- pkg/yuima/man/setData.Rd	2009-12-16 10:08:26 UTC (rev 45)
+++ pkg/yuima/man/setData.Rd	2009-12-19 05:25:34 UTC (rev 46)
@@ -5,50 +5,61 @@
 \alias{length}
 
 \title{
-Set and access data of an 'yuima-class' or 
-'yuima.data-class' object.
+Set and access data of an object of type "yuima.data" or "yuima".
 }
 \description{
-\code{setData} is a constructor for \code{\link{yuima.data-class}}.
+\code{setData} constructs an object of class \code{\link{yuima.data-class}}.
 
-\code{get.zoo.data} returns the \code{zoo.data} slot of a
+\code{get.zoo.data} returns the content of the \code{zoo.data} slot of a
 \code{\link{yuima.data-class}} object. (Note: value is a \code{list} of 
 \code{\link{zoo}} objects).
 
-\code{plot} plots the \code{\link{yuima.data-class}} or 
-\code{\link{yuima-class}} objects.
+\code{plot} plot method for object of class \code{\link{yuima.data-class}} or 
+\code{\link{yuima-class}}.
 
-\code{dim} returns the \code{\link{dim}} of the \code{zoo.data} field.
+\code{dim} returns the \code{\link{dim}} of the \code{zoo.data} slot of a
+\code{\link{yuima.data-class}} object.
 
 \code{length} returns the \code{\link{length}} of the time series in 
-\code{zoo.data} field.
+\code{zoo.data} slot of a \code{\link{yuima.data-class}} object.
 }
 \usage{
   setData(original.data)
   get.zoo.data(x)
 }
 \arguments{  
-  \item{original.data}{Some type of data, usually some sort of time series. 
+  \item{original.data}{some type of data, usually some sort of time series. 
   The function always tries to convert to the input data into an object of
-   \code{\link{zoo}}-type.}
-  \item{x}{An object of type \code{\link{yuima.data-class}} or 
+   \code{\link{zoo}}-type. See Details.}
+  \item{x}{an object of type \code{\link{yuima.data-class}} or 
   \code{\link{yuima-class}}.}
 }
 \details{
-The \code{\link{yuima.data-class}} contains two slots. 
+Objects in the  \code{\link{yuima.data-class}} class contain two slots:
+\describe{
+  \item{\code{original.data}:}{The slot \code{original.data} contains, as the 
+   name suggests, a copy of the original data passed by the user in the
+   argument \code{original.data} of the function \code{setData}. 
+   It is intended for backup purposes.}
+  \item{\code{zoo.data}:}{the function \code{setData} tries to convert 
+   \code{original.data} into an object of class \code{\link{zoo}}. The 
+   \code{\link{zoo}}-fied data are stored in the slot \code{zoo.data}.
 
-The slot \code{original.data} contains, as the name suggests,
-a copy of the original data passed by the user and it is intended for backup 
-purposes.
+   If the conversion fails the function exits with an error.
 
-Internally, the \pkg{yuima} package stores and operates on  
-\code{\link{zoo}}-type objects.
-The \code{\link{zoo}}-fied data are contained in the slot \code{zoo.data}.
+   Internally, the \pkg{yuima} package stores and operates on  
+   \code{\link{zoo}}-type objects.}
 }
+
+The function \code{get.zoo.data}
+returns the content of the slot \code{zoo.data} of \code{x} if \code{x}
+is of class \code{\link{yuima.data-class}} or the content of 
+\code{x at data@zoo.data} if \code{x} is of class \code{\link{yuima-class}}.
+}
 \value{
-   \item{value}{A list of object(s) of class \code{\link{yuima.data-class}} for 
+   \item{value}{a list of object(s) of class \code{\link{yuima.data-class}} for 
    \code{setData}. 
-   The \code{zoo.data} field for \code{get.zoo.data}}
+   The content of the \code{zoo.data}  slot for \code{get.zoo.data}}
 }
 \author{The YUIMA Project Team}
 \examples{

Modified: pkg/yuima/man/setModel.Rd
===================================================================
--- pkg/yuima/man/setModel.Rd	2009-12-16 10:08:26 UTC (rev 45)
+++ pkg/yuima/man/setModel.Rd	2009-12-19 05:25:34 UTC (rev 46)
@@ -6,9 +6,14 @@
 }
 
 \description{
-  'setModel' is used to give a mathematical description of 
-  diffusion processes. All functions relying on the \pkg{yuima} 
-  package should assume to get as much information as possible 
+  'setModel' gives a description of 
+  stochastic differential equation with or without jumps of the following
+  form:
+
+  \code{dXt = a(t,Xt, alpha)dt + b(t,Xt,beta)dWt + c(t,Xt,gamma)dZt,  X0=x0}  
+
+  All functions relying on the \pkg{yuima} 
+  package will get as much information as possible 
   from the different slots of the \code{\link{yuima-class}} structure
   without replicating the same code twice. 
   If there are missing pieces of information, some default values 
@@ -31,20 +36,19 @@
    of the Hurst index.}
   \item{jump.coeff}{a matrix of \code{expression}s for the jump component.}
   \item{measure}{Levy measure for jump variables.}
-  \item{measure.type}{Type specification for Levy measures.}
-  \item{state.variable}{a vector of names identifying the names used to 
-    denote the state variable in the drift and diffusion
-    specifications.}
-  \item{jump.variable}{a vector of names identifying the names used to denote
-    the jump variable in the jump specifications.}
-  \item{time.variable}{a vector of names identifying the names used to 
-    denote the time variable in the drift and diffusion specifications.}  
-  \item{solve.variable}{a vector of names identifying the names used to 
-    denote the left-hand-side of each equation in the model; this equals 
+  \item{measure.type}{type specification for Levy measures.}
+  \item{state.variable}{a vector of names of the state variables in the drift 
+	and diffusion coefficients.}
+  \item{jump.variable}{a vector of names of the jump variables in the jump 
+    coefficient.}
+  \item{time.variable}{the name of the time variable.}  
+  \item{solve.variable}{a vector of names of the variables in the left-hand-side 
+    of the equations in the model; \code{solve.variable} equals 
     \code{state.variable} as long as we have no exogenous variable other than 
     statistical parameters in the coefficients (\code{drift} and
     \code{diffusion}).}  
-  \item{xinit}{a vector of numbers identifying the initial value of model.}
+  \item{xinit}{a vector of numbers identifying the initial value of the 
+  \code{solve.variable}.}
 }
 
 \details{
@@ -54,9 +58,9 @@
 An object of \code{\link{yuima.model-class}} contains several slots:
 
 \describe{		
-\item{\code{drift}:}{is an \R{} expression which specifies the drift coefficient 
+\item{\code{drift}:}{is an \R expression which specifies the drift coefficient 
 (a vector).}
-\item{\code{diffusion}:}{is an \R{} expression which specifies the diffusion 
+\item{\code{diffusion}:}{is an \R expression which specifies the diffusion 
 coefficient (a matrix).}
 \item{\code{jump.coeff}:}{is coefficients of the jump term.}
 \item{\code{measure}:}{is a measure of the Levy process}
@@ -109,24 +113,24 @@
 }
 
 \examples{
-# Ex 1. (One-dimensional homogeneous diffusion)
+# Ex 1. (One-dimensional diffusion process)
 # To describe
-# dXt = -3*Xt*dt + (1/(1+Xt^2))dWt,
+# dXt = -3*Xt*dt + (1/(1+Xt^2+t))dWt,
 # we set
-mod1 <- setModel(drift = "-3*x", diffusion = "1/(1+x^{2})", solve.variable = c("x"))
+mod1 <- setModel(drift = "-3*x", diffusion = "1/(1+x^2+t)", solve.variable = c("x"))
 # We may omit the solve.variable; then the default variable x is used
-mod1 <- setModel(drift = "-3*x", diffusion = "1/(1+x^{2})")
+mod1 <- setModel(drift = "-3*x", diffusion = "1/(1+x^2+t)")
 # Look at the model structure by
 str(mod1)
 
-# Ex 2. (Two-dimensional homogeneous diffusion)
+# Ex 2. (Two-dimensional diffusion process with three factors)
 # To describe
-# dX1t = -3*X1t*dt         + dW1t,
-# dX2t = -(X1t + 2*X2t)*dt + 0.5*dW1t + dW2t,
+# dX1t = -3*X1t*dt + dW1t +x2t*dW3t,
+# dX2t = -(X1t + 2*X2t)*dt + x1t*dW1t + 3*dW2t,
 # we set the drift coefficient
 a <- c("-3*x1","-x1-2*x2")
 # and also the diffusion coefficient
-b <- matrix(c("1","0.5","0","1"),2,2)
+b <- matrix(c("1","x1","0","3","x2","0"),2,3)
 # Then set
 mod2 <- setModel(drift = a, diffusion = b, solve.variable = c("x1","x2"))
 # Look at the model structure by
@@ -134,6 +138,10 @@
 # The noise.number is automatically determined by inputting the diffusion matrix expression.
 # If the dimensions of the drift differs from the number of the rows of the diffusion, 
 # the error message is returned.
+
+# Ex 3. (Process with jumps)
+
+# Ex 4. (Process with fractional Gaussian noise)
 }
 \keyword{ts}
 

Modified: pkg/yuima/man/yuima.data-class.Rd
===================================================================
--- pkg/yuima/man/yuima.data-class.Rd	2009-12-16 10:08:26 UTC (rev 45)
+++ pkg/yuima/man/yuima.data-class.Rd	2009-12-19 05:25:34 UTC (rev 46)
@@ -14,9 +14,13 @@
 %\alias{setSampling,yuima.data-method}
 \alias{poisson.random.sampling,yuima.data-method}
 
-\title{Classes for stochastic differential equations data object}
+\title{Class "yuima.data" for the data slot of a "yuima" class object}
 \description{
-  The \code{yuima.data-class} is a class of the \pkg{yuima} package.  
+  The \code{yuima.data-class} is a class of the \pkg{yuima} package used to store 
+  the data which are hold in the slot \code{data} of an object of
+  the \code{yuima-class} class.   
+  
+  Objects from this class contain either true data or simulated data.
 }
 \section{Slots}{
   \describe{
@@ -25,28 +29,61 @@
   }
 }
 \details{
-This object is one of the slots of the \code{\link{yuima.data-class}}.
-The object contains two slots. 
+Objects in this class are created or initialized using the 
+methods \code{new} or \code{initialize} or via the function \code{\link{setData}}. 
+The preferred way to construct an object in this class is to use the function
+\code{\link{setData}}.
 
-The slot \code{original.data} contains, as the name suggests,
-a copy of the original data passed by the user to the \code{initialize} method 
-and/or the \code{\link{setData}} function. It is intended for backup purposes.
+Objects in this class are used to store 
+the data which are hold in the slot \code{data} of an object of
+the \code{yuima-class} class.   
 
-Internally, the \pkg{yuima} package stores and operates on  
-\code{\link{zoo}}-type objects.
-The \code{\link{zoo}}-fied data are contained in the slot \code{zoo.data}.
+Objects in this class contain two slots described here. 
+\describe{
+  \item{\code{original.data}:}{The slot \code{original.data} contains, as the 
+   name suggests, a copy of the original data passed by the user to methods 
+   \code{new} or \code{initialize} or to the function \code{\link{setData}}. 
+   It is intended for backup purposes.}
+  \item{\code{zoo.data}:}{when a new object of this class is created or 
+   initialized using the \code{original.data}, the package tries to convert 
+   \code{original.data} into an object of class \code{\link{zoo}}. The 
+   \code{\link{zoo}}-fied data are stored in the slot \code{zoo.data}.
 
+   If the conversion fails, the initialization or creation of the object fails.
+
+   Internally, the \pkg{yuima} package stores and operates on  
+   \code{\link{zoo}}-type objects.}
+}
 If data are obtained by simulation, the \code{original.data} slot 
 is usually empty.
 }
 \section{Methods}{
   \describe{
-    \item{initialize}{\code{signature(x = "yuima.data")}: sets both slot of \code{\link{yuima.data-class}}.}
-    \item{get.zoo.data}{\code{signature(x = "yuima.data")}: returns slot \code{zoo.data}.}
-    \item{plot}{\code{signature(x = "yuima.data")}: same as \code{\link{zoo}}.}
-    \item{dim}{\code{signature(x = "yuima.data")}: same as \code{\link{zoo}}.}
-    \item{length}{\code{signature(x = "yuima.data")}: same as \code{\link{zoo}}.}
-    \item{cce}{\code{signature(x = "yuima.data")}: Cumulative Covariance Estimator.}
+    \item{new}{\code{signature(x = "yuima.data", original.data)}: the function 
+	 makes a copy of the prototype object from the class definition of
+	 \code{\link{yuima.data-class}}, then
+	 calls the \code{initialize} method passing as arguments the newly created 
+	 object and the \code{original.data}.} 
+    \item{initialize}{\code{signature(x = "yuima.data", original.data)}: makes
+	a copy of \code{original.data} into the slot \code{original.data} of 
+	\code{x} and tries to coerce \code{original.data} into an object of class
+	\code{\link{zoo}}. The result is put in the slot  \code{zoo.data} of 
+	\code{x}. If coercion fails, the \code{intialize} method fails as well.}
+    \item{get.zoo.data}{\code{signature(x = "yuima.data")}: returns the content
+	of the slot \code{zoo.data} of \code{x}.}
+    \item{plot}{\code{signature(x = "yuima.data",  \dots)}: calls  
+	 \code{\link{plot}} from the \code{\link{zoo}} package with argument
+	 \code{x at zoo.data}. Additional arguments \code{\dots} are passed
+	 as is to the \code{\link{plot}} function.}
+    \item{dim}{\code{signature(x = "yuima.data")}: calls  
+	 \code{\link{dim}} from the \code{\link{zoo}} package with argument
+	 \code{x at zoo.data}.}
+    \item{length}{\code{signature(x = "yuima.data")}: calls  
+	 \code{\link{length}} from the \code{\link{zoo}} package with argument
+	 \code{x at zoo.data}.}
+    \item{cce}{\code{signature(x = "yuima.data")}: calculates asyncronous
+	 covariance estimator on the data contained in \code{x at zoo.data}. 
+	 For more details see \code{\link{cce}}.}
   }
 }
 \author{The YUIMA Project Team}



More information about the Yuima-commits mailing list