[Distr-commits] r1007 - branches/distr-2.6/pkg/distrEx/tests/Examples

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun May 3 07:06:58 CEST 2015


Author: stamats
Date: 2015-05-03 07:06:57 +0200 (Sun, 03 May 2015)
New Revision: 1007

Modified:
   branches/distr-2.6/pkg/distrEx/tests/Examples/distrEx-Ex.Rout.save
Log:
updated Rout.save file

Modified: branches/distr-2.6/pkg/distrEx/tests/Examples/distrEx-Ex.Rout.save
===================================================================
--- branches/distr-2.6/pkg/distrEx/tests/Examples/distrEx-Ex.Rout.save	2015-05-03 05:06:19 UTC (rev 1006)
+++ branches/distr-2.6/pkg/distrEx/tests/Examples/distrEx-Ex.Rout.save	2015-05-03 05:06:57 UTC (rev 1007)
@@ -1,1440 +1,1390 @@
-
-R version 3.0.1 Patched (2013-09-02 r63805) -- "Good Sport"
-Copyright (C) 2013 The R Foundation for Statistical Computing
-Platform: x86_64-w64-mingw32/x64 (64-bit)
-
-R is free software and comes with ABSOLUTELY NO WARRANTY.
-You are welcome to redistribute it under certain conditions.
-Type 'license()' or 'licence()' for distribution details.
-
-  Natural language support but running in an English locale
-
-R is a collaborative project with many contributors.
-Type 'contributors()' for more information and
-'citation()' on how to cite R or R packages in publications.
-
-Type 'demo()' for some demos, 'help()' for on-line help, or
-'help.start()' for an HTML browser interface to help.
-Type 'q()' to quit R.
-
-> pkgname <- "distrEx"
-> source(file.path(R.home("share"), "R", "examples-header.R"))
-> options(warn = 1)
-> options(pager = "console")
-> base::assign(".ExTimings", "distrEx-Ex.timings", pos = 'CheckExEnv')
-> base::cat("name\tuser\tsystem\telapsed\n", file=base::get(".ExTimings", pos = 'CheckExEnv'))
-> base::assign(".format_ptime",
-+ function(x) {
-+   if(!is.na(x[4L])) x[1L] <- x[1L] + x[4L]
-+   if(!is.na(x[5L])) x[2L] <- x[2L] + x[5L]
-+   options(OutDec = '.')
-+   format(x[1L:3L], digits = 7L)
-+ },
-+ pos = 'CheckExEnv')
-> 
-> ### * </HEADER>
-> library('distrEx')
-Loading required package: distr
-Loading required package: startupmsg
-:startupmsg>  Utilities for start-up messages (version 0.8)
-:startupmsg> 
-:startupmsg>  For more information see ?"startupmsg",
-:startupmsg>  NEWS("startupmsg")
-
-Loading required package: sfsmisc
-Loading required package: SweaveListingUtils
-:SweaveListingUtils>  Utilities for Sweave together with
-:SweaveListingUtils>  TeX listings package (version
-:SweaveListingUtils>  0.6.1)
-:SweaveListingUtils> 
-:SweaveListingUtils>  NOTE: Support for this package
-:SweaveListingUtils>  will stop soon.
-:SweaveListingUtils> 
-:SweaveListingUtils>  Package 'knitr' is providing the
-:SweaveListingUtils>  same functionality in a better
-:SweaveListingUtils>  way.
-:SweaveListingUtils> 
-:SweaveListingUtils>  Some functions from package 'base'
-:SweaveListingUtils>  are intentionally masked ---see
-:SweaveListingUtils>  SweaveListingMASK().
-:SweaveListingUtils> 
-:SweaveListingUtils>  Note that global options are
-:SweaveListingUtils>  controlled by
-:SweaveListingUtils>  SweaveListingoptions() ---c.f.
-:SweaveListingUtils>  ?"SweaveListingoptions".
-:SweaveListingUtils> 
-:SweaveListingUtils>  For more information see
-:SweaveListingUtils>  ?"SweaveListingUtils",
-:SweaveListingUtils>  NEWS("SweaveListingUtils")
-:SweaveListingUtils>  There is a vignette to this
-:SweaveListingUtils>  package; try
-:SweaveListingUtils>  vignette("ExampleSweaveListingUtils").
-
-
-Attaching package: 'SweaveListingUtils'
-
-The following objects are masked from 'package:base':
-
-    library, require
-
-:distr>  Object oriented implementation of distributions (version
-:distr>  2.5.2)
-:distr> 
-:distr>  Attention: Arithmetics on distribution objects are
-:distr>  understood as operations on corresponding random variables
-:distr>  (r.v.s); see distrARITH().
-:distr> 
-:distr>  Some functions from package 'stats' are intentionally masked
-:distr>  ---see distrMASK().
-:distr> 
-:distr>  Note that global options are controlled by distroptions()
-:distr>  ---c.f. ?"distroptions".
-:distr> 
-:distr>  For more information see ?"distr", NEWS("distr"), as well as
-:distr>    http://distr.r-forge.r-project.org/
-:distr>  Package "distrDoc" provides a vignette to this package as
-:distr>  well as to several extension packages; try
-:distr>  vignette("distr").
-
-
-Attaching package: 'distr'
-
-The following objects are masked from 'package:stats':
-
-    df, qqplot, sd
-
-:distrEx>  Extensions of package distr (version 2.5)
-:distrEx> 
-:distrEx>  Note: Packages "e1071", "moments", "fBasics" should be
-:distrEx>  attached /before/ package "distrEx". See
-:distrEx>  distrExMASK().Note: Extreme value distribution
-:distrEx>  functionality has been moved to
-:distrEx> 
-:distrEx>        package "RobExtremes". See distrExMOVED().
-:distrEx> 
-:distrEx>  For more information see ?"distrEx", NEWS("distrEx"), as
-:distrEx>  well as
-:distrEx>    http://distr.r-forge.r-project.org/
-:distrEx>  Package "distrDoc" provides a vignette to this package
-:distrEx>  as well as to several related packages; try
-:distrEx>  vignette("distr").
-
-
-Attaching package: 'distrEx'
-
-The following objects are masked from 'package:stats':
-
-    IQR, mad, median, var
-
-> 
-> base::assign(".oldSearch", base::search(), pos = 'CheckExEnv')
-> cleanEx()
-> nameEx("AbscontCondDistribution-class")
-> ### * AbscontCondDistribution-class
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: AbscontCondDistribution-class
-> ### Title: Absolutely continuous conditional distribution
-> ### Aliases: AbscontCondDistribution-class
-> ### Keywords: distribution
-> 
-> ### ** Examples
-> new("AbscontCondDistribution")
-Distribution object of class: AbscontCondDistribution
-## cond:
-An object of class "Condition"
-Slot "name":
-[1] "a condition"
-
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("AbscontCondDistribution-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("AsymTotalVarDist")
-> ### * AsymTotalVarDist
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: AsymTotalVarDist
-> ### Title: Generic function for the computation of asymmetric total
-> ###   variation distance of two distributions
-> ### Aliases: AsymTotalVarDist AsymTotalVarDist-methods
-> ###   AsymTotalVarDist,AbscontDistribution,AbscontDistribution-method
-> ###   AsymTotalVarDist,AbscontDistribution,DiscreteDistribution-method
-> ###   AsymTotalVarDist,DiscreteDistribution,DiscreteDistribution-method
-> ###   AsymTotalVarDist,DiscreteDistribution,AbscontDistribution-method
-> ###   AsymTotalVarDist,LatticeDistribution,DiscreteDistribution-method
-> ###   AsymTotalVarDist,DiscreteDistribution,LatticeDistribution-method
-> ###   AsymTotalVarDist,LatticeDistribution,LatticeDistribution-method
-> ###   AsymTotalVarDist,numeric,DiscreteDistribution-method
-> ###   AsymTotalVarDist,DiscreteDistribution,numeric-method
-> ###   AsymTotalVarDist,numeric,AbscontDistribution-method
-> ###   AsymTotalVarDist,AbscontDistribution,numeric-method
-> ###   AsymTotalVarDist,AcDcLcDistribution,AcDcLcDistribution-method
-> ### Keywords: distribution
-> 
-> ### ** Examples
-> 
-> AsymTotalVarDist(Norm(), UnivarMixingDistribution(Norm(1,2),Norm(0.5,3),
-+                  mixCoeff=c(0.2,0.8)), rho=0.3)
-asym. total variation distance 
-                     0.5311789 
-> AsymTotalVarDist(Norm(), Td(10), rho=0.3)
-asym. total variation distance 
-                    0.03412602 
-> AsymTotalVarDist(Norm(mean = 50, sd = sqrt(25)), Binom(size = 100), rho=0.3) # mutually singular
-asym. total variation distance 
-                             1 
-> AsymTotalVarDist(Pois(10), Binom(size = 20), rho=0.3) 
-asym. total variation distance 
-                     0.3093959 
-> 
-> x <- rnorm(100)
-> AsymTotalVarDist(Norm(), x, rho=0.3)
-asym. total variation distance 
-                     0.3140162 
-> AsymTotalVarDist(x, Norm(), asis.smooth.discretize = "smooth", rho=0.3)
-asym. total variation distance 
-                     0.2658876 
-> 
-> y <- (rbinom(50, size = 20, prob = 0.5)-10)/sqrt(5)
-> AsymTotalVarDist(y, Norm(), rho=0.3)
-asym. total variation distance 
-                     0.8343428 
-> AsymTotalVarDist(y, Norm(), asis.smooth.discretize = "smooth", rho=0.3)
-asym. total variation distance 
-                     0.6326863 
-> 
-> AsymTotalVarDist(rbinom(50, size = 20, prob = 0.5), Binom(size = 20, prob = 0.5), rho=0.3)
-asym. total variation distance 
-                      0.292515 
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("AsymTotalVarDist", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("Condition-class")
-> ### * Condition-class
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: Condition-class
-> ### Title: Conditions
-> ### Aliases: Condition-class name,Condition-method name<-,Condition-method
-> ### Keywords: distribution
-> 
-> ### ** Examples
-> new("Condition")
-An object of class "Condition"
-Slot "name":
-[1] "a condition"
-
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("Condition-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("ContaminationSize")
-> ### * ContaminationSize
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: ContaminationSize
-> ### Title: Generic Function for the Computation of the Convex Contamination
-> ###   (Pseudo-)Distance of Two Distributions
-> ### Aliases: ContaminationSize ContaminationSize-methods
-> ###   ContaminationSize,AbscontDistribution,AbscontDistribution-method
-> ###   ContaminationSize,DiscreteDistribution,DiscreteDistribution-method
-> ###   ContaminationSize,LatticeDistribution,DiscreteDistribution-method
-> ###   ContaminationSize,DiscreteDistribution,LatticeDistribution-method
-> ###   ContaminationSize,LatticeDistribution,LatticeDistribution-method
-> ###   ContaminationSize,AcDcLcDistribution,AcDcLcDistribution-method
-> ### Keywords: distribution
-> 
-> ### ** Examples
-> 
-> ContaminationSize(Norm(), Norm(mean=0.1))
-$e1
-Distribution Object of Class: Norm
- mean: 0
- sd: 1
-
-$e2
-Distribution Object of Class: Norm
- mean: 0.1
- sd: 1
-
-$size.of.contamination
-[1] 0.3504588
-
-> ContaminationSize(Pois(), Pois(1.5))
-$e1
-Distribution Object of Class: Pois
- lambda: 1
-
-$e2
-Distribution Object of Class: Pois
- lambda: 1.5
-
-$size.of.contamination
-[1] 0.3934693
-
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("ContaminationSize", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("ConvexContamination")
-> ### * ConvexContamination
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: ConvexContamination
-> ### Title: Generic Function for Generating Convex Contaminations
-> ### Aliases: ConvexContamination ConvexContamination-methods
-> ###   ConvexContamination,UnivariateDistribution,UnivariateDistribution,numeric-method
-> ###   ConvexContamination,AbscontDistribution,AbscontDistribution,numeric-method
-> ###   ConvexContamination,AbscontDistribution,UnivariateDistribution,numeric-method
-> ###   ConvexContamination,DiscreteDistribution,DiscreteDistribution,numeric-method
-> ###   ConvexContamination,LatticeDistribution,DiscreteDistribution,numeric-method
-> ###   ConvexContamination,DiscreteDistribution,LatticeDistribution,numeric-method
-> ###   ConvexContamination,LatticeDistribution,LatticeDistribution,numeric-method
-> ###   ConvexContamination,AcDcLcDistribution,AcDcLcDistribution,numeric-method
-> ### Keywords: distribution methods
-> 
-> ### ** Examples
-> 
-> # Convex combination of two normal distributions
-> C1 <- ConvexContamination(e1 = Norm(), e2 = Norm(mean = 5), size = 0.1)
-> plot(C1)
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("ConvexContamination", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("CvMDist")
-> ### * CvMDist
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: CvMDist
-> ### Title: Generic function for the computation of the Cramer - von Mises
-> ###   distance of two distributions
-> ### Aliases: CvMDist CvMDist-methods
-> ###   CvMDist,UnivariateDistribution,UnivariateDistribution-method
-> ###   CvMDist,numeric,UnivariateDistribution-method
-> ### Keywords: distribution
-> 
-> ### ** Examples
-> 
-> CvMDist(Norm(), UnivarMixingDistribution(Norm(1,2),Norm(0.5,3),
-+                  mixCoeff=c(0.2,0.8)))
-CvM distance 
-   0.1812994 
-> CvMDist(Norm(), UnivarMixingDistribution(Norm(1,2),Norm(0.5,3),
-+                  mixCoeff=c(0.2,0.8)),mu=Norm())
-CvM distance 
-   0.1812994 
-> CvMDist(Norm(), Td(10))
-CvM distance 
-  0.00933072 
-> CvMDist(Norm(mean = 50, sd = sqrt(25)), Binom(size = 100))
-CvM distance 
-  0.03027538 
-> CvMDist(Pois(10), Binom(size = 20)) 
-CvM distance 
-  0.06084579 
-> CvMDist(rnorm(100),Norm())
-CvM distance 
-  0.04673118 
-> CvMDist((rbinom(50, size = 20, prob = 0.5)-10)/sqrt(5), Norm())
-CvM distance 
-  0.07267501 
-> CvMDist(rbinom(50, size = 20, prob = 0.5), Binom(size = 20, prob = 0.5))
-CvM distance 
-  0.07435729 
-> CvMDist(rbinom(50, size = 20, prob = 0.5), Binom(size = 20, prob = 0.5), mu = Pois())
-CvM distance 
- 0.001969063 
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("CvMDist", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("DiscreteCondDistribution-class")
-> ### * DiscreteCondDistribution-class
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: DiscreteCondDistribution-class
-> ### Title: Discrete conditional distribution
-> ### Aliases: DiscreteCondDistribution-class
-> ### Keywords: distribution
-> 
-> ### ** Examples
-> new("DiscreteCondDistribution")
-Distribution object of class: DiscreteCondDistribution
-## cond:
-An object of class "Condition"
-Slot "name":
-[1] "a condition"
-
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("DiscreteCondDistribution-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("DiscreteMVDistribution-class")
-> ### * DiscreteMVDistribution-class
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: DiscreteMVDistribution-class
-> ### Title: Discrete Multivariate Distributions
-> ### Aliases: DiscreteMVDistribution-class
-> ###   support,DiscreteMVDistribution-method
-> ### Keywords: distribution
-> 
-> ### ** Examples
-> 
-> (D1 <- new("MultivariateDistribution")) # Dirac measure in (0,0)
-> r(D1)(5)
-     [,1] [,2]
-[1,]    0    0
-[2,]    0    0
-[3,]    0    0
-[4,]    0    0
-[5,]    0    0
-> 
-> (D2 <- DiscreteMVDistribution(supp = matrix(c(1:5, rep(3, 5)), ncol=2, byrow=TRUE)))
-Warning in DiscreteMVDistribution(supp = matrix(c(1:5, rep(3, 5)), ncol = 2,  :
-  collapsing to unique support values
-> support(D2)
-     [,1] [,2]
-[1,]    1    2
-[2,]    3    4
-[3,]    5    3
-[4,]    3    3
-> r(D2)(10)
-      [,1] [,2]
- [1,]    3    3
- [2,]    3    3
- [3,]    5    3
- [4,]    1    2
- [5,]    3    3
- [6,]    1    2
- [7,]    1    2
- [8,]    3    4
- [9,]    3    4
-[10,]    3    3
-> d(D2)(support(D2))
-[1] 0.2 0.2 0.2 0.4
-> p(D2)(lower = c(1,1), upper = c(3,3))
-[1] 0.6
-> q(D2)
-NULL
-> param(D2)
-NULL
-> img(D2)
-An object of class "EuclideanSpace"
-Slot "dimension":
-[1] 2
-
-Slot "name":
-[1] "Euclidean Space"
-
-> 
-> e1 <- E(D2) # expectation
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("DiscreteMVDistribution-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("DiscreteMVDistribution")
-> ### * DiscreteMVDistribution
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: DiscreteMVDistribution
-> ### Title: Generating function for DiscreteMVDistribution-class
-> ### Aliases: DiscreteMVDistribution
-> ### Keywords: distribution
-> 
-> ### ** Examples
-> 
-> # Dirac-measure at (0,0,0)
-> D1 <- DiscreteMVDistribution(supp = c(0,0,0))
-> support(D1)
-     [,1] [,2] [,3]
-[1,]    0    0    0
-> 
-> # simple discrete distribution
-> D2 <- DiscreteMVDistribution(supp = matrix(c(0,1,0,2,2,1,1,0), ncol=2), 
-+                 prob = c(0.3, 0.2, 0.2, 0.3))
-> support(D2)
-     [,1] [,2]
-[1,]    0    2
-[2,]    1    1
-[3,]    0    1
-[4,]    2    0
-> r(D2)(10)
-      [,1] [,2]
- [1,]    0    2
- [2,]    2    0
- [3,]    2    0
- [4,]    1    1
- [5,]    0    2
- [6,]    1    1
- [7,]    1    1
- [8,]    0    1
- [9,]    0    1
-[10,]    0    2
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("DiscreteMVDistribution", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("E")
-> ### * E
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: E
-> ### Title: Generic Function for the Computation of (Conditional)
-> ###   Expectations
-> ### Aliases: E E-methods E,UnivariateDistribution,missing,missing-method
-> ###   E,AbscontDistribution,missing,missing-method
-> ###   E,DiscreteDistribution,missing,missing-method
-> ###   E,LatticeDistribution,missing,missing-method
-> ###   E,AffLinDistribution,missing,missing-method
-> ###   E,AffLinAbscontDistribution,missing,missing-method
-> ###   E,AffLinDiscreteDistribution,missing,missing-method
-> ###   E,AffLinLatticeDistribution,missing,missing-method
-> ###   E,MultivariateDistribution,missing,missing-method
-> ###   E,DiscreteMVDistribution,missing,missing-method
-> ###   E,UnivarLebDecDistribution,missing,missing-method
-> ###   E,AffLinUnivarLebDecDistribution,missing,missing-method
-> ###   E,UnivarMixingDistribution,missing,missing-method
-> ###   E,UnivariateDistribution,function,missing-method
-> ###   E,AbscontDistribution,function,missing-method
-> ###   E,DiscreteDistribution,function,missing-method
-> ###   E,LatticeDistribution,function,missing-method
-> ###   E,MultivariateDistribution,function,missing-method
-> ###   E,DiscreteMVDistribution,function,missing-method
-> ###   E,UnivarLebDecDistribution,function,missing-method
-> ###   E,UnivarMixingDistribution,function,missing-method
-> ###   E,AcDcLcDistribution,ANY,ANY-method
-> ###   E,CompoundDistribution,missing,missing-method
-> ###   E,UnivariateCondDistribution,missing,numeric-method
-> ###   E,AbscontCondDistribution,missing,numeric-method
-> ###   E,DiscreteCondDistribution,missing,numeric-method
-> ###   E,UnivarLebDecDistribution,missing,ANY-method
-> ###   E,UnivarMixingDistribution,missing,ANY-method
-> ###   E,UnivarLebDecDistribution,function,ANY-method
-> ###   E,UnivariateCondDistribution,function,numeric-method
-> ###   E,UnivarMixingDistribution,function,ANY-method
-> ###   E,AbscontCondDistribution,function,numeric-method
-> ###   E,DiscreteCondDistribution,function,numeric-method
-> ###   E,Arcsine,missing,missing-method E,Beta,missing,missing-method
-> ###   E,Binom,missing,missing-method E,Cauchy,missing,missing-method
-> ###   E,Chisq,missing,missing-method E,Dirac,missing,missing-method
-> ###   E,DExp,missing,missing-method E,Exp,missing,missing-method
-> ###   E,Fd,missing,missing-method E,Gammad,missing,missing-method
-> ###   E,Gammad,function,missing-method E,Geom,missing,missing-method
-> ###   E,Gumbel,missing,missing-method E,GPareto,missing,missing-method
-> ###   E,GPareto,function,missing-method E,GEV,missing,missing-method
-> ###   E,GEV,function,missing-method E,Hyper,missing,missing-method
-> ###   E,Logis,missing,missing-method E,Lnorm,missing,missing-method
-> ###   E,Nbinom,missing,missing-method E,Norm,missing,missing-method
-> ###   E,Pareto,missing,missing-method E,Pois,missing,missing-method
-> ###   E,Td,missing,missing-method E,Unif,missing,missing-method
-> ###   E,Weibull,missing,missing-method
-> ### Keywords: methods distribution
-> 
-> ### ** Examples
-> 
-> # mean of Exp(1) distribution
-> E <- Exp() 
-> 
-> E(E) ## uses explicit terms
-[1] 1
-> E(as(E,"AbscontDistribution")) ## uses numerical integration
-[1] 0.9999983
-> E(as(E,"UnivariateDistribution")) ## uses simulations
-[1] 1.002698
-> E(E, fun = function(x){2*x^2}) ## uses simulations
-[1] 3.999941
-> 
-> # the same operator for discrete distributions:
-> P <- Pois(lambda=2)
-> 
-> E(P) ## uses explicit terms
-[1] 2
-> E(as(P,"DiscreteDistribution")) ## uses sums
-[1] 1.999997
-> E(as(P,"UnivariateDistribution")) ## uses simulations
-[1] 2.00881
-> E(P, fun = function(x){2*x^2}) ## uses simulations
-[1] 11.99993
-> 
-> 
-> # second moment of N(1,4)
-> E(Norm(mean=1, sd=2), fun = function(x){x^2})
-[1] 4.999977
-> E(Norm(mean=1, sd=2), fun = function(x){x^2}, useApply = FALSE)
-[1] 4.999977
-> 
-> # conditional distribution of a linear model
-> D1 <- LMCondDistribution(theta = 1) 
-> E(D1, cond = 1)
-[1] 0.9999998
-> E(Norm(mean=1))
-[1] 1
-> E(D1, function(x){x^2}, cond = 1)
-[1] 1.999994
-> E(Norm(mean=1), fun = function(x){x^2})
-[1] 1.999994
-> E(D1, function(x, cond){cond*x^2}, cond = 2, withCond = TRUE, useApply = FALSE)
-[1] 9.999987
-> E(Norm(mean=2), function(x){2*x^2})
-[1] 9.999987
-> 
-> E(as(Norm(mean=2),"AbscontDistribution"))
-[1] 2
-> ### somewhat less accurate:
-> E(as(Norm(mean=2),"AbscontDistribution"), 
-+      lowerTruncQuantil=1e-4,upperTruncQuantil=1e-4, IQR.fac= 4)
-[1] 2
-> ### even less accurate:
-> E(as(Norm(mean=2),"AbscontDistribution"), 
-+      lowerTruncQuantil=1e-2,upperTruncQuantil=1e-2, IQR.fac= 4)
-[1] 2
-> ### no good idea, but just as an example:
-> E(as(Norm(mean=2),"AbscontDistribution"), 
-+      lowerTruncQuantil=1e-2,upperTruncQuantil=1e-2, IQR.fac= .1)
-[1] 2
-> 
-> ### truncation of integration range; see also m1df...
-> E(Norm(mean=2), low=2,upp=4)
-[1] 1.299451
-> 
-> E(Cauchy())
-[1] NA
-> E(Cauchy(),upp=3,low=-2)
-[1] 0
-> # some Lebesgue decomposed distribution 
-> mymix <- UnivarLebDecDistribution(acPart = Norm(), discretePart = Binom(4,.4),
-+          acWeight = 0.4)
-> E(mymix)
-[1] 0.96
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("E", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("EuclCondition-class")
-> ### * EuclCondition-class
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: EuclCondition-class
-> ### Title: Conditioning by an Euclidean space.
-> ### Aliases: EuclCondition-class Range Range,EuclCondition-method
-> ###   show,EuclCondition-method
-> ### Keywords: distribution
-> 
-> ### ** Examples
-> 
->   new("EuclCondition")
-name:	conditioning by an Euclidean space
-Range:	Euclidean Space with dimension 1
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("EuclCondition-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("EuclCondition")
-> ### * EuclCondition
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: EuclCondition
-> ### Title: Generating function for EuclCondition-class
-> ### Aliases: EuclCondition
-> ### Keywords: distribution
-> 
-> ### ** Examples
-> 
-> EuclCondition(dimension = 3)
-name:	conditioning by an Euclidean space
-Range:	Euclidean Space with dimension 3
-> 
-> ## The function is currently defined as
-> function(dimension){
-+     new("EuclCondition", Range = EuclideanSpace(dimension = dimension))
-+ }
-function (dimension) 
-{
-    new("EuclCondition", Range = EuclideanSpace(dimension = dimension))
-}
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("EuclCondition", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("GLIntegrate")
-> ### * GLIntegrate
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: GLIntegrate
-> ### Title: Gauss-Legendre Quadrature
-> ### Aliases: GLIntegrate
-> ### Keywords: math utilities
-> 
-> ### ** Examples
-> 
-> integrate(dnorm, -1.96, 1.96)
-0.9500042 with absolute error < 1e-11
-> GLIntegrate(dnorm, -1.96, 1.96)
-[1] 0.9500042
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("GLIntegrate", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("HellingerDist")
-> ### * HellingerDist
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: HellingerDist
-> ### Title: Generic function for the computation of the Hellinger distance
-> ###   of two distributions
-> ### Aliases: HellingerDist HellingerDist-methods
-> ###   HellingerDist,AbscontDistribution,AbscontDistribution-method
-> ###   HellingerDist,AbscontDistribution,DiscreteDistribution-method
-> ###   HellingerDist,DiscreteDistribution,DiscreteDistribution-method
-> ###   HellingerDist,DiscreteDistribution,AbscontDistribution-method
-> ###   HellingerDist,LatticeDistribution,DiscreteDistribution-method
-> ###   HellingerDist,DiscreteDistribution,LatticeDistribution-method
-> ###   HellingerDist,LatticeDistribution,LatticeDistribution-method
-> ###   HellingerDist,numeric,DiscreteDistribution-method
-> ###   HellingerDist,DiscreteDistribution,numeric-method
-> ###   HellingerDist,numeric,AbscontDistribution-method
-> ###   HellingerDist,AbscontDistribution,numeric-method
-> ###   HellingerDist,AcDcLcDistribution,AcDcLcDistribution-method
-> ### Keywords: distribution
-> 
-> ### ** Examples
-> 
-> HellingerDist(Norm(), UnivarMixingDistribution(Norm(1,2),Norm(0.5,3),
-+                  mixCoeff=c(0.2,0.8)))
-Hellinger distance 
-         0.4604849 
-> HellingerDist(Norm(), Td(10))
-Hellinger distance 
-         0.0598968 
-> HellingerDist(Norm(mean = 50, sd = sqrt(25)), Binom(size = 100)) # mutually singular
-Hellinger distance 
-                 1 
-> HellingerDist(Pois(10), Binom(size = 20)) 
-Hellinger distance 
-         0.1742254 
-> 
-> x <- rnorm(100)
-> HellingerDist(Norm(), x)
-Hellinger distance 
-         0.3287617 
-> HellingerDist(x, Norm(), asis.smooth.discretize = "smooth")
-Hellinger distance 
-         0.1904838 
-> 
-> y <- (rbinom(50, size = 20, prob = 0.5)-10)/sqrt(5)
-> HellingerDist(y, Norm())
-Hellinger distance 
-         0.7596996 
-> HellingerDist(y, Norm(), asis.smooth.discretize = "smooth")
-Hellinger distance 
-         0.5283272 
-> 
-> HellingerDist(rbinom(50, size = 20, prob = 0.5), Binom(size = 20, prob = 0.5))
-Hellinger distance 
-         0.1945649 
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("HellingerDist", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("KolmogorovDist")
-> ### * KolmogorovDist
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: KolmogorovDist
-> ### Title: Generic function for the computation of the Kolmogorov distance
-> ###   of two distributions
-> ### Aliases: KolmogorovDist KolmogorovDist-methods
-> ###   KolmogorovDist,AbscontDistribution,AbscontDistribution-method
-> ###   KolmogorovDist,AbscontDistribution,DiscreteDistribution-method
-> ###   KolmogorovDist,DiscreteDistribution,DiscreteDistribution-method
-> ###   KolmogorovDist,DiscreteDistribution,AbscontDistribution-method
-> ###   KolmogorovDist,LatticeDistribution,DiscreteDistribution-method
-> ###   KolmogorovDist,DiscreteDistribution,LatticeDistribution-method
-> ###   KolmogorovDist,LatticeDistribution,LatticeDistribution-method
-> ###   KolmogorovDist,numeric,UnivariateDistribution-method
-> ###   KolmogorovDist,UnivariateDistribution,numeric-method
-> ###   KolmogorovDist,AcDcLcDistribution,AcDcLcDistribution-method
-> ### Keywords: distribution
-> 
-> ### ** Examples
-> 
-> KolmogorovDist(Norm(), UnivarMixingDistribution(Norm(1,2),Norm(0.5,3),
-+                  mixCoeff=c(0.2,0.8)))
-Kolmogorov distance 
-          0.3092684 
-> KolmogorovDist(Norm(), Td(10))
-Kolmogorov distance 
-         0.01554215 
-> KolmogorovDist(Norm(mean = 50, sd = sqrt(25)), Binom(size = 100))
-Kolmogorov distance 
-         0.03979462 
-> KolmogorovDist(Pois(10), Binom(size = 20)) 
-Kolmogorov distance 
-         0.08863266 
-> KolmogorovDist(Norm(), rnorm(100))
-Kolmogorov distance 
-          0.1149486 
-> KolmogorovDist((rbinom(50, size = 20, prob = 0.5)-10)/sqrt(5), Norm())
-Kolmogorov distance 
-          0.1673604 
-> KolmogorovDist(rbinom(50, size = 20, prob = 0.5), Binom(size = 20, prob = 0.5))
-Kolmogorov distance 
-         0.03172234 
-> 
-> 
-> 
-> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
-> base::cat("KolmogorovDist", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
-> cleanEx()
-> nameEx("LMCondDistribution")
-> ### * LMCondDistribution
-> 
-> flush(stderr()); flush(stdout())
-> 
-> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: LMCondDistribution
-> ### Title: Generating function for the conditional distribution of a linear
-> ###   regression model.
-> ### Aliases: LMCondDistribution
-> ### Keywords: distribution models
-> 
-> ### ** Examples
-> 
-> # normal error distribution
-> (D1 <- LMCondDistribution(theta = 1)) # corresponds to Norm(cond, 1)
-Distribution object of class: AbscontCondDistribution
- theta: 1
- intercept: 0
- scale: 1
-## cond:
-name:	conditioning by an Euclidean space
-Range:	Euclidean Space with dimension 1
-> plot(D1)
-Warning in plot(D1) :
-  'plot' not yet implemented for objects of class AbscontCondDistribution
-> r(D1)
-function (n, cond, ...) 
-{
-    if (length(cond) != 1L) 
-        stop("'cond' has wrong dimension")
-    r <- function (n) 
-    {
-        rnorm(n, mean = 0, sd = 1)
-    }
-    0 + cond %*% 1 + 1 * r(n, ...)
-}
-<environment: 0x000000000bde9f18>
-> d(D1)
-function (x, cond, log = FALSE, ...) 
-{
-    if (length(cond) != 1L) 
-        stop("'cond' has wrong dimension")
-    d <- function (x, log = FALSE) 
-    {
-        dnorm(x, mean = 0, sd = 1, log = log)
-    }
-    if ("log" %in% names(formals(d))) 
-        d0 <- d((x - 0 - as.vector(cond %*% 1))/1, log = log)
-    else {
-        d0 <- d((x - 0 - as.vector(cond %*% 1))/1)
-        if (log) 
-            d0 <- log(d0)
-    }
-    if (log) 
-        d0 <- d0 - log(1)
-    else d0 <- d0/1
-    return(d0)
-}
-<environment: 0x000000000bde9f18>
-> p(D1)
-function (q, cond, lower.tail = TRUE, log.p = FALSE, ...) 
-{
-    if (length(cond) != 1L) 
-        stop("'cond' has wrong dimension")
-    p <- function (q, lower.tail = TRUE, log.p = FALSE) 
-    {
-        pnorm(q, mean = 0, sd = 1, lower.tail = lower.tail, log.p = log.p)
-    }
-    argList <- alist((q - 0 - as.vector(cond %*% 1))/1)
-    if ("lower.tail" %in% names(formals(p))) 
-        argList <- c(argList, lower.tail = lower.tail)
-    if ("log.p" %in% names(formals(p))) 
-        argList <- c(argList, log.p = log.p)
-    dots <- alist(...)
-    if (length(dots)) 
-        argList <- c(argList, dots)
-    p0 <- do.call(p, argList)
-    if (!("lower.tail" %in% names(formals(p)))) 
-        if (!lower.tail) 
-            p0 <- 1 - p0
-    if (!("log.p" %in% names(formals(p)))) 
-        if (log.p) 
-            p0 <- log(p0)
-    return(p0)
-}
-<environment: 0x000000000bde9f18>
-> q(D1)
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/distr -r 1007


More information about the Distr-commits mailing list