From noreply at r-forge.r-project.org Sun May 3 06:13:09 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 06:13:09 +0200 (CEST) Subject: [Distr-commits] r997 - branches/distr-2.6/pkg/startupmsg Message-ID: <20150503041309.D97B818681D@r-forge.r-project.org> Author: stamats Date: 2015-05-03 06:13:07 +0200 (Sun, 03 May 2015) New Revision: 997 Modified: branches/distr-2.6/pkg/startupmsg/DESCRIPTION Log: minor change of Title and Description due to warning during check Modified: branches/distr-2.6/pkg/startupmsg/DESCRIPTION =================================================================== --- branches/distr-2.6/pkg/startupmsg/DESCRIPTION 2015-02-18 13:34:24 UTC (rev 996) +++ branches/distr-2.6/pkg/startupmsg/DESCRIPTION 2015-05-03 04:13:07 UTC (rev 997) @@ -1,9 +1,9 @@ Package: startupmsg Encoding: latin1 Version: 0.9.1 -Date: 2013-09-18 -Title: Utilities for Start-up Messages -Description: provides utilities to create or suppress start-up messages. +Date: 2015-05-03 +Title: Utilities for Start-Up Messages +Description: Provides utilities to create or suppress start-up messages. Authors at R: person("Peter", "Ruckdeschel", role=c("cre", "cph"), email="Peter.Ruckdeschel at itwm.fraunhofer.de") Depends: R(>= 1.8.0) ByteCompile: yes From noreply at r-forge.r-project.org Sun May 3 06:20:38 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 06:20:38 +0200 (CEST) Subject: [Distr-commits] r998 - branches/distr-2.6/pkg/SweaveListingUtils/inst/try Message-ID: <20150503042039.1FA171833AE@r-forge.r-project.org> Author: stamats Date: 2015-05-03 06:20:37 +0200 (Sun, 03 May 2015) New Revision: 998 Added: branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausman.Rnw Removed: branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausmann.Rnw Log: Rnw file and corresponding tex file had slightly different names Copied: branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausman.Rnw (from rev 996, branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausmann.Rnw) =================================================================== --- branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausman.Rnw (rev 0) +++ branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausman.Rnw 2015-05-03 04:20:37 UTC (rev 998) @@ -0,0 +1,112 @@ + \documentclass[9pt]{beamer} + +\usepackage{fancyvrb} +\usepackage{listings} + +% choose language and char set +\usepackage[ngerman]{babel} +\usepackage[ansinew]{inputenc} +%leave \usepackage{Sweave} somewhere in a comment (like this) +%otherwise Sweave will fill in a \usepackage{Sweave} ... + +\RequirePackage{color} +% your colors in rgb coordinates (no default values so far hence in TeX): +\definecolor{myRBackgroundColor}{rgb}{0.95, 0.85, 0.5} +\definecolor{myRKeywordColor}{rgb}{0.2, 0.5, 0.8} +\definecolor{myRRecKeywordColor}{rgb}{0.5, 0.5, 0.5} +\definecolor{myRIntKeywordColor}{rgb}{0.3, 0.5, 0.5} + +\SweaveOpts{prefix.string=Routput/parcel, keep.source=TRUE} + +<>= +require(SweaveListingUtils) +# +# define keywordstyles (in R code!): +kws <- "{\\color{myRKeywordColor}}" +kws.rec <- "{\\color{myRRecKeywordColor}}" +kws.int <- "{\\color{myRIntKeywordColor}}" +# +# frame definition: +myRFrameOn <- list("backgroundcolor"="\\color{myRBackgroundColor}", + "frame"="single", "framerule"="0pt") +myRFrameOff <- list("backgroundcolor"="\\color{white}", + "frame"="none") + +# setting keywordstyles +SweaveListingoptions(Keywordstyle = kws, + Recomd.Keywordstyle = kws.rec, + interm.Keywordstyle = kws.int) +# +# append background color in Rset - style: +myRset <- getSweaveListingOption("Rset") +myRset$"keywordstyle" <- kws +# +SweaveListingPreparations(Rcommentcolor = c(0.1,0.1,0.3), + Rcolor = c(0.6,0.4,0.4), + Routcolor = c(0.1,0.6,0.1), + Rset = myRset + # your colors in rgb coordinates + #(colors already defined in SweaveListingUtils, hence in R) + ) +lstsetRin(c(myRFrameOn,"keywordstyle"=kws),add=TRUE) +lstsetRout(c(myRFrameOn,"keywordstyle"=kws),add=TRUE) +@ + + +\begin{document} + + +\begin{frame}[fragile,allowframebreaks] +\frametitle{Your title} + +<>= +require(Hmisc) +@ + +<>= +options(digits=3, prompt="R> ") +set.seed(1) + +require(Hmisc) + +age <- rnorm(1000,50,10) +print(str(age)) +sex <- sample(c('female','male'),1000,TRUE) +out <- histbackback(split(age, sex), probability=TRUE, + xlim=c(-.06,.06), main = 'Back to Back Histogram') + +#! just adding color +barplot(-out$left, col="red" , horiz=TRUE, space=0, + add=TRUE, axes=FALSE) +barplot(out$right, col="blue", horiz=TRUE, space=0, + add=TRUE, axes=FALSE) +@ + + +and here I write some {\sf R}-code: \code{rnorm(3)} +(setting background color in inline code does not work however.) + +\framebreak +To switch of background color also for (all sorts of) S-chunks, use +<>= +lstsetRall(myRFrameOff,add=TRUE) +@ + + +<>= +options(digits=4) +set.seed(1) +age <- rnorm(1000,50,10) +str(age) +@ + +\end{frame} + +<>= + options(prompt=">",digits=6) + unloadNamespace("SweaveListingUtils") +@ + +\end{document} + +%%%%% end example Deleted: branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausmann.Rnw =================================================================== --- branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausmann.Rnw 2015-05-03 04:13:07 UTC (rev 997) +++ branches/distr-2.6/pkg/SweaveListingUtils/inst/try/try_Hausmann.Rnw 2015-05-03 04:20:37 UTC (rev 998) @@ -1,112 +0,0 @@ - \documentclass[9pt]{beamer} - -\usepackage{fancyvrb} -\usepackage{listings} - -% choose language and char set -\usepackage[ngerman]{babel} -\usepackage[ansinew]{inputenc} -%leave \usepackage{Sweave} somewhere in a comment (like this) -%otherwise Sweave will fill in a \usepackage{Sweave} ... - -\RequirePackage{color} -% your colors in rgb coordinates (no default values so far hence in TeX): -\definecolor{myRBackgroundColor}{rgb}{0.95, 0.85, 0.5} -\definecolor{myRKeywordColor}{rgb}{0.2, 0.5, 0.8} -\definecolor{myRRecKeywordColor}{rgb}{0.5, 0.5, 0.5} -\definecolor{myRIntKeywordColor}{rgb}{0.3, 0.5, 0.5} - -\SweaveOpts{prefix.string=Routput/parcel, keep.source=TRUE} - -<>= -require(SweaveListingUtils) -# -# define keywordstyles (in R code!): -kws <- "{\\color{myRKeywordColor}}" -kws.rec <- "{\\color{myRRecKeywordColor}}" -kws.int <- "{\\color{myRIntKeywordColor}}" -# -# frame definition: -myRFrameOn <- list("backgroundcolor"="\\color{myRBackgroundColor}", - "frame"="single", "framerule"="0pt") -myRFrameOff <- list("backgroundcolor"="\\color{white}", - "frame"="none") - -# setting keywordstyles -SweaveListingoptions(Keywordstyle = kws, - Recomd.Keywordstyle = kws.rec, - interm.Keywordstyle = kws.int) -# -# append background color in Rset - style: -myRset <- getSweaveListingOption("Rset") -myRset$"keywordstyle" <- kws -# -SweaveListingPreparations(Rcommentcolor = c(0.1,0.1,0.3), - Rcolor = c(0.6,0.4,0.4), - Routcolor = c(0.1,0.6,0.1), - Rset = myRset - # your colors in rgb coordinates - #(colors already defined in SweaveListingUtils, hence in R) - ) -lstsetRin(c(myRFrameOn,"keywordstyle"=kws),add=TRUE) -lstsetRout(c(myRFrameOn,"keywordstyle"=kws),add=TRUE) -@ - - -\begin{document} - - -\begin{frame}[fragile,allowframebreaks] -\frametitle{Your title} - -<>= -require(Hmisc) -@ - -<>= -options(digits=3, prompt="R> ") -set.seed(1) - -require(Hmisc) - -age <- rnorm(1000,50,10) -print(str(age)) -sex <- sample(c('female','male'),1000,TRUE) -out <- histbackback(split(age, sex), probability=TRUE, - xlim=c(-.06,.06), main = 'Back to Back Histogram') - -#! just adding color -barplot(-out$left, col="red" , horiz=TRUE, space=0, - add=TRUE, axes=FALSE) -barplot(out$right, col="blue", horiz=TRUE, space=0, - add=TRUE, axes=FALSE) -@ - - -and here I write some {\sf R}-code: \code{rnorm(3)} -(setting background color in inline code does not work however.) - -\framebreak -To switch of background color also for (all sorts of) S-chunks, use -<>= -lstsetRall(myRFrameOff,add=TRUE) -@ - - -<>= -options(digits=4) -set.seed(1) -age <- rnorm(1000,50,10) -str(age) -@ - -\end{frame} - -<>= - options(prompt=">",digits=6) - unloadNamespace("SweaveListingUtils") -@ - -\end{document} - -%%%%% end example From noreply at r-forge.r-project.org Sun May 3 06:26:10 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 06:26:10 +0200 (CEST) Subject: [Distr-commits] r999 - branches/distr-2.6/pkg/SweaveListingUtils/tests/Examples Message-ID: <20150503042610.A7B401878EE@r-forge.r-project.org> Author: stamats Date: 2015-05-03 06:26:08 +0200 (Sun, 03 May 2015) New Revision: 999 Modified: branches/distr-2.6/pkg/SweaveListingUtils/tests/Examples/SweaveListingUtils-Ex.Rout.save Log: update of Rout.save file Modified: branches/distr-2.6/pkg/SweaveListingUtils/tests/Examples/SweaveListingUtils-Ex.Rout.save =================================================================== --- branches/distr-2.6/pkg/SweaveListingUtils/tests/Examples/SweaveListingUtils-Ex.Rout.save 2015-05-03 04:20:37 UTC (rev 998) +++ branches/distr-2.6/pkg/SweaveListingUtils/tests/Examples/SweaveListingUtils-Ex.Rout.save 2015-05-03 04:26:08 UTC (rev 999) @@ -1,95 +1,82 @@ - -R version 3.0.1 Patched (2013-09-02 r63805) -- "Good Sport" -Copyright (C) 2013 The R Foundation for Statistical Computing -Platform: i386-w64-mingw32/i386 (32-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 <- "SweaveListingUtils" -> source(file.path(R.home("share"), "R", "examples-header.R")) -> options(warn = 1) -> options(pager = "console") -> base::assign(".ExTimings", "SweaveListingUtils-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') -> -> ### * -> library('SweaveListingUtils') -Loading required package: startupmsg -:startupmsg> Utilities for start-up messages (version 0.9) -:startupmsg> -:startupmsg> For more information see ?"startupmsg", -:startupmsg> NEWS("startupmsg") - -:SweaveListingUtils> Utilities for Sweave together with -:SweaveListingUtils> TeX listings package (version 0.7) -: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 - -> -> base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') -> cleanEx() -> nameEx("SweaveListingMASK") -> ### * SweaveListingMASK -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: SweaveListingMASK -> ### Title: Masking of/by other functions in package "SweaveListingUtils" -> ### Aliases: SweaveListingMASK MASKING -> ### Keywords: programming documentation -> -> ### ** Examples -> -> SweaveListingMASK() + +R Under development (unstable) (2015-05-02 r68310) -- "Unsuffered Consequences" +Copyright (C) 2015 The R Foundation for Statistical Computing +Platform: x86_64-unknown-linux-gnu (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 <- "SweaveListingUtils" +> source(file.path(R.home("share"), "R", "examples-header.R")) +> options(warn = 1) +> library('SweaveListingUtils') +Loading required package: startupmsg +:startupmsg> Utilities for Start-Up Messages (version 0.9.1) +:startupmsg> +:startupmsg> For more information see ?"startupmsg", +:startupmsg> NEWS("startupmsg") + +:SweaveListingUtils> Utilities for Sweave Together with +:SweaveListingUtils> TeX 'listings' Package (version +:SweaveListingUtils> 0.7) +: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 + +> +> base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') +> cleanEx() +> nameEx("SweaveListingMASK") +> ### * SweaveListingMASK +> +> flush(stderr()); flush(stdout()) +> +> ### Name: SweaveListingMASK +> ### Title: Masking of/by other functions in package "SweaveListingUtils" +> ### Aliases: SweaveListingMASK MASKING +> ### Keywords: programming documentation +> +> ### ** Examples +> +> SweaveListingMASK() ###################################################################### # On masking of and by other functions in package "SweaveListingUtils" ###################################################################### @@ -118,3284 +105,3231 @@ *** non-intentional masking: *** -... nothing discovered so far ...> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("SweaveListingMASK", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("SweaveListingOptions") -> ### * SweaveListingOptions -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: SweaveListingOptions -> ### Title: Function to change the global options of the package -> ### 'SweaveListingUtils' -> ### Aliases: SweaveListingOptions SweaveListingoptions -> ### getSweaveListingOption Rset Rdset Rin Rout Rcode Rcolor Rbcolor -> ### Routcolor RRecomdcolor Rcommentcolor pkg pkv Keywordstyle -> ### Recomd.Keywordstyle interm.Keywordstyle intermediate overwrite -> ### inSweave fromRForge base.url addRset addRdset fileCommand pkgCommand -> ### Keywords: misc utilities -> -> ### ** Examples -> -> SweaveListingOptions() -$Rset -$Rset$fancyvrb -[1] "true" - -$Rset$escapechar -[1] "`" - -$Rset$extendedchars -[1] "false" - -$Rset$language -[1] "R" - -$Rset$basicstyle -[1] "{\\color{Rcolor}\\small}" - -$Rset$keywordstyle -[1] "{\\bf\\color{Rcolor}}" - -$Rset$commentstyle -[1] "{\\color{Rcommentcolor}\\ttfamily\\itshape}" - -$Rset$literate -[1] "{\"}{\\texttt{\"}}1{<-}{{$\\leftarrow$}}2{<<-}{{$\\twoheadleftarrow$}}2{~}{{$\\sim$}}1{<=}{{$\\leq$}}2{>=}{{$\\geq$}}2{^}{{$\\scriptstyle\\wedge$}}1" - -$Rset$alsoother -[1] "{$}" - -$Rset$alsoletter -[1] "{.<-}" - -$Rset$otherkeywords -[1] "{!,!=,~,$,*,\\&,\\%/\\%,\\%*\\%,\\%\\%,<-,<<-,/}" - -$Rset$escapeinside -[1] "{(*}{*)}" - - -$Rdset -$Rdset$fancyvrb -[1] "true" - -$Rdset$language -[1] "Rd" - -$Rdset$keywordstyle -[1] "{\\bf}" - -$Rdset$basicstyle -[1] "{\\color{black}\\footnotesize}" - -$Rdset$commentstyle -[1] "{\\ttfamily\\itshape}" - -$Rdset$alsolanguage -[1] "R" - - -$Rin -$Rin$style -[1] "Rstyle" - -$Rin$fancyvrb -[1] "true" - -$Rin$basicstyle -[1] "\\color{Rcolor}\\small" - - -$Rout -$Rout$fancyvrb -[1] "false" - -$Rout$basicstyle -[1] "\\color{Routcolor}\\small" - - -$Rcode -$Rcode$style -[1] "Rstyle" - -$Rcode$fancyvrb -[1] "true" - -$Rcode$fontshape -[1] "sl" - -$Rcode$basicstyle -[1] "\\color{Rcolor}" - - -$Rcolor -[1] 0.0 0.5 0.5 - -$RRecomdcolor -[1] 0.0 0.6 0.4 - -$Rbcolor -[1] 0.0 0.6 0.6 - -$Routcolor -[1] 0.461 0.039 0.102 - -$Rcommentcolor -[1] 0.101 0.043 0.432 - -$pkv -[1] "2.5" - -$pkg -[1] "distr" - -$Keywordstyle -[1] "{\\bf}" - -$Recomd.Keywordstyle -[1] "{\\bf\\color{RRecomdcolor}}" - -$interm.Keywordstyle -[1] "{\\bf\\color{Rbcolor}}" - -$overwrite -[1] FALSE - -$intermediate -[1] TRUE - -$inSweave -[1] FALSE - -$fromRForge -[1] TRUE - -$base.url -[1] "http://r-forge.r-project.org/scm/viewvc.php/*checkout*/pkg/" - -$addRset -[1] TRUE - -$addRdset -[1] TRUE - -$addRinset -[1] TRUE - -$addRoutset -[1] TRUE - -$addRcodeset -[1] TRUE - -$fileCommand -[1] "\\def\\file#1{{\\tt #1}}" - -$pkgCommand -[1] "\\def\\pkg#1{{\\tt \"#1\"}}" - -> SweaveListingOptions("Rout") -$Rout -$Rout$fancyvrb -[1] "false" - -$Rout$basicstyle -[1] "\\color{Routcolor}\\small" - - -> SweaveListingOptions("Rout" = c(0,0,0)) -> # or -> SweaveListingOptions(Rout = c(0,1,0)) -> getSweaveListingOption("Rout") -[1] 0 1 0 -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("SweaveListingOptions", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("SweaveListingPreparations") -> ### * SweaveListingPreparations -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: SweaveListingPreparations -> ### Title: SweaveListingPreparations -> ### Aliases: SweaveListingPreparations -> ### Keywords: utilities -> -> ### ** Examples -> -> SweaveListingPreparations() -%------------------------------------------------------------------------------% -%Preparations for Sweave and Listings -%------------------------------------------------------------------------------% -% -\RequirePackage{color} -\definecolor{Rcolor}{rgb}{0, 0.5, 0.5} -\definecolor{RRecomdcolor}{rgb}{0, 0.6, 0.4} -\definecolor{Rbcolor}{rgb}{0, 0.6, 0.6} -\definecolor{Routcolor}{rgb}{0.461, 0.039, 0.102} -\definecolor{Rcommentcolor}{rgb}{0.101, 0.043, 0.432} -%------------------------------------------------------------------------------% -\lstdefinelanguage{Rd}[common]{TeX}% -{moretexcs={acronym,alias,arguments,author,bold,cite,% - code,command,concept,cr,deqn,describe,% - description,details,dfn,doctype,dots,% - dontrun,dontshow,donttest,dQuote,% - email,emph,enc,encoding,enumerate,env,eqn,% - examples,file,format,if,ifelse,item,itemize,kbd,keyword,% - ldots,link,linkS4class,method,name,note,% - option,out,pkg,preformatted,R,Rdopts,Rdversion,% - references,S3method,S4method,Sexpr,samp,section,% - seealso,source,sp,special,sQuote,strong,% - subsection,synopsis,tab,tabular,testonly,% - title,url,usage,value,var,verb}, - sensitive=true,% - morecomment=[l]\%% 2008/9 Peter Ruckdeschel -}[keywords,comments]%% -%------------------------------------------------------------------------------% - -%---------------- -\lstdefinestyle{RstyleO1}{fancyvrb=true,escapechar=`,extendedchars=false,% - language=R,% - basicstyle={\color{Rcolor}\small},% - keywordstyle={\bf\color{Rcolor}},%Warning in print.taglist(taglist, LineLength = LineLength, offset.start = nchar(startS), : - Some elements of taglist are too long - - commentstyle={\color{Rcommentcolor}\ttfamily\itshape},% - literate={"}{\texttt{"}}1{<-}{{$\leftarrow$}}2{<<-}{{$\twoheadleftarrow$}}2{~}{{$\sim$}}1{<=}{{$\leq$}}2{>=}{{$\geq$}}2{^}{{$\scriptstyle\wedge$}}1,% - alsoother={$},% - alsoletter={.<-},% - otherkeywords={!,!=,~,$,*,\&,\%/\%,\%*\%,\%\%,<-,<<-,/},% - escapeinside={(*}{*)}}% -%---------------- -\lstdefinestyle{Rstyle}{style=RstyleO1} - -%---------------- -\lstdefinestyle{Rdstyle}{fancyvrb=true,language=Rd,keywordstyle={\bf},% - basicstyle={\color{black}\footnotesize},% - commentstyle={\ttfamily\itshape},% - alsolanguage=R}% -%---------------- -%------------------------------------------------------------------------------% -\global\def\Rlstset{\lstset{style=Rstyle}}% -\global\def\Rdlstset{\lstset{style=Rdstyle}}% -%------------------------------------------------------------------------------% -\global\def\Rinlstset{\lstset{style=Rinstyle}}% -\global\def\Routlstset{\lstset{style=Routstyle}}% -\global\def\Rcodelstset{\lstset{style=Rcodestyle}}% -%------------------------------------------------------------------------------% -\Rlstset -%------------------------------------------------------------------------------% -%copying relevant parts of Sweave.sty -%------------------------------------------------------------------------------% -% -\RequirePackage{graphicx,fancyvrb}% -\IfFileExists{upquote.sty}{\RequirePackage{upquote}}{}% - -\RequirePackage{ifthen}% -\newboolean{Sweave at gin}% -\setboolean{Sweave at gin}{true}% -\setkeys{Gin}{width=0.8\textwidth}% -\newboolean{Sweave at ae} -\setboolean{Sweave at ae}{true}% -\RequirePackage[T1]{fontenc} -\RequirePackage{ae} -% -\newenvironment{Schunk}{}{} - -\newcommand{\Sconcordance}[1]{% -\ifx\pdfoutput\undefined% -\csname newcount\endcsname\pdfoutput\fi% -\ifcase\pdfoutput\special{#1}% -\else\immediate\pdfobj{#1}\fi} - -%------------------------------------------------------------------------------% -% ---- end of parts of Sweave.sty -%------------------------------------------------------------------------------% -% -% ---- input -\lstdefinestyle{RinstyleO}{style=Rstyle,fancyvrb=true,% - basicstyle=\color{Rcolor}\small}% -\lstdefinestyle{Rinstyle}{style=RinstyleO} -\lstnewenvironment{Sinput}{\Rinlstset}{\Rlstset} -% -% ---- output -\lstdefinestyle{RoutstyleO}{ -V1=0,V2=1,V3=0}% -\lstdefinestyle{Routstyle}{style=RoutstyleO} -\lstnewenvironment{Soutput}{\Routlstset}{\Rlstset} -% -% ---- code -\lstdefinestyle{RcodestyleO}{style=Rstyle,fancyvrb=true,fontshape=sl,% - basicstyle=\color{Rcolor}}% -\lstdefinestyle{Rcodestyle}{style=RcodestyleO} -\lstnewenvironment{Scode}{\Rcodelstset}{\Rlstset} -% -%------------------------------------------------------------------------------% -\let\code\lstinline -\def\Code#1{{\tt\color{Rcolor} #1}} -\def\file#1{{\tt #1}} -\def\pkg#1{{\tt "#1"}} -\newcommand{\pkgversion}{{\tt 2.5.2}} -%------------------------------------------------------------------------------% -Warning in setBaseOrRecommended(pkgs = pkgs) : - number of items to replace is not a multiple of replacement length - -\lstdefinestyle{RstyleO2}{style=RstyleO1,% -% -------------------------- -% Registration of package SweaveListingUtils -% -------------------------- -morekeywords={[2]taglist,setToBeDefinedPkgs,setBaseOrRecommended,readSourceFromRForge,readPkgVersion,% -lstsetRout,lstsetRin,lstsetRd,lstsetRcode,lstsetRall,% -lstsetR,lstsetLanguage,lstset,lstinputSourceFromRForge,lstdefRstyle,% -isBaseOrRecommended,getSweaveListingOption,copySourceFromRForge,changeKeywordstyles,SweaveListingoptions,% -SweaveListingPreparations,SweaveListingOptions,SweaveListingMASK% -},% -keywordstyle={[2]{\bf}},% -% -% -------------------------- -% Registration of package startupmsg -% -------------------------- -morekeywords={[3]suppressStartupMessages,startupType,startupPackage,startupMessage,startupEndline,% -readVersionInformation,readURLInformation,pointertoNEWS,onlytypeStartupMessages,mystartupMessage,% -mySMHandler,infoShow,buildStartupMessage,TOBEDONE,StartupMessage,% -NEWS% -},% -keywordstyle={[3]{\bf}},% -% -% -------------------------- -% Registration of package stats [recommended or base] -% -------------------------- -morekeywords={[4]xtabs,write.ftable,window<-,wilcox.test,weighted.residuals,% -weighted.mean,vcov,varimax,variable.names,var.test,% -update.formula,update.default,tsp<-,tsdiag,tsSmooth,% -ts.union,ts.plot,ts.intersect,toeplitz,terms.terms,% -terms.formula,terms.default,terms.aovlist,termplot,t.test,% -supsmu,summary.stepfun,summary.mlm,summary.manova,summary.lm,% -summary.infl,summary.glm,summary.aovlist,summary.aov,stl,% -stepfun,stat.anova,splinefunH,spectrum,spec.taper,% -spec.pgram,spec.ar,sortedXyData,smoothEnds,smooth.spline,% -smooth,simulate,shapiro.test,setNames,selfStart,% -se.contrast,screeplot,scatter.smooth,runmed,rstudent.lm,% -rstudent.glm,rstandard.lm,rstandard.glm,rmultinom,residuals.lm,% -residuals.glm,residuals.default,reshape,reorder,rect.hclust,% -read.ftable,rWishart,r2dtable,quasipoisson,quasibinomial,% -quantile.default,quade.test,qqnorm.default,qbirthday,prop.trend.test,% -prop.test,promax,printCoefmat,print.ts,print.terms,% -print.logLik,print.lm,print.integrate,print.infl,print.glm,% -print.ftable,print.formula,print.family,print.density,print.anova,% -princomp,predict.poly,predict.mlm,predict.lm,predict.glm,% -prcomp,ppr,power.t.test,power.prop.test,power.anova.test,% -polym,poisson.test,plot.ts,plot.stepfun,plot.spec.phase,% -plot.spec.coherency,plot.spec,plot.mlm,plot.lm,plot.ecdf,% -plot.density,plot.TukeyHSD,plclust,pbirthday,pairwise.wilcox.test,% -pairwise.table,pairwise.t.test,pairwise.prop.test,pacf,p.adjust.methods,% -p.adjust,order.dendrogram,optimHess,oneway.test,numericDeriv,% -nobs,nls.control,nls,nlminb,naresid,% -naprint,napredict,na.pass,na.omit,na.fail,% -na.exclude,na.contiguous,na.action,mood.test,monthplot,% -model.weights,model.tables,model.response,model.offset,model.matrix.lm,% -model.matrix.default,model.matrix,model.frame.lm,model.frame.glm,model.frame.default,% -model.frame.aovlist,model.frame,model.extract,medpolish,median.default,% -mcnemar.test,mauchly.test,mantelhaen.test,manova,makepredictcall,% -makeARIMA,make.link,ls.print,ls.diag,logLik,% -loess.smooth,loess.control,loess,loadings,lm.wfit,% -lm.influence,lm.fit,lines.ts,line,lag.plot,% -lag,ksmooth,ks.test,kruskal.test,knots,% -kmeans,kernel,kernapply,isoreg,is.tskernel,% -is.ts,is.stepfun,is.mts,is.leaf,is.empty.model,% -inverse.gaussian,interaction.plot,integrate,influence.measures,heatmap,% -hclust,hatvalues.lm,hatvalues,glm.fit,glm.control,% -get_all_vars,getInitial,getCall,friedman.test,fligner.test,% -fitted.values,fisher.test,filter,factor.scope,factanal,% -expand.model.frame,estVar,embed,eff.aovlist,ecdf,% -dummy.coef,drop.terms,drop.scope,dmultinom,dist,% -diffinv,diff.ts,dfbeta,df.residual,df.kernel,% -deriv3.formula,deriv3.default,deriv3,deriv.formula,deriv.default,% -density.default,dendrapply,delete.response,decompose,cutree,% -cpgram,cov2cor,cov.wt,cor.test,cophenetic,% -cooks.distance,contrasts<-,contr.treatment,contr.sum,contr.poly,% -contr.helmert,contr.SAS,constrOptim,confint.default,confint,% -complete.cases,cmdscale,chisq.test,ccf,case.names,% -cancor,bw.ucv,bw.nrd0,bw.nrd,bw.bcv,% -bw.SJ,biplot,binom.test,bartlett.test,bandwidth.kernel,% -asOneSidedFormula,as.ts,as.stepfun,as.hclust,as.formula,% -as.dist,as.dendrogram,arima0.diag,arima0,arima.sim,% -arima,ar.yw,ar.ols,ar.mle,ar.burg,% -ar,ansari.test,anova.mlm,anova.lmlist,anova.lm,% -anova.glmlist,anova.glm,aggregate.ts,aggregate.default,aggregate.data.frame,% -addmargins,add.scope,acf2AR,acf,TukeyHSD.aov,% -TukeyHSD,StructTS,SSweibull,SSmicmen,SSlogis,% -SSgompertz,SSfpl,SSfol,SSbiexp,SSasympOrig,% -SSasympOff,SSasymp,SSD,PP.test,NLSstRtAsymptote,% -NLSstLfAsymptote,NLSstClosestX,NLSstAsymptotic,KalmanSmooth,KalmanRun,% -KalmanLike,KalmanForecast,HoltWinters,Box.test,BIC,% -ARMAtoMA,ARMAacf,AIC% -},% -keywordstyle={[4]{\bf\color{RRecomdcolor}}},% -% -% -------------------------- -% Registration of package graphics [recommended or base] -% -------------------------- -morekeywords={[5]xspline,text.default,stripchart,strheight,split.screen,% -spineplot,smoothScatter,rasterImage,polypath,points.default,% -plot.xy,plot.window,plot.new,plot.function,plot.design,% -plot.default,pie,panel.smooth,pairs.default,lines.default,% -layout.show,image.default,hist.default,grconvertY,grconvertX,% -fourfoldplot,filled.contour,erase.screen,dotchart,contour.default,% -co.intervals,close.screen,clip,cdplot,boxplot.matrix,% -boxplot.default,barplot.default,axis.POSIXct,axis.Date,axTicks,% -assocplot,Axis% -},% -keywordstyle={[5]{\bf\color{RRecomdcolor}}},% -% -% -------------------------- -% Registration of package grDevices [recommended or base] -% -------------------------- -morekeywords={[6]xyz.coords,xyTable,xy.coords,xfig,windowsFonts,% -windowsFont,windows.options,windows,win.print,win.metafile,% -win.graph,trans3d,topo.colors,tiff,terrain.colors,% -svg,setPS,setGraphicsEventHandlers,setGraphicsEventEnv,setEPS,% -savePlot,rgb2hsv,replayPlot,recordPlot,recordGraphics,% -ps.options,postscriptFonts,png,pdfFonts,pdf.options,% -pdf,nclass.scott,nclass.Sturges,nclass.FD,n2mfrow,% -msgWindow,make.rgb,jpeg,is.raster,heat.colors,% -hcl,grey.colors,gray.colors,graphics.off,getGraphicsEventEnv,% -getGraphicsEvent,extendrange,embedFonts,deviceIsInteractive,devAskNewPage,% -dev.size,dev.set,dev.print,dev.prev,dev.off,% -dev.next,dev.new,dev.list,dev.interactive,dev.hold,% -dev.flush,dev.cur,dev.copy2pdf,dev.copy2eps,dev.copy,% -dev.control,dev.capture,dev.capabilities,densCols,convertColor,% -contourLines,colorspaces,colorRampPalette,colorRamp,colorConverter,% -col2rgb,cm.colors,check.options,cairo_ps,cairo_pdf,% -bringToTop,boxplot.stats,bmp,blues9,bitmap,% -axisTicks,as.raster,as.graphicsAnnot,adjustcolor,Type1Font,% -Hershey,CIDFont% -},% -keywordstyle={[6]{\bf\color{RRecomdcolor}}},% -% -% -------------------------- -% Registration of package utils [recommended or base] -% -------------------------- -morekeywords={[7]zip.unpack,writeClipboard,write.table,write.socket,write.csv2,% -write.csv,winProgressBar,winMenuNames,winMenuItems,winMenuDelItem,% -winMenuDel,winMenuAddItem,winMenuAdd,winDialogString,winDialog,% -win.version,vignette,url.show,upgrade,update.packages,% -update.packageStatus,unzip,untar,unstack,type.convert,% -txtProgressBar,toLatex,toBibtex,timestamp,tar,% -tail.matrix,tail,summaryRprof,strOptions,str,% -stack,shortPathName,setWindowTitle,setWinProgressBar,setTxtProgressBar,% -setStatusBar,setRepositories,setInternet2,setBreakpoint,sessionInfo,% -select.list,savehistory,rtags,removeSource,remove.packages,% -relist,recover,readRegistry,readClipboard,readCitationFile,% -read.table,read.socket,read.fwf,read.fortran,read.delim2,% -read.delim,read.csv2,read.csv,read.DIF,rc.status,% -rc.settings,rc.options,rc.getOption,promptPackage,promptData,% -process.events,personList,person,packageVersion,packageStatus,% -packageName,packageDescription,package.skeleton,old.packages,object.size,% -news,new.packages,modifyList,mirror2html,memory.size,% -memory.limit,makeRweaveLatexCodeRunner,make.socket,make.packages.html,maintainer,% -lsf.str,ls.str,localeToCharset,loadhistory,loadRconsole,% -limitedLabels,is.relistable,installed.packages,install.packages,history,% -help.start,help.search,help.request,head.matrix,head,% -globalVariables,glob2rx,getWindowsHandles,getWindowsHandle,getWindowTitle,% -getWinProgressBar,getTxtProgressBar,getSrcref,getSrcLocation,getSrcFilename,% -getSrcDirectory,getS3method,getParseText,getParseData,getIdentification,% -getFromNamespace,getClipboardFormats,getCRANmirrors,getAnywhere,formatUL,% -formatOL,flush.console,fixInNamespace,findLineNum,file_test,% -file.edit,dump.frames,download.packages,download.file,de.setup,% -de.restore,de.ncols,data.entry,create.post,count.fields,% -contrib.url,compareVersion,combn,close.socket,citeNatbib,% -cite,citation,citHeader,citFooter,citEntry,% -chooseCRANmirror,chooseBioCmirror,choose.files,choose.dir,checkCRAN,% -capture.output,bug.report,browseVignettes,browseURL,browseEnv,% -bibentry,available.packages,assignInNamespace,assignInMyNamespace,aspell_write_personal_dictionary_file,% -aspell_package_vignettes,aspell_package_Rd_files,aspell_package_R_files,aspell_package_C_files,aspell,% -as.roman,as.relistable,as.personList,as.person,arrangeWindows,% -argsAnywhere,aregexec,alarm,adist,View,% -URLencode,URLdecode,SweaveSyntaxNoweb,SweaveSyntaxLatex,SweaveSyntConv,% -SweaveHooks,Sweave,Stangle,RweaveTryStop,RweaveLatexWritedoc,% -RweaveLatexSetup,RweaveLatexOptions,RweaveLatexFinish,RweaveLatex,RweaveEvalWithOpt,% -RweaveChunkPrefix,RtangleWritedoc,RtangleSetup,Rtangle,Rprofmem,% -Rprof,RSiteSearch,RShowDoc,Filters,DLL.version,% -CRAN.packages% -},% -keywordstyle={[7]{\bf\color{RRecomdcolor}}},% -% -% -------------------------- -% Registration of package datasets [recommended or base] -% -------------------------- -morekeywords={[8]women,warpbreaks,volcano,uspop,trees,% -treering,swiss,sunspots,sunspot.year,sunspot.month,% -state.x77,state.region,state.name,state.division,state.center,% -state.area,state.abb,stackloss,stack.x,stack.loss,% -sleep,rock,rivers,randu,quakes,% -pressure,presidents,precip,occupationalStatus,npk,% -nottem,nhtemp,mtcars,morley,mdeaths,% -lynx,longley,lh,ldeaths,islands,% -iris3,iris,infert,freeny.y,freeny.x,% -freeny,fdeaths,faithful,eurodist,euro.cross,% -euro,esoph,discoveries,crimtab,co2,% -chickwts,cars,beaver2,beaver1,austres,% -attitude,attenu,anscombe,airquality,airmiles,% -ability.cov,WorldPhones,WWWusage,VADeaths,USPersonalExpenditure,% -USJudgeRatings,USArrests,USAccDeaths,UKgas,UKDriverDeaths,% -UCBAdmissions,ToothGrowth,Titanic,Theoph,Seatbelts,% -Puromycin,PlantGrowth,OrchardSprays,Orange,Nile,% -Loblolly,LifeCycleSavings,LakeHuron,JohnsonJohnson,InsectSprays,% -Indometh,Harman74.cor,Harman23.cor,HairEyeColor,Formaldehyde,% -EuStockMarkets,DNase,ChickWeight,CO2,BOD,% -BJsales.lead,BJsales,AirPassengers% -},% -keywordstyle={[8]{\bf\color{RRecomdcolor}}},% -% -% -------------------------- -% Registration of package methods [recommended or base] -% -------------------------- -morekeywords={[9]validSlotNames,validObject,unRematchDefinition,tryNew,traceOn,% -traceOff,testVirtual,testInheritedMethods,superClassDepth,substituteFunctionArgs,% -substituteDirect,slotsFromS3,slotNames,slot<-,slot,% -signature,sigToEnv,showMlist,showMethods,showExtends,% -showDefault,showClass,setValidity,setReplaceMethod,setRefClass,% -setPrimitiveMethods,setPackageName,setOldClass,setMethod,setLoadActions,% -setLoadAction,setIs,setGroupGeneric,setGenericImplicit,setGeneric,% -setDataPart,setClassUnion,setClass,setAs,selectSuperClasses,% -selectMethod,seemsS4Object,sealClass,resetGeneric,resetClass,% -requireMethods,representation,removeMethodsObject,removeMethods,removeMethod,% -removeGeneric,removeClass,rematchDefinition,registerImplicitGenerics,reconcilePropertiesAndPrototype,% -rbind2,prototype,promptMethods,promptClass,prohibitGeneric,% -possibleExtends,packageSlot<-,packageSlot,newEmptyObject,newClassRepresentation,% -newBasic,multipleClasses,mlistMetaName,missingArg,methodsPackageMetaName,% -methodSignatureMatrix,method.skeleton,metaNameUndo,mergeMethods,matchSignature,% -makeStandardGeneric,makePrototypeFromClassDef,makeMethodsList,makeGeneric,makeExtends,% -makeClassRepresentation,loadMethod,listFromMlist,listFromMethods,linearizeMlist,% -languageEl<-,languageEl,isXS3Class,isVirtualClass,isSealedMethod,% -isSealedClass,isGroup,isGrammarSymbol,isGeneric,isClassUnion,% -isClassDef,isClass,insertSource,insertMethod,insertClassMethods,% -initialize,initRefFields,initFieldArgs,inheritedSlotNames,implicitGeneric,% -hasMethods,hasMethod,hasLoadAction,hasArg,getVirtual,% -getValidity,getSubclasses,getSlots,getRefClass,getPrototype,% -getProperties,getPackageName,getMethodsMetaData,getMethodsForDispatch,getMethods,% -getMethod,getLoadActions,getGroupMembers,getGroup,getGenerics,% -getGeneric,getFunction,getExtends,getDataPart,getClasses,% -getClassPackage,getClassName,getClassDef,getClass,getAllSuperClasses,% -getAllMethods,getAccess,generic.skeleton,functionBody<-,functionBody,% -formalArgs,fixPre1.8,findUnique,findMethods,findMethodSignatures,% -findMethod,findFunction,findClass,finalDefaultMethod,extends,% -existsMethod,existsFunction,evalqOnLoad,evalSource,evalOnLoad,% -emptyMethodsList,empty.dump,elNamed<-,elNamed,el<-,% -el,dumpMethods,dumpMethod,doPrimitiveMethod,defaultPrototype,% -defaultDumpName,conformMethod,completeSubclasses,completeExtends,completeClassDefinition,% -coerce<-,coerce,classesToAM,className,classMetaName,% -classLabel,checkSlotAssignment,checkAtAssignment,cbind2,canCoerce,% -callNextMethod,callGeneric,cacheMethod,cacheMetaData,cacheGenericsMetaData,% -body<-,balanceMethodsList,assignMethodsMetaData,assignClassDef,asMethodDefinition,% -as<-,allNames,allGenerics,addNextMethod,Summary,% -SignatureMethod,S3Part<-,S3Part,S3Class<-,S3Class,% -Quote,MethodsListSelect,MethodsList,MethodAddCoerce,Math2,% -Logic,Complex,Compare,Arith% -},% -keywordstyle={[9]{\bf\color{RRecomdcolor}}},% -% -% -------------------------- -% Registration of package base [recommended or base] -% -------------------------- -morekeywords={[10]xzfile,xtfrm.numeric_version,xtfrm.factor,xtfrm.difftime,xtfrm.default,% -xtfrm.Surv,xtfrm.POSIXlt,xtfrm.POSIXct,xtfrm.Date,xtfrm.AsIs,% -xtfrm,xpdrows.data.frame,xor.octmode,xor.hexmode,writeLines,% -writeChar,writeBin,write.dcf,within.list,within.data.frame,% -within,withVisible,withRestarts,withCallingHandlers,with.default,% -with,which.min,which.max,weekdays.POSIXt,weekdays.Date,% -weekdays,version,vapply,utf8ToInt,upper.tri,% -unz,untracemem,unsplit,unserialize,unlockBinding,% -unloadNamespace,unix.time,units<-.difftime,units<-,units.difftime,% -units,unique.numeric_version,unique.matrix,unique.default,unique.data.frame,% -unique.array,unique.POSIXlt,tryCatch,truncate.connection,truncate,% -trunc.POSIXt,trunc.Date,transform.default,transform.data.frame,tracingState,% -tracemem,toupper,topenv,tolower,toString.default,% -toString,textConnectionValue,textConnection,testPlatformEquivalence,tempdir,% -tcrossprod,taskCallbackManager,t.default,t.data.frame,system2,% -system.time,system.file,sys.status,sys.source,sys.save.image,% -sys.parents,sys.parent,sys.on.exit,sys.nframe,sys.load.image,% -sys.function,sys.frames,sys.frame,sys.calls,sys.call,% -suppressWarnings,suppressPackageStartupMessages,suppressMessages,summary.table,summary.srcref,% -summary.srcfile,summary.proc_time,summary.matrix,summary.factor,summary.default,% -summary.data.frame,summary.connection,summary.POSIXlt,summary.POSIXct,summary.Date,% -substring<-,substr<-,subset.matrix,subset.default,subset.data.frame,% -strwrap,strtrim,strtoi,strptime,strftime,% -storage.mode<-,storage.mode,stopifnot,stdout,stdin,% -stderr,standardGeneric,srcref,srcfilecopy,srcfilealias,% -srcfile,sprintf,split<-.default,split<-.data.frame,split<-,% -split.default,split.data.frame,split.POSIXct,split.Date,sort.list,% -sort.int,sort.default,sort.POSIXlt,solve.qr,solve.default,% -socketSelect,socketConnection,slice.index,sink.number,simplify2array,% -simpleWarning,simpleMessage,simpleError,simpleCondition,signalCondition,% -showConnections,shell.exec,shell,shQuote,setTimeLimit,% -setSessionTimeLimit,setNamespaceInfo,setHook,set.seed,serialize,% -seq_len,seq_along,seq.int,seq.default,seq.POSIXt,% -seq.Date,seek.connection,seek,scale.default,saveRDS,% -save.image,sample.int,sQuote,rowsum.default,rowsum.data.frame,% -rownames<-,rowSums,rowMeans,row.names<-.default,row.names<-.data.frame,% -row.names<-,row.names.default,row.names.data.frame,row.names,round.POSIXt,% -round.Date,rev.default,retracemem,restartFormals,restartDescription,% -requireNamespace,replicate,rep_len,rep.numeric_version,rep.int,% -rep.factor,rep.POSIXlt,rep.POSIXct,rep.Date,removeTaskCallback,% -regmatches<-,regmatches,registerS3methods,registerS3method,regexec,% -reg.finalizer,readRenviron,readRDS,readLines,readChar,% -readBin,read.dcf,rcond,rbind.data.frame,rawToChar,% -rawToBits,rawShift,rawConnectionValue,rawConnection,raw,% -rapply,range.default,quarters.POSIXt,quarters.Date,quarters,% -qr.solve,qr.resid,qr.qy,qr.qty,qr.fitted,% -qr.default,qr.coef,qr.X,qr.R,qr.Q,% -pushBackLength,pushBack,psigamma,provideDimnames,prop.table,% -proc.time,print.warnings,print.table,print.summaryDefault,print.summary.table,% -print.srcref,print.srcfile,print.simple.list,print.rle,print.restart,% -print.proc_time,print.packageInfo,print.octmode,print.numeric_version,print.noquote,% [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/distr -r 999 From noreply at r-forge.r-project.org Sun May 3 06:30:51 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 06:30:51 +0200 (CEST) Subject: [Distr-commits] r1000 - branches/distr-2.6/pkg/SweaveListingUtils Message-ID: <20150503043051.AA448187CB7@r-forge.r-project.org> Author: stamats Date: 2015-05-03 06:30:50 +0200 (Sun, 03 May 2015) New Revision: 1000 Modified: branches/distr-2.6/pkg/SweaveListingUtils/DESCRIPTION Log: minor change of Title and Description due to warning during check Modified: branches/distr-2.6/pkg/SweaveListingUtils/DESCRIPTION =================================================================== --- branches/distr-2.6/pkg/SweaveListingUtils/DESCRIPTION 2015-05-03 04:26:08 UTC (rev 999) +++ branches/distr-2.6/pkg/SweaveListingUtils/DESCRIPTION 2015-05-03 04:30:50 UTC (rev 1000) @@ -1,6 +1,6 @@ Package: SweaveListingUtils -Title: Utilities for Sweave Together with TeX listings Package -Description: provides utilities for defining R / Rd as Tex-package-listings "language" and +Title: Utilities for Sweave Together with TeX 'listings' Package +Description: Provides utilities for defining R / Rd as Tex-package-listings "language" and including R / Rd source file (sniplets) copied from R-forge in its most recent version (or another url) thereby avoiding inconsistencies between vignette and documented source code. @@ -11,7 +11,7 @@ ByteCompile: yes Authors at R: person("Peter", "Ruckdeschel", role=c("cre", "cph"), email="Peter.Ruckdeschel at itwm.fraunhofer.de") License: LGPL-3 -Date: 2013-09-18 +Date: 2015-05-03 LastChangedDate: {$LastChangedDate$} LastChangedRevision: {$LastChangedRevision$} SVNRevision: 926 From noreply at r-forge.r-project.org Sun May 3 06:49:04 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 06:49:04 +0200 (CEST) Subject: [Distr-commits] r1001 - branches/distr-2.6/pkg/distr/R Message-ID: <20150503044904.7C0C4187609@r-forge.r-project.org> Author: stamats Date: 2015-05-03 06:49:03 +0200 (Sun, 03 May 2015) New Revision: 1001 Modified: branches/distr-2.6/pkg/distr/R/DiscreteDistribution.R Log: corrected minor bug if the discrete distribution is a Dirac distribution -> need to call rep instead of sample Modified: branches/distr-2.6/pkg/distr/R/DiscreteDistribution.R =================================================================== --- branches/distr-2.6/pkg/distr/R/DiscreteDistribution.R 2015-05-03 04:30:50 UTC (rev 1000) +++ branches/distr-2.6/pkg/distr/R/DiscreteDistribution.R 2015-05-03 04:49:03 UTC (rev 1001) @@ -1,511 +1,516 @@ -############################################################################### -# Methods for Discrete Distributions -############################################################################### - -## (c) Matthias Kohl: revised P.R. 030707 - -DiscreteDistribution <- function(supp, prob, .withArith = FALSE, - .withSim = FALSE, .lowerExact = TRUE, .logExact = FALSE, - .DistrCollapse = - getdistrOption("DistrCollapse"), - .DistrCollapse.Unique.Warn = - getdistrOption("DistrCollapse.Unique.Warn"), - .DistrResolution = getdistrOption("DistrResolution"), - Symmetry = NoSymmetry()){ - if(!is.numeric(supp)) - stop("'supp' is no numeric vector") - if(any(!is.finite(supp))) # admit +/- Inf? - stop("infinite or missing values in supp") - len <- length(supp) - if(missing(prob)){ - prob <- rep(1/len, len) - }else{ - if(len != length(prob)) - stop("'supp' and 'prob' must have equal lengths") - if(any(!is.finite(prob))) - stop("infinite or missing values in prob") - if(!identical(all.equal(sum(prob), 1, - tolerance = 2*getdistrOption("TruncQuantile")), TRUE)) - stop("sum of 'prob' has to be (approximately) 1") - if(!all(prob >= 0)) - stop("'prob' contains values < 0") - } - - o <- order(supp) - supp <- supp[o] - prob <- prob[o] - rm(o) - - if(.DistrCollapse){ - if (len>1 && min(diff(supp))< .DistrResolution){ - erg <- .DistrCollapse(supp, prob, .DistrResolution) - if (len>length(erg$prob) && .DistrCollapse.Unique.Warn) - warning("collapsing to unique support values") - prob <- erg$prob - supp <- erg$supp - } - }else{ - usupp <- unique(supp) - if(length(usupp) < len){ - if(.DistrCollapse.Unique.Warn) - warning("collapsing to unique support values") - prob <- as.vector(tapply(prob, supp, sum)) - supp <- sort(usupp) - len <- length(supp) - rm(usupp) - } - if(len > 1){ - if(min(diff(supp))< .DistrResolution) - stop("grid too narrow --> change DistrResolution") - } - } - rm(len) - - rfun <- function(n){ - sample(x = supp, size = n, replace = TRUE, prob = prob) - } - - dfun <- .makeDNew(supp, prob, Cont = FALSE) - pfun <- .makePNew(supp, prob, .withSim, Cont = FALSE) - qfun <- .makeQNew(supp, cumsum(prob), rev(cumsum(rev(prob))), - .withSim, min(supp), max(supp), Cont = FALSE) - - object <- new("DiscreteDistribution", r = rfun, d = dfun, q = qfun, p=pfun, - support = supp, .withArith = .withArith, .withSim = .withSim, - .lowerExact = .lowerExact, .logExact = .logExact, Symmetry = Symmetry) -} - - -setMethod("support", "DiscreteDistribution", function(object) object at support) - -### left continuous cdf - -setMethod("p.l", "DiscreteDistribution", function(object){ - if (.inArgs("lower.tail", p(object))){ - function(q, lower.tail = TRUE, log.p = FALSE){ - px <- p(object)(q, lower.tail = lower.tail) - o.warn <- getOption("warn"); - on.exit(options(warn=o.warn)) - options(warn = -2) - dx <- d(object)(.setEqual(q, support(object))) - options(warn = o.warn) - px0 <- pmax(px + if(lower.tail) -dx else dx,0) - if (log.p) px0 <- log(px0) - return(px0) - } - }else{ - function(q, lower.tail = TRUE, log.p = FALSE){ - px <- p(object)(q) - o.warn <- getOption("warn") - on.exit(options(warn=o.warn)) - options(warn = -2) - dx <- d(object)(.setEqual(q, support(object))) - options(warn = o.warn) - px0 <- pmax(if(lower.tail) px - dx else 1 - px + dx, 0) - if (log.p) px0 <- log(px0) - return(px0) - } - } -}) - -### right continuous quantile function - -setMethod("q.r", "DiscreteDistribution", function(object){ - if (.inArgs("log.p", q(object))){ - if (.inArgs("lower.tail", q(object))){ - function(p, lower.tail = TRUE, log.p = FALSE){ - s <- support(object) - psx <- p(object)(s, lower.tail = lower.tail, - log.p = log.p) - ps0 <- .setEqual(p, psx) - - o.warn <- getOption("warn"); options(warn = -2) - on.exit(options(warn=o.warn)) - qx0 <- q(object)(ps0, lower.tail = lower.tail, - log.p = log.p) - options(warn = o.warn) - - m <- match(ps0, psx) - n.ina.m <- !is.na(m) - if(any(n.ina.m)) - { M.n.ina.m <- m[n.ina.m] - qx0[n.ina.m] <- (support(object))[pmin(M.n.ina.m+1, - length(s))] - } - if(any(is.nan(qx0))) - warning("NaN's produced") - return(qx0) - } - }else{ - function(p, lower.tail = TRUE, log.p = FALSE){ - s <- support(object) - psx <- p(object)(s, log.p = log.p) - if (lower.tail) p <- 1 - p - ps0 <- .setEqual(p, psx) - - o.warn <- getOption("warn"); options(warn = -2) - on.exit(options(warn=o.warn)) - qx0 <- q(object)(ps0, lower.tail = lower.tail, - log.p = log.p) - options(warn = o.warn) - - m <- match(ps0, psx) - n.ina.m <- !is.na(m) - if(any(n.ina.m)) - { M.n.ina.m <- m[n.ina.m] - qx0[n.ina.m] <- (support(object))[pmin(M.n.ina.m+1, - length(s))] - } - if(any(is.nan(qx0))) - warning("NaN's produced") - return(qx0) - } - } - }else{ - if (.inArgs("lower.tail", q(object))){ - function(p, lower.tail = TRUE, log.p = FALSE){ - if (log.p) p <- exp(p) - s <- support(object) - psx <- p(object)(s, lower.tail = lower.tail) - ps0 <- .setEqual(p, psx) - - o.warn <- getOption("warn"); options(warn = -2) - on.exit(options(warn=o.warn)) - qx0 <- q(object)(ps0, lower.tail = lower.tail, - log.p = log.p) - options(warn = o.warn) - - m <- match(ps0, psx) - n.ina.m <- !is.na(m) - if(any(n.ina.m)) - { M.n.ina.m <- m[n.ina.m] - qx0[n.ina.m] <- (support(object))[pmin(M.n.ina.m+1, - length(s))] - } - if(any(is.nan(qx0))) - warning("NaN's produced") - return(qx0) - } - }else{ - function(p, lower.tail = TRUE, log.p = FALSE){ - if (log.p) p <- exp(p) - s <- support(object) - psx <- p(object)(s) - if (lower.tail) p <- 1 - p - ps0 <- .setEqual(p, psx) - - o.warn <- getOption("warn"); options(warn = -2) - on.exit(options(warn=o.warn)) - qx0 <- q(object)(ps0, lower.tail = lower.tail, - log.p = log.p) - options(warn = o.warn) - - m <- match(ps0, psx) - n.ina.m <- !is.na(m) - if(any(n.ina.m)) - { M.n.ina.m <- m[n.ina.m] - qx0[n.ina.m] <- (support(object))[pmin(M.n.ina.m+1, - length(s))] - } - if(any(is.nan(qx0))) - warning("NaN's produced") - } - } - } -}) - - - -## Convolution Discrete Distributions - -setMethod("+", c("DiscreteDistribution","DiscreteDistribution"), -function(e1,e2){ - - if(length(support(e1))==1) return(e2+support(e1)) - if(length(support(e2))==1) return(e1+support(e2)) - e1.L <- as(e1, "LatticeDistribution") - e2.L <- as(e2, "LatticeDistribution") - if(is(e1.L, "LatticeDistribution") & is(e2.L, "LatticeDistribution")) - {w1 <- width(lattice(e1.L)) - w2 <- width(lattice(e2.L)) - W <- sort(abs(c(w1,w2))) - if (abs(abs(w1)-abs(w2))=0] - - .lowerExact = .lowerExact(x) - - dxlog <- if("log" %in% names(formals(d(x)))) - quote({dx <- d(xx)(x, log = TRUE)}) - else quote({dx <- log(d(xx)(x))}) - pxlog <- if("log.p" %in% names(formals(p(x))) && - "lower.tail" %in% names(formals(p(x)))) - quote({p(x)(q, lower.tail = FALSE, log.p = TRUE)}) - else - quote({log(1-p(x)(q))}) - - - qxlog <- if("lower.tail" %in% names(formals(q(x)))) - quote({qx <- if(lower.tail) - q(x)((1+p1)/2) - else - q(x)(p1/2,lower.tail=FALSE)}) - else - quote({qx <- q(x)(if(lower.tail) (1+p1)/2 else 1-p1/2)}) - if("lower.tail" %in% names(formals(q(x)))&& - "log.p" %in% names(formals(q(x)))) - qxlog <- quote({qx <- if(lower.tail) q(x)((1+p1)/2) - else - q(x)(if(log.p)p-log(2) - else p1/2,lower.tail=FALSE,log.p=log.p)}) - - - dnew <- function(x, log = FALSE){} - body(dnew) <- substitute({ - dxlog0 - dx[x>0] <- dx+log(2) - if (!log) dx <- exp(dx) - dx[x<0] <- if(log) -Inf else 0 - return(dx) - }, list(dxlog0 = dxlog)) - - pnew <- function(q, lower.tail = TRUE, log.p = FALSE){} - body(pnew) <- substitute({ - if (!lower.tail){ - px <- (log(2) + pxlog0)*(q>=0) - if(!log.p) px <- exp(px) - }else{ - px <- pmax(2 * p(x)(q) - 1,0) - if(log.p) px <- log(px) - } - return(px) - }, list(pxlog0 = pxlog)) - - qnew <- function(p, lower.tail = TRUE, log.p = FALSE){} - body(qnew) <- substitute({ - p1 <- if(log.p) exp(p) else p - qxlog0 - qx[p1<0] <- NaN - if (any((p1 < -.Machine$double.eps)|(p1 > 1+.Machine$double.eps))) - warning(gettextf("q method of %s produced NaN's ", objN)) - return(qx) - }, list(qxlog0 = qxlog, objN= quote(.getObjName(1)))) - - }else{ - if (.isEqual(p.l(x)(0),0)) return(x) - - supportnew <- sort(unique(abs(supportnew))) - - dnew <- function(x, log = FALSE){ - o.warn <- getOption("warn"); options(warn = -1) - on.exit(options(warn=o.warn)) - dx <- (x>=0) * d(xx)(x) + (x>0) * d(xx)(-x) - options(warn = o.warn) - if (log) dx <- log(dx) - return(dx) - } - - pxlow <- if("lower.tail" %in% names(formals(p(x)))) - substitute({p(x)(q, lower=FALSE)}) - else - substitute({1-p(x)(q)}) - - pnew <- function(q, lower.tail = TRUE, log.p = FALSE){} - body(pnew) <- substitute({ - px <- if (lower.tail) - (q>=0) * (p(x)(q) - p.l(x)(-q)) - else pxlow0 + p.l(x)(-q) - if (log.p) px <- log(px) - return(px) - }, list(pxlow0=pxlow)) - - prob <- dnew(supportnew) - - qnew <- .makeQNew(supportnew, cumsum(prob), - rev(cumsum(rev(prob))), notwithLLarg = x at .withSim, - min(supportnew), max(supportnew), Cont = FALSE) - - } - object <- new("DiscreteDistribution", r = rnew, p = pnew, - q = qnew, d = dnew, support = supportnew, - .withSim = x at .withSim, .withArith = TRUE, - .lowerExact = .lowerExact(x)) - object -}) - -## exact: abs for discrete distributions -setMethod("exp", "DiscreteDistribution", - function(x) .expm.d(x)) - - -### preliminary to export special functions -if (getRversion()>='2.6.0'){ - -setMethod("log", "DiscreteDistribution", - function(x, base = exp(1)) { - xs <- as.character(deparse(match.call( - call = sys.call(sys.parent(1)))$x)) - ep <- getdistrOption("TruncQuantile") - basl <- log(base) - if(p(x)(0)>ep) - stop(gettextf("log(%s) is not well-defined with positive probability ", xs)) - else return(.logm.d(x)/basl)}) - -setMethod("log", "Dirac", - function(x, base = exp(1)){ - xs <- as.character(deparse(match.call( - call = sys.call(sys.parent(1)))$x)) - loc <- location(x) - ep <- getdistrOption("TruncQuantile") - basl <- log(base) - if(loc < ep) - stop(gettextf("log(%s) is not well-defined with positive probability ", xs)) - Dirac(log(loc)/basl)}) - -setMethod("log10", "DiscreteDistribution", - function(x) log(x = x, base = 10)) - -setMethod("sign", "DiscreteDistribution", - function(x){ - d0 <- d(x)(0) - DiscreteDistribution(supp=c(-1,0,1), - prob=c(p(x)(-getdistrOption("TruncQuantile")), - d0, - p(x)(getdistrOption("TruncQuantile"), lower=FALSE))) - }) - - -setMethod("digamma", "DiscreteDistribution", - function(x){ - px0 <- p(x)(0) - if(px0>0) stop("argument of 'digamma' must be concentrated on positive values") - rnew <- function(n, ...){} - body(rnew) <- substitute({ digamma(g(n, ...)) }, list(g = x at r)) - - object <- DiscreteDistribution( - supp=digamma(support(x)), - prob=prob(x), .withArith = TRUE) - object - }) - -setMethod("lgamma", "DiscreteDistribution", - function(x){ - rnew = function(n, ...){} - body(rnew) <- substitute({ lgamma(g(n, ...)) }, list(g = x at r)) - object <- new("DiscreteDistribution", r = rnew, - .withSim = TRUE, .withArith = TRUE) - object - }) - -setMethod("gamma", "DiscreteDistribution", - function(x){ - rnew = function(n, ...){} - body(rnew) <- substitute({ gamma(g(n, ...)) }, list(g = x at r)) - object <- new("DiscreteDistribution", r = rnew, - .withSim = TRUE, .withArith = TRUE) - object - }) -setMethod("sqrt", "DiscreteDistribution", - function(x) x^0.5) - -} -setMethod("prob", "DiscreteDistribution", -function(object) {sp <- object at support - pr <- object at d(sp) - names(pr) <- paste(sp) - return(pr) - }) -## Replace Methods -setReplaceMethod("prob", "DiscreteDistribution", - function(object, value){ - return(DiscreteDistribution(supp = object at support, - prob = value, - .withArith = object at .withArith, - .withSim = object at .withSim, - .lowerExact = .lowerExact(object), - .logExact = .logExact(object)))} - ) - - - \ No newline at end of file +############################################################################### +# Methods for Discrete Distributions +############################################################################### + +## (c) Matthias Kohl: revised P.R. 030707 + +DiscreteDistribution <- function(supp, prob, .withArith = FALSE, + .withSim = FALSE, .lowerExact = TRUE, .logExact = FALSE, + .DistrCollapse = + getdistrOption("DistrCollapse"), + .DistrCollapse.Unique.Warn = + getdistrOption("DistrCollapse.Unique.Warn"), + .DistrResolution = getdistrOption("DistrResolution"), + Symmetry = NoSymmetry()){ + if(!is.numeric(supp)) + stop("'supp' is no numeric vector") + if(any(!is.finite(supp))) # admit +/- Inf? + stop("infinite or missing values in supp") + len <- length(supp) + if(missing(prob)){ + prob <- rep(1/len, len) + }else{ + if(len != length(prob)) + stop("'supp' and 'prob' must have equal lengths") + if(any(!is.finite(prob))) + stop("infinite or missing values in prob") + if(!identical(all.equal(sum(prob), 1, + tolerance = 2*getdistrOption("TruncQuantile")), TRUE)) + stop("sum of 'prob' has to be (approximately) 1") + if(!all(prob >= 0)) + stop("'prob' contains values < 0") + } + + o <- order(supp) + supp <- supp[o] + prob <- prob[o] + rm(o) + + if(.DistrCollapse){ + if (len>1 && min(diff(supp))< .DistrResolution){ + erg <- .DistrCollapse(supp, prob, .DistrResolution) + if (len>length(erg$prob) && .DistrCollapse.Unique.Warn) + warning("collapsing to unique support values") + prob <- erg$prob + supp <- erg$supp + } + }else{ + usupp <- unique(supp) + if(length(usupp) < len){ + if(.DistrCollapse.Unique.Warn) + warning("collapsing to unique support values") + prob <- as.vector(tapply(prob, supp, sum)) + supp <- sort(usupp) + len <- length(supp) + rm(usupp) + } + if(len > 1){ + if(min(diff(supp))< .DistrResolution) + stop("grid too narrow --> change DistrResolution") + } + } + rm(len) + + if(length(supp) == 1){ + rfun <- function(n){ + rep(supp, n) + } + }else{ + rfun <- function(n){ + sample(x = supp, size = n, replace = TRUE, prob = prob) + } + } + + dfun <- .makeDNew(supp, prob, Cont = FALSE) + pfun <- .makePNew(supp, prob, .withSim, Cont = FALSE) + qfun <- .makeQNew(supp, cumsum(prob), rev(cumsum(rev(prob))), + .withSim, min(supp), max(supp), Cont = FALSE) + + object <- new("DiscreteDistribution", r = rfun, d = dfun, q = qfun, p=pfun, + support = supp, .withArith = .withArith, .withSim = .withSim, + .lowerExact = .lowerExact, .logExact = .logExact, Symmetry = Symmetry) +} + + +setMethod("support", "DiscreteDistribution", function(object) object at support) + +### left continuous cdf + +setMethod("p.l", "DiscreteDistribution", function(object){ + if (.inArgs("lower.tail", p(object))){ + function(q, lower.tail = TRUE, log.p = FALSE){ + px <- p(object)(q, lower.tail = lower.tail) + o.warn <- getOption("warn"); + on.exit(options(warn=o.warn)) + options(warn = -2) + dx <- d(object)(.setEqual(q, support(object))) + options(warn = o.warn) + px0 <- pmax(px + if(lower.tail) -dx else dx,0) + if (log.p) px0 <- log(px0) + return(px0) + } + }else{ + function(q, lower.tail = TRUE, log.p = FALSE){ + px <- p(object)(q) + o.warn <- getOption("warn") + on.exit(options(warn=o.warn)) + options(warn = -2) + dx <- d(object)(.setEqual(q, support(object))) + options(warn = o.warn) + px0 <- pmax(if(lower.tail) px - dx else 1 - px + dx, 0) + if (log.p) px0 <- log(px0) + return(px0) + } + } +}) + +### right continuous quantile function + +setMethod("q.r", "DiscreteDistribution", function(object){ + if (.inArgs("log.p", q(object))){ + if (.inArgs("lower.tail", q(object))){ + function(p, lower.tail = TRUE, log.p = FALSE){ + s <- support(object) + psx <- p(object)(s, lower.tail = lower.tail, + log.p = log.p) + ps0 <- .setEqual(p, psx) + + o.warn <- getOption("warn"); options(warn = -2) + on.exit(options(warn=o.warn)) + qx0 <- q(object)(ps0, lower.tail = lower.tail, + log.p = log.p) + options(warn = o.warn) + + m <- match(ps0, psx) + n.ina.m <- !is.na(m) + if(any(n.ina.m)) + { M.n.ina.m <- m[n.ina.m] + qx0[n.ina.m] <- (support(object))[pmin(M.n.ina.m+1, + length(s))] + } + if(any(is.nan(qx0))) + warning("NaN's produced") + return(qx0) + } + }else{ + function(p, lower.tail = TRUE, log.p = FALSE){ + s <- support(object) + psx <- p(object)(s, log.p = log.p) + if (lower.tail) p <- 1 - p + ps0 <- .setEqual(p, psx) + + o.warn <- getOption("warn"); options(warn = -2) + on.exit(options(warn=o.warn)) + qx0 <- q(object)(ps0, lower.tail = lower.tail, + log.p = log.p) + options(warn = o.warn) + + m <- match(ps0, psx) + n.ina.m <- !is.na(m) + if(any(n.ina.m)) + { M.n.ina.m <- m[n.ina.m] + qx0[n.ina.m] <- (support(object))[pmin(M.n.ina.m+1, + length(s))] + } + if(any(is.nan(qx0))) + warning("NaN's produced") + return(qx0) + } + } + }else{ + if (.inArgs("lower.tail", q(object))){ + function(p, lower.tail = TRUE, log.p = FALSE){ + if (log.p) p <- exp(p) + s <- support(object) + psx <- p(object)(s, lower.tail = lower.tail) + ps0 <- .setEqual(p, psx) + + o.warn <- getOption("warn"); options(warn = -2) + on.exit(options(warn=o.warn)) + qx0 <- q(object)(ps0, lower.tail = lower.tail, + log.p = log.p) + options(warn = o.warn) + + m <- match(ps0, psx) + n.ina.m <- !is.na(m) + if(any(n.ina.m)) + { M.n.ina.m <- m[n.ina.m] + qx0[n.ina.m] <- (support(object))[pmin(M.n.ina.m+1, + length(s))] + } + if(any(is.nan(qx0))) + warning("NaN's produced") + return(qx0) + } + }else{ + function(p, lower.tail = TRUE, log.p = FALSE){ + if (log.p) p <- exp(p) + s <- support(object) + psx <- p(object)(s) + if (lower.tail) p <- 1 - p + ps0 <- .setEqual(p, psx) + + o.warn <- getOption("warn"); options(warn = -2) + on.exit(options(warn=o.warn)) + qx0 <- q(object)(ps0, lower.tail = lower.tail, + log.p = log.p) + options(warn = o.warn) + + m <- match(ps0, psx) + n.ina.m <- !is.na(m) + if(any(n.ina.m)) + { M.n.ina.m <- m[n.ina.m] + qx0[n.ina.m] <- (support(object))[pmin(M.n.ina.m+1, + length(s))] + } + if(any(is.nan(qx0))) + warning("NaN's produced") + } + } + } +}) + + + +## Convolution Discrete Distributions + +setMethod("+", c("DiscreteDistribution","DiscreteDistribution"), +function(e1,e2){ + + if(length(support(e1))==1) return(e2+support(e1)) + if(length(support(e2))==1) return(e1+support(e2)) + e1.L <- as(e1, "LatticeDistribution") + e2.L <- as(e2, "LatticeDistribution") + if(is(e1.L, "LatticeDistribution") & is(e2.L, "LatticeDistribution")) + {w1 <- width(lattice(e1.L)) + w2 <- width(lattice(e2.L)) + W <- sort(abs(c(w1,w2))) + if (abs(abs(w1)-abs(w2))=0] + + .lowerExact = .lowerExact(x) + + dxlog <- if("log" %in% names(formals(d(x)))) + quote({dx <- d(xx)(x, log = TRUE)}) + else quote({dx <- log(d(xx)(x))}) + pxlog <- if("log.p" %in% names(formals(p(x))) && + "lower.tail" %in% names(formals(p(x)))) + quote({p(x)(q, lower.tail = FALSE, log.p = TRUE)}) + else + quote({log(1-p(x)(q))}) + + + qxlog <- if("lower.tail" %in% names(formals(q(x)))) + quote({qx <- if(lower.tail) + q(x)((1+p1)/2) [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/distr -r 1001 From noreply at r-forge.r-project.org Sun May 3 06:57:19 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 06:57:19 +0200 (CEST) Subject: [Distr-commits] r1002 - branches/distr-2.6/pkg/distr/inst Message-ID: <20150503045719.BA2ED187752@r-forge.r-project.org> Author: stamats Date: 2015-05-03 06:57:19 +0200 (Sun, 03 May 2015) New Revision: 1002 Modified: branches/distr-2.6/pkg/distr/inst/CITATION Log: removed an old (no longer working) link to distr.pdf Modified: branches/distr-2.6/pkg/distr/inst/CITATION =================================================================== --- branches/distr-2.6/pkg/distr/inst/CITATION 2015-05-03 04:49:03 UTC (rev 1001) +++ branches/distr-2.6/pkg/distr/inst/CITATION 2015-05-03 04:57:19 UTC (rev 1002) @@ -14,7 +14,6 @@ number = 2, pages = "2--6", month = "May", - url = "http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR/distr.pdf", pdf = "http://CRAN.R-project.org/doc/Rnews/Rnews_2006-2.pdf", textVersion = paste("Peter Ruckdeschel, Matthias Kohl, Thomas Stabla, Florian Camphausen (2006).", @@ -40,4 +39,4 @@ header = "If you employ convolution, please also cite:" ) - \ No newline at end of file + From noreply at r-forge.r-project.org Sun May 3 06:58:18 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 06:58:18 +0200 (CEST) Subject: [Distr-commits] r1003 - branches/distr-2.6/pkg/distr Message-ID: <20150503045818.6E0B0186CCA@r-forge.r-project.org> Author: stamats Date: 2015-05-03 06:58:18 +0200 (Sun, 03 May 2015) New Revision: 1003 Modified: branches/distr-2.6/pkg/distr/DESCRIPTION Log: Had to change Description due to warning during check Modified: branches/distr-2.6/pkg/distr/DESCRIPTION =================================================================== --- branches/distr-2.6/pkg/distr/DESCRIPTION 2015-05-03 04:57:19 UTC (rev 1002) +++ branches/distr-2.6/pkg/distr/DESCRIPTION 2015-05-03 04:58:18 UTC (rev 1003) @@ -1,8 +1,8 @@ Package: distr Version: 2.6 -Date: 2013-09-13 +Date: 2015-05-03 Title: Object Oriented Implementation of Distributions -Description: (S4-)classes and methods for distributions. +Description: S4-classes and methods for distributions. Authors at R: c(person("Florian", "Camphausen", role="ctb", comment="contributed as student in the initial phase --2005"), person("Matthias", "Kohl", role=c("aut", "cph")), person("Peter", "Ruckdeschel", role=c("cre", "cph"), email="Peter.Ruckdeschel at itwm.fraunhofer.de"), From noreply at r-forge.r-project.org Sun May 3 07:01:14 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 07:01:14 +0200 (CEST) Subject: [Distr-commits] r1004 - branches/distr-2.6/pkg/distr/tests/Examples Message-ID: <20150503050114.3D228187765@r-forge.r-project.org> Author: stamats Date: 2015-05-03 07:01:13 +0200 (Sun, 03 May 2015) New Revision: 1004 Modified: branches/distr-2.6/pkg/distr/tests/Examples/distr-Ex.Rout.save Log: updated Rout.save file Modified: branches/distr-2.6/pkg/distr/tests/Examples/distr-Ex.Rout.save =================================================================== --- branches/distr-2.6/pkg/distr/tests/Examples/distr-Ex.Rout.save 2015-05-03 04:58:18 UTC (rev 1003) +++ branches/distr-2.6/pkg/distr/tests/Examples/distr-Ex.Rout.save 2015-05-03 05:01:13 UTC (rev 1004) @@ -1,3078 +1,2835 @@ - -R version 3.0.1 Patched (2013-09-02 r63805) -- "Good Sport" -Copyright (C) 2013 The R Foundation for Statistical Computing -Platform: i386-w64-mingw32/i386 (32-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 <- "distr" -> source(file.path(R.home("share"), "R", "examples-header.R")) -> options(warn = 1) -> options(pager = "console") -> base::assign(".ExTimings", "distr-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') -> -> ### * -> library('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) -: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 - -> -> base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') -> cleanEx() -> nameEx("0distr-package") -> ### * 0distr-package -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: distr-package -> ### Title: distr - object orientated implementation of distributions -> ### Aliases: distr-package distr -> ### Keywords: package distribution -> -> ### ** Examples -> -> X <- Unif(2,3) -> Y <- Pois(lambda = 3) -> Z <- X+Y # generates Law of corresponding independent variables -> p(Z)(0.2) -[1] 0 -> r(Z)(1000) - [1] 6.579102 4.779275 3.372658 4.632594 3.217653 2.833188 5.836883 - [8] 4.328749 6.265813 2.547148 6.076999 8.133506 3.549124 7.967771 - [15] 4.282188 5.334846 5.539449 5.441803 3.869821 6.553436 6.532861 - [22] 8.883538 5.557134 7.066122 5.258768 2.550905 6.796403 3.145013 - [29] 3.486209 5.707381 6.944007 3.826960 6.383630 8.323171 8.907333 - [36] 7.056447 2.114501 4.904405 6.198231 5.835608 2.628063 6.578858 - [43] 3.072209 7.283379 4.889372 5.162274 4.432173 5.755494 4.371829 - [50] 4.179435 3.676957 3.343576 3.335259 5.945975 5.712469 4.512781 - [57] 3.670003 6.359885 6.723871 5.154257 4.752679 3.084680 6.164728 - [64] 5.980637 5.935260 5.065854 2.531672 4.055380 4.378224 5.166891 - [71] 6.558560 6.743660 6.059266 7.432974 7.402949 4.851098 6.300433 - [78] 8.925874 3.993535 4.602505 4.957766 2.634655 7.653118 3.972603 - [85] 5.345732 3.754893 5.776172 8.286398 8.446992 7.560786 6.635046 - [92] 8.711620 4.107038 4.367655 8.993393 4.432253 10.929256 4.073590 - [99] 5.577728 7.706458 7.484063 6.119480 3.191338 3.039565 3.491861 - [106] 5.339283 4.443054 3.735495 3.518061 6.380735 9.683830 4.579353 - [113] 6.700189 6.147659 3.976503 5.340870 9.642431 4.107585 4.609351 - [120] 4.178274 5.338655 5.502983 5.574192 3.938589 5.164298 9.568823 - [127] 6.277261 7.587950 3.822969 3.486584 5.308142 6.057207 3.523045 - [134] 5.481863 4.357590 3.278691 5.547702 4.912094 2.255964 4.017637 - [141] 5.827255 6.049479 7.595250 3.981267 6.569439 6.727461 4.151836 - [148] 5.318238 6.699690 4.854844 4.378279 5.275432 8.988444 2.134025 - [155] 5.977953 2.642202 5.600517 4.162107 7.143829 3.762430 5.781959 - [162] 4.217105 4.714697 4.293084 7.271073 5.903164 3.934551 6.452999 - [169] 3.329169 5.398796 4.169447 6.209014 5.827562 6.347140 5.599187 - [176] 6.452403 5.093153 7.896114 6.262903 2.711165 4.249534 5.896619 - [183] 9.174417 5.468117 2.795493 2.341466 3.478540 3.260784 6.985835 - [190] 4.438382 5.730667 5.680872 5.907649 4.760867 6.853652 8.254687 - [197] 4.453843 4.784929 4.591713 2.988044 5.927597 5.885563 4.569294 - [204] 6.919895 6.290173 4.256231 3.720954 7.162789 3.482136 4.980341 - [211] 7.714786 7.603208 2.756598 7.042582 3.892577 7.766692 5.472288 - [218] 5.897596 5.407148 2.767171 5.941631 8.765190 6.650673 3.923338 - [225] 4.270002 5.960052 6.441325 4.262422 3.362592 8.902643 9.294795 - [232] 3.214329 7.052151 7.936144 7.840518 6.612929 6.048513 4.269719 - [239] 7.760647 7.917457 6.042595 4.623126 6.025792 7.996861 2.177719 - [246] 6.654859 4.661239 3.820550 7.876687 6.082439 5.830691 4.417018 - [253] 5.066648 3.104336 6.731124 4.594065 5.534583 6.048505 4.615337 - [260] 9.738851 3.117800 10.366602 2.135035 5.297118 5.908073 2.112919 - [267] 6.564549 6.008583 4.787502 11.807161 6.509220 8.478424 6.403077 - [274] 5.543653 6.007867 5.173895 2.896862 5.519487 4.973214 5.805484 - [281] 5.949032 6.285357 5.619059 5.795161 6.935567 4.526653 5.831893 - [288] 4.800116 6.658077 4.995597 4.845622 4.879891 6.482920 4.094898 - [295] 5.028267 6.009440 4.823092 7.043040 10.823171 4.091859 4.864138 - [302] 4.022668 10.050640 2.949141 6.228148 4.626769 5.439620 4.599773 - [309] 6.968634 4.994205 3.273534 4.287168 9.199977 10.196245 9.991003 - [316] 6.955347 5.506245 4.236431 3.517317 5.577783 3.218334 7.222556 - [323] 4.825124 4.363241 4.924039 3.320962 5.120049 5.210499 4.559181 - [330] 3.403327 2.789545 6.471046 3.873281 7.176098 4.305160 5.395722 - [337] 7.004994 4.898506 4.424281 4.020754 3.632583 4.253636 7.789985 - [344] 5.114602 7.069107 4.200499 3.293541 9.391404 5.353941 4.003051 - [351] 2.304293 3.531214 6.863910 8.259209 2.093975 4.083890 4.257744 - [358] 2.086540 6.117788 3.186305 3.069495 5.338623 6.860354 7.781543 - [365] 6.277202 4.723161 4.633321 6.156335 5.152739 4.158852 6.895088 - [372] 8.289939 4.018619 2.049620 5.593186 3.241354 3.304142 4.794494 - [379] 5.750661 6.589345 3.136211 4.627482 5.864843 2.597692 4.197970 - [386] 4.982050 3.131675 8.181336 8.788943 5.236139 5.860343 6.419425 - [393] 8.651857 3.579700 5.323007 6.431335 3.417773 4.522973 4.432197 - [400] 8.182775 5.070290 5.964844 9.542852 4.748663 4.554676 9.680594 - [407] 7.250223 10.284465 4.126663 5.693831 7.880095 7.968802 3.317698 - [414] 4.045398 6.949944 5.400209 5.371284 3.324154 3.560770 6.091314 - [421] 7.774884 5.413062 4.823627 4.365933 3.883124 3.245356 3.594525 - [428] 4.365887 9.745536 6.011345 8.925059 4.869513 5.638617 8.295089 - [435] 8.935575 3.663063 5.618220 8.561209 3.176157 5.520921 6.711753 - [442] 7.925893 4.067052 7.236690 7.695405 4.332264 4.113306 4.939782 - [449] 7.372087 5.706058 7.751002 6.403756 4.227362 4.273287 6.072921 - [456] 4.910409 2.459842 7.600472 4.275654 6.973216 6.873162 9.751179 - [463] 4.136125 6.655204 2.080379 6.265311 4.223805 3.498867 4.924211 - [470] 5.800581 4.806109 6.664286 2.229823 3.286322 6.061472 3.949581 - [477] 7.649938 5.617929 6.072907 7.494375 6.440831 8.013917 7.248682 - [484] 7.171046 5.345439 7.456406 6.654902 6.953591 5.726936 5.247356 - [491] 3.613288 5.128787 5.052366 4.567321 5.740011 5.750754 9.352847 - [498] 7.125697 4.866561 4.069580 6.650475 4.244731 4.329885 3.274329 - [505] 4.979835 7.913374 4.674176 6.326536 7.148619 6.579086 5.477506 - [512] 7.960702 3.157628 4.002058 6.086027 5.238919 5.590526 4.435348 - [519] 5.597217 8.762081 5.789205 9.470844 5.934225 8.645870 4.665628 - [526] 6.270418 6.502792 8.638165 3.534610 7.806940 7.806592 4.497164 - [533] 4.166165 8.547377 5.185010 5.847412 7.154381 5.697753 3.821394 - [540] 8.387257 5.753594 7.799001 6.051941 4.888510 6.764761 7.341601 - [547] 4.123064 4.173528 3.565936 4.346350 6.853956 4.203341 3.216346 - [554] 5.590785 5.713518 4.339589 5.375326 9.243176 5.887737 2.112778 - [561] 5.742362 4.044285 5.720649 3.863230 5.039876 5.721132 6.326835 - [568] 3.726445 3.032174 4.372235 6.415886 4.121232 7.407248 4.424386 - [575] 4.357479 6.830058 5.365814 6.293699 2.374506 3.719549 2.100653 - [582] 6.691715 8.235638 4.779743 6.282059 3.706763 6.619718 6.544563 - [589] 7.924641 3.531242 4.271171 3.905814 8.020223 6.779150 7.364992 - [596] 5.307303 4.160868 3.176943 5.693852 2.621652 6.468918 5.869892 - [603] 3.693521 4.506954 5.913281 4.812330 6.404537 6.794142 4.017008 - [610] 5.548779 6.254126 6.253319 4.624762 4.090745 6.460816 2.913422 - [617] 4.485198 3.388693 4.171777 3.677474 3.292837 6.075759 5.719630 - [624] 7.132900 2.991177 8.098001 5.837644 4.548980 4.983142 5.703874 - [631] 4.281914 6.253390 3.177424 6.002899 5.454130 6.992385 7.816874 - [638] 8.066406 4.898936 4.829592 3.024088 3.472519 7.272335 7.336495 - [645] 3.057295 5.205245 5.869878 5.940514 4.960493 4.123543 6.881292 - [652] 5.565367 5.532138 4.599130 7.057423 3.152381 7.322148 5.617132 - [659] 6.080236 4.957499 4.928580 5.950919 7.106630 4.557867 5.742990 - [666] 4.342305 5.370324 5.661521 5.077816 4.189266 7.408123 4.212645 - [673] 9.980272 5.455587 6.955461 5.027057 4.040872 6.516094 5.102335 - [680] 4.762621 5.161881 5.168592 7.857960 4.060331 4.329365 5.821864 - [687] 5.446692 4.958970 4.770069 6.251505 5.219794 4.975353 6.647226 - [694] 8.646266 2.638373 4.096875 7.459760 5.963888 4.921418 3.200894 - [701] 4.305496 6.087948 3.489525 6.390110 5.178165 8.226200 7.341701 - [708] 3.126380 7.065164 4.277436 2.600411 6.273144 4.941489 4.799276 - [715] 4.089915 4.392771 6.174850 3.456753 7.481765 5.142862 4.034420 - [722] 4.202052 6.264259 4.744758 3.353447 5.877194 4.135481 5.570409 - [729] 8.412244 4.225636 4.797575 6.398676 2.591563 6.906964 5.384810 - [736] 6.371892 5.374292 6.182153 3.041935 6.261203 10.304963 2.178528 - [743] 5.558146 7.371060 4.642810 5.924116 3.259350 6.239350 3.848965 - [750] 4.699012 6.884430 7.209243 4.528550 5.228070 8.102115 4.102062 - [757] 3.150018 2.116710 5.626661 5.515649 2.670773 6.861331 4.636687 - [764] 9.570007 7.894844 8.275016 4.490435 7.946827 6.142462 5.174121 - [771] 7.886910 3.507694 6.190410 5.562037 4.547680 3.893744 6.704781 - [778] 5.561152 7.447658 6.105691 4.658082 7.168129 5.486573 5.167835 - [785] 3.129796 6.416057 5.255846 4.693766 5.249084 5.958214 8.764405 - [792] 3.841370 5.875610 2.009616 7.036117 3.285925 6.080532 4.968795 - [799] 8.564562 6.984705 5.836639 6.880194 3.244425 7.732067 4.498606 - [806] 6.503376 4.568116 4.652677 8.064712 11.676612 4.735372 3.111300 - [813] 3.046655 6.130910 4.880956 6.839725 2.868143 3.033383 6.107907 - [820] 6.549297 8.109318 6.722591 7.725010 4.789522 9.617478 3.503007 - [827] 4.456149 3.034666 6.209639 5.342787 3.545595 7.769484 4.428765 - [834] 3.686462 5.521869 5.796536 3.903052 6.432457 6.331940 6.917115 - [841] 5.209280 5.812735 4.300713 7.572182 5.386782 8.279482 5.260043 - [848] 5.959384 5.634133 8.081877 3.926206 5.890943 5.912085 5.718499 - [855] 3.682528 5.555186 6.401709 5.863838 2.074414 5.283284 11.162637 - [862] 2.763897 5.116376 3.167472 3.475884 4.005788 5.974413 2.114148 - [869] 2.080774 5.322919 5.118785 9.985772 2.404148 6.241782 4.354879 - [876] 4.153240 5.287548 6.256672 4.157690 7.029772 4.811628 6.579173 - [883] 6.576732 2.701487 6.063766 3.502483 3.383950 5.426416 5.544390 - [890] 6.643638 3.791192 3.846853 4.072626 7.860111 6.956165 5.926419 - [897] 3.053964 5.246409 6.487370 6.100063 4.195159 6.213572 5.207682 - [904] 6.028771 8.234566 3.107185 5.277316 2.696022 4.266257 4.660477 - [911] 7.212417 5.005266 4.102903 6.287400 8.444156 6.692993 7.020884 - [918] 6.955752 6.804111 5.911740 5.309467 7.323928 4.138360 6.957561 - [925] 2.232669 5.023715 7.052112 4.932720 5.038752 6.807114 4.696882 - [932] 4.388051 4.390583 5.982333 3.216765 8.566960 5.980336 6.574558 - [939] 4.632867 7.782993 2.856876 5.041593 5.895225 4.188517 2.387342 - [946] 7.494502 4.370316 6.693625 3.733155 4.308550 6.972442 5.243334 - [953] 5.835028 7.390576 8.908864 6.607566 5.607495 6.894327 2.975288 - [960] 7.676351 5.091139 3.777949 7.517544 6.652370 5.339298 5.292120 - [967] 6.783712 2.319966 5.489278 5.134142 5.653294 4.783924 6.921809 - [974] 8.258464 4.513233 5.858583 3.151414 5.641468 3.825477 7.972295 - [981] 4.173126 4.710022 6.110715 7.416779 9.284621 4.341155 5.168895 - [988] 3.547097 3.797206 6.858631 6.332270 3.515725 3.371685 4.436701 - [995] 5.742429 10.011101 6.046900 4.371818 6.658157 7.529650 -> plot(Z+sin(Norm())) -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("0distr-package", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("AbscontDistribution-class") -> ### * AbscontDistribution-class -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: AbscontDistribution-class -> ### Title: Class "AbscontDistribution" -> ### Aliases: AbscontDistribution-class AffLinDistribution-class -> ### AffLinAbscontDistribution-class sqrt,AbscontDistribution-method -> ### initialize,AbscontDistribution-method -> ### initialize,AffLinAbscontDistribution-method -> ### sqrt,AbscontDistribution-method -> ### Keywords: distribution -> -> ### ** Examples -> -> N <- Norm() # N is a normal distribution with mean=0 and sd=1. -> E <- Exp() # E is an exponential distribution with rate=1. -> A1 <- E+1 # a new absolutely continuous distributions with exact slots d, p, q -> A2 <- A1*3 # a new absolutely continuous distributions with exact slots d, p, q -> A3 <- N*0.9 + E*0.1 # a new absolutely continuous distribution with approximated slots d, p, q -> r(A3)(1) # one random number generated from this distribution, e.g. -0.7150937 -[1] -0.5492378 -> d(A3)(0) # The (approximated) density for x=0 is 0.4379882. -[1] 0.4379965 -> p(A3)(0) # The (approximated) probability that x <= 0 is 0.4562021. -[1] 0.4561991 -> q(A3)(.1) # The (approximated) 10 percent quantile is 0.1. -[1] -1.060145 -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("AbscontDistribution-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("AbscontDistribution") -> ### * AbscontDistribution -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: AbscontDistribution -> ### Title: Generating function "AbscontDistribution" -> ### Aliases: AbscontDistribution -> ### Keywords: distribution -> -> ### ** Examples -> -> plot(Norm()) -> plot(AbscontDistribution(r = rnorm)) -> plot(AbscontDistribution(d = dnorm)) -> plot(AbscontDistribution(p = pnorm)) -> plot(AbscontDistribution(q = qnorm)) -> plot(Ac <- AbscontDistribution(d = function(x, log = FALSE){ -+ d <- exp(-abs(x^3)) -+ ## unstandardized!! -+ if(log) d <- log(d) -+ return(d)}, -+ withStand = TRUE)) -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("AbscontDistribution", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("Arcsine-class") -> ### * Arcsine-class -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: Arcsine-class -> ### Title: Class "Arcsine" -> ### Aliases: Arcsine-class Arcsine initialize,Arcsine-method -> ### Keywords: distribution -> -> ### ** Examples -> -> A <- Arcsine() -> # A is a Arcsine distribution with shape1 = 1 and shape2 = 1. -> r(A)(3) # three random number generated from this distribution, e.g. 0.6979795 -[1] -0.6718297 -0.3910154 0.2268826 -> d(A)(c(-2,-1,-0.2,0,0.2,1,2)) # Density at x=c(-1,-0.2,0,0.2,1). -[1] 0.0000000 Inf 0.3248737 0.3183099 0.3248737 Inf 0.0000000 -> p(A)(c(-2,-1,-0.2,0,0.2,1,2)) # cdf at q=c(-1,-0.2,0,0.2,1). -[1] 0.0000000 0.0000000 0.4359058 0.5000000 0.5640942 1.0000000 1.0000000 -> q(A)(c(0,0.2,1,2)) # quantile function at at x=c(0,0.2,1). -[1] -1.000000 -0.809017 1.000000 NA -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("Arcsine-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("Beta-class") -> ### * Beta-class -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: Beta-class -> ### Title: Class "Beta" -> ### Aliases: Beta-class Beta initialize,Beta-method -> ### Keywords: distribution -> -> ### ** Examples -> -> B <- Beta(shape1 = 1, shape2 = 1) -> # B is a beta distribution with shape1 = 1 and shape2 = 1. -> r(B)(1) # one random number generated from this distribution, e.g. 0.6979795 -[1] 0.7344913 -> d(B)(1) # Density of this distribution is 1 for x=1. -[1] 1 -> p(B)(1) # Probability that x < 1 is 1. -[1] 1 -> q(B)(.1) # Probability that x < 0.1 is 0.1. -[1] 0.1 -> shape1(B) # shape1 of this distribution is 1. -[1] 1 -> shape1(B) <- 2 # shape1 of this distribution is now 2. -> Bn <- Beta(shape1 = 1, shape2 = 3, ncp = 5) -> # Bn is a beta distribution with shape1 = 1 and shape2 = 3 and ncp = 5. -> B0 <- Bn; ncp(B0) <- 0; -> # B0 is just the same beta distribution as Bn but with ncp = 0 -> q(B0)(0.1) ## -[1] 0.03451062 -> q(Bn)(0.1) ## => from R 2.3.0 on ncp no longer ignored... -[1] 0.2047932 -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("Beta-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("BetaParameter-class") -> ### * BetaParameter-class -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: BetaParameter-class -> ### Title: Class "BetaParameter" -> ### Aliases: BetaParameter-class initialize,BetaParameter-method -> ### Keywords: distribution -> -> ### ** Examples -> -> W <- new("BetaParameter", shape1 = 1, shape2 = 1, ncp = 0) -> shape2(W) # shape2 of this distribution is 1. -[1] 1 -> shape2(W) <- 2 # shape2 of this distribution is now 2. -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("BetaParameter-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("Binom-class") -> ### * Binom-class -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: Binom-class -> ### Title: Class "Binom" -> ### Aliases: Binom-class Binom initialize,Binom-method -> ### Keywords: distribution -> -> ### ** Examples -> -> B <- Binom(prob=0.5,size=1) # B is a binomial distribution with prob=0.5 and size=1. -> r(B)(1) # # one random number generated from this distribution, e.g. 1 -[1] 0 -> d(B)(1) # Density of this distribution is 0.5 for x=1. -[1] 0.5 -> p(B)(0.4) # Probability that x<0.4 is 0.5. -[1] 0.5 -> q(B)(.1) # x=0 is the smallest value x such that p(B)(x)>=0.1. -[1] 0 -> size(B) # size of this distribution is 1. -[1] 1 -> size(B) <- 2 # size of this distribution is now 2. -> C <- Binom(prob = 0.5, size = 1) # C is a binomial distribution with prob=0.5 and size=1. -> D <- Binom(prob = 0.6, size = 1) # D is a binomial distribution with prob=0.6 and size=1. -> E <- B + C # E is a binomial distribution with prob=0.5 and size=3. -> F <- B + D # F is an object of class LatticeDistribution. -> G <- B + as(D,"DiscreteDistribution") ## DiscreteDistribution -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("Binom-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("BinomParameter-class") -> ### * BinomParameter-class -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: BinomParameter-class -> ### Title: Class "BinomParameter" -> ### Aliases: BinomParameter-class initialize,BinomParameter-method -> ### Keywords: distribution -> -> ### ** Examples -> -> W <- new("BinomParameter",prob=0.5,size=1) -> size(W) # size of this distribution is 1. -[1] 1 -> size(W) <- 2 # size of this distribution is now 2. -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("BinomParameter-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("Cauchy-class") -> ### * Cauchy-class -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: Cauchy-class -> ### Title: Class "Cauchy" -> ### Aliases: Cauchy-class Cauchy initialize,Cauchy-method -> ### Keywords: distribution -> -> ### ** Examples -> -> C <- Cauchy(location = 1, scale = 1) # C is a Cauchy distribution with location=1 and scale=1. -> r(C)(1) # one random number generated from this distribution, e.g. 4.104603 -[1] 2.10252 -> d(C)(1) # Density of this distribution is 0.3183099 for x=1. -[1] 0.3183099 -> p(C)(1) # Probability that x<1 is 0.5. -[1] 0.5 -> q(C)(.1) # Probability that x<-2.077684 is 0.1. -[1] -2.077684 -> location(C) # location of this distribution is 1. -[1] 1 -> location(C) <- 2 # location of this distribution is now 2. -> is(C,"Td") # no -[1] FALSE -> C0 <- Cauchy() # standard, i.e. location = 0, scale = 1 -> is(C0,"Td") # yes -[1] TRUE -> as(C0,"Td") -Distribution Object of Class: Td - df: 1 - ncp: 0 -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("Cauchy-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("CauchyParameter-class") -> ### * CauchyParameter-class -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: CauchyParameter-class -> ### Title: Class "CauchyParameter" -> ### Aliases: CauchyParameter-class initialize,CauchyParameter-method -> ### Keywords: distribution -> -> ### ** Examples -> -> W <- new("CauchyParameter",location=1,scale=1) -> location(W) # location of this distribution is 1. -[1] 1 -> location(W) <- 2 # location of this distribution is now 2. -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("CauchyParameter-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("Chisq-class") -> ### * Chisq-class -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: Chisq-class -> ### Title: Class "Chisq" -> ### Aliases: Chisq-class Chisq initialize,Chisq-method -> ### Keywords: distribution -> -> ### ** Examples -> -> C <- Chisq(df = 1, ncp = 1) # C is a chi-squared distribution with df=1 and ncp=1. -> r(C)(1) # one random number generated from this distribution, e.g. 0.2557184 -[1] 3.052466 -> d(C)(1) # Density of this distribution is 0.2264666 for x = 1. -[1] 0.2264666 -> p(C)(1) # Probability that x < 1 is 0.4772499. -[1] 0.4772499 -> q(C)(.1) # Probability that x < 0.04270125 is 0.1. -[1] 0.04270125 -> df(C) # df of this distribution is 1. -[1] 1 -> df(C) <- 2 # df of this distribution is now 2. -> is(C, "Gammad") # no -[1] FALSE -> C0 <- Chisq() # default: Chisq(df=1,ncp=0) -> is(C0, "Gammad") # yes -[1] TRUE -> as(C0,"Gammad") -Distribution Object of Class: Gammad - shape: 0.5 - scale: 2 -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("Chisq-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("ChisqParameter-class") -> ### * ChisqParameter-class -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: ChisqParameter-class -> ### Title: Class "ChisqParameter" -> ### Aliases: ChisqParameter-class initialize,ChisqParameter-method -> ### Keywords: distribution -> -> ### ** Examples -> -> W <- new("ChisqParameter",df=1,ncp=1) -> ncp(W) # ncp of this distribution is 1. -[1] 1 -> ncp(W) <- 2 # ncp of this distribution is now 2. -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("ChisqParameter-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("CompoundDistribution-class") -> ### * CompoundDistribution-class -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: CompoundDistribution-class -> ### Title: Class "CompoundDistribution" -> ### Aliases: CompoundDistribution-class NumbOfSummandsDistr SummandsDistr -> ### NumbOfSummandsDistr-methods SummandsDistr-methods -> ### NumbOfSummandsDistr,CompoundDistribution-method -> ### SummandsDistr,CompoundDistribution-method -> ### coerce,CompoundDistribution,UnivarLebDecDistribution-method -> ### UnivDistrListOrDistribution-class -> ### Keywords: distribution -> -> ### ** Examples -> -> CP <- CompoundDistribution(Pois(),Norm()) -> CP -An object of class "CompoundDistribution" - - The frequency distribution is: -Distribution Object of Class: Pois -lambda: 1 - The summands distribution is/are: -Distribution Object of Class: Norm -mean: 0 -sd: 1 - -This Distribution is: -An object of class "UnivarLebDecDistribution" ---- a Lebesgue decomposed distribution: - - Its discrete part (with weight 0.368000) is a -Distribution Object of Class: Dirac -location: 0 -This part is accessible with 'discretePart()'. - - Its absolutely continuous part (with weight 0.632000) is a -Distribution Object of Class: AbscontDistribution -This part is accessible with 'acPart()'. -Warning in function (object) : - arithmetics on distributions are understood as operations on r.v.'s -see 'distrARITH()'; for switching off this warning see '?distroptions' -> p(CP)(0.3) -[1] 0.7436411 -> plot(CP) -NULL -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("CompoundDistribution-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("CompoundDistribution") -> ### * CompoundDistribution -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: CompoundDistribution -> ### Title: Generating function for Class "CompoundDistribution" -> ### Aliases: CompoundDistribution -> ### Keywords: distribution list -> -> ### ** Examples -> -> CP0 <- CompoundDistribution(Pois(), Norm()) -> CP0 -An object of class "CompoundDistribution" - - The frequency distribution is: -Distribution Object of Class: Pois -lambda: 1 - The summands distribution is/are: -Distribution Object of Class: Norm -mean: 0 -sd: 1 - -This Distribution is: -An object of class "UnivarLebDecDistribution" ---- a Lebesgue decomposed distribution: - - Its discrete part (with weight 0.368000) is a -Distribution Object of Class: Dirac -location: 0 -This part is accessible with 'discretePart()'. - - Its absolutely continuous part (with weight 0.632000) is a -Distribution Object of Class: AbscontDistribution -This part is accessible with 'acPart()'. -Warning in function (object) : - arithmetics on distributions are understood as operations on r.v.'s -see 'distrARITH()'; for switching off this warning see '?distroptions' -> CP1 <- CompoundDistribution(DiscreteDistribution(supp = c(1,5,9,11), -+ prob = dbinom(0:3, size = 3,prob = 0.3)),Norm()) -> CP1 -An object of class "CompoundDistribution" - - The frequency distribution is: -Distribution Object of Class: DiscreteDistribution - The summands distribution is/are: -Distribution Object of Class: Norm -mean: 0 -sd: 1 - -This Distribution is: -Distribution Object of Class: AbscontDistribution -Warning in function (object) : - arithmetics on distributions are understood as operations on r.v.'s -see 'distrARITH()'; for switching off this warning see '?distroptions' -> UL <- UnivarDistrList(Norm(), Binom(10,0.3), Chisq(df=4), Norm(), -+ Binom(10,0.3), Chisq(df=4), Norm(), Binom(10,0.3), -+ Chisq(df=4), Td(5), Td(10)) -> CP2 <- CompoundDistribution(DiscreteDistribution(supp = c(1,5,9,11), -+ prob = dbinom(0:3, size = 3, prob = 0.3)),UL) -> plot(CP2) -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/distr -r 1004 From noreply at r-forge.r-project.org Sun May 3 07:05:47 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 07:05:47 +0200 (CEST) Subject: [Distr-commits] r1005 - branches/distr-2.6/pkg/distrEx/inst Message-ID: <20150503050547.4A5A5187765@r-forge.r-project.org> Author: stamats Date: 2015-05-03 07:05:46 +0200 (Sun, 03 May 2015) New Revision: 1005 Modified: branches/distr-2.6/pkg/distrEx/inst/CITATION Log: removed an old (no longer working) link to distr.pdf Modified: branches/distr-2.6/pkg/distrEx/inst/CITATION =================================================================== --- branches/distr-2.6/pkg/distrEx/inst/CITATION 2015-05-03 05:01:13 UTC (rev 1004) +++ branches/distr-2.6/pkg/distrEx/inst/CITATION 2015-05-03 05:05:46 UTC (rev 1005) @@ -14,7 +14,6 @@ number = 2, pages = "2--6", month = "May", - url = "http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR/distr.pdf", pdf = "http://CRAN.R-project.org/doc/Rnews/Rnews_2006-2.pdf", textVersion = paste("Ruckdeschel, P., Kohl, M., Stabla, T., & Camphausen, F. (2006)", "S4 Classes for Distributions")) From noreply at r-forge.r-project.org Sun May 3 07:06:19 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 07:06:19 +0200 (CEST) Subject: [Distr-commits] r1006 - branches/distr-2.6/pkg/distrEx Message-ID: <20150503050619.CAD7A187CB7@r-forge.r-project.org> Author: stamats Date: 2015-05-03 07:06:19 +0200 (Sun, 03 May 2015) New Revision: 1006 Modified: branches/distr-2.6/pkg/distrEx/DESCRIPTION Log: minor change of Title and Description due to warning during check Modified: branches/distr-2.6/pkg/distrEx/DESCRIPTION =================================================================== --- branches/distr-2.6/pkg/distrEx/DESCRIPTION 2015-05-03 05:05:46 UTC (rev 1005) +++ branches/distr-2.6/pkg/distrEx/DESCRIPTION 2015-05-03 05:06:19 UTC (rev 1006) @@ -1,8 +1,8 @@ Package: distrEx Version: 2.6 -Date: 2013-09-18 -Title: Extensions of Package distr -Description: extends package 'distr' by functionals, distances, and conditional distributions. +Date: 2015-05-03 +Title: Extensions of Package 'distr' +Description: Extends package 'distr' by functionals, distances, and conditional distributions. Depends: R(>= 2.10.0), methods, distr(>= 2.2) Imports: startupmsg Suggests: tcltk From noreply at r-forge.r-project.org Sun May 3 07:06:58 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 07:06:58 +0200 (CEST) Subject: [Distr-commits] r1007 - branches/distr-2.6/pkg/distrEx/tests/Examples Message-ID: <20150503050658.12022187CB7@r-forge.r-project.org> 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') -> -> ### * -> 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, ...) -} - -> 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) -} - -> 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) -} - -> q(D1) [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/distr -r 1007 From noreply at r-forge.r-project.org Sun May 3 07:15:42 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 07:15:42 +0200 (CEST) Subject: [Distr-commits] r1008 - branches/distr-2.6/pkg/distrSim/tests/Examples Message-ID: <20150503051542.BD848186870@r-forge.r-project.org> Author: stamats Date: 2015-05-03 07:15:42 +0200 (Sun, 03 May 2015) New Revision: 1008 Modified: branches/distr-2.6/pkg/distrSim/tests/Examples/distrSim-Ex.Rout.save Log: updated Rout.save file Modified: branches/distr-2.6/pkg/distrSim/tests/Examples/distrSim-Ex.Rout.save =================================================================== --- branches/distr-2.6/pkg/distrSim/tests/Examples/distrSim-Ex.Rout.save 2015-05-03 05:06:57 UTC (rev 1007) +++ branches/distr-2.6/pkg/distrSim/tests/Examples/distrSim-Ex.Rout.save 2015-05-03 05:15:42 UTC (rev 1008) @@ -1,873 +1,847 @@ - -R version 3.0.1 Patched (2013-09-02 r63805) -- "Good Sport" -Copyright (C) 2013 The R Foundation for Statistical Computing -Platform: i386-w64-mingw32/i386 (32-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 <- "distrSim" -> source(file.path(R.home("share"), "R", "examples-header.R")) -> options(warn = 1) -> options(pager = "console") -> base::assign(".ExTimings", "distrSim-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') -> -> ### * -> library('distrSim') -Loading required package: setRNG -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) -: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 - -:distrSim> Simulation classes based on package distr (version -:distrSim> 2.5) -:distrSim> -:distrSim> Some functions from package 'stats' are intentionally -:distrSim> masked ---see distrSimMASK(). -:distrSim> -:distrSim> -:distrSim> For more information see ?"distrSim", -:distrSim> NEWS("distrSim"), as well as -:distrSim> http://distr.r-forge.r-project.org/ -:distrSim> Package "distrDoc" provides a vignette to this package -:distrSim> as well as to several related packages; try -:distrSim> vignette("distr"). - - -Attaching package: 'distrSim' - -The following object is masked from 'package:stats': - - simulate - -The following object is masked from 'package:base': - - rbind - -> -> base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') -> cleanEx() -> nameEx("Contsimulation-class") -> ### * Contsimulation-class -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: Contsimulation-class -> ### Title: Class "Contsimulation" -> ### Aliases: Contsimulation-class Contsimulation -> ### initialize,Contsimulation-method -> ### Keywords: manip -> -> ### ** Examples -> -> N <- Norm() # N is a standard normal distribution. -> C <- Cauchy() # C is a Cauchy distribution -> cs <- Contsimulation(filename = "csim", -+ runs = 10, -+ samplesize = 3, -+ seed = setRNG(), -+ distribution.id = N, -+ distribution.c = C, -+ rate = 0.1) -> simulate(cs) -> # Each of the 30 random numbers is ideal (N-distributed) with -> # probability 0.9 and contaminated (C-distributed) with -> # probability = 0.1 -> Data(cs) -, , 1 - - [,1] -[1,] -0.6264538 -[2,] 0.1836433 -[3,] -0.8356286 - -, , 2 - - [,1] -[1,] 1.5952808 -[2,] 0.3295078 -[3,] -0.8204684 - -, , 3 - - [,1] -[1,] 0.4874291 -[2,] 0.7383247 -[3,] 0.5757814 - -, , 4 - - [,1] -[1,] -0.3053884 -[2,] 1.5117812 -[3,] 0.3898432 - -, , 5 - - [,1] -[1,] -0.6212406 -[2,] 1.7376135 -[3,] 1.1249309 - -, , 6 - - [,1] -[1,] -0.04493361 -[2,] -0.01619026 -[3,] 0.94383621 - -, , 7 - - [,1] -[1,] -0.8415496 -[2,] 0.5939013 -[3,] 4.8029372 - -, , 8 - - [,1] -[1,] 0.78213630 -[2,] 0.07456498 -[3,] -1.98935170 - -, , 9 - - [,1] -[1,] 0.61982575 -[2,] -0.05612874 -[3,] -0.15579551 - -, , 10 - - [,1] -[1,] -1.4707524 -[2,] -0.4781501 -[3,] 0.4179416 - -> Data.id(cs) -, , 1 - - [,1] -[1,] -0.6264538 -[2,] 0.1836433 -[3,] -0.8356286 - -, , 2 - - [,1] -[1,] 1.5952808 -[2,] 0.3295078 -[3,] -0.8204684 - -, , 3 - - [,1] -[1,] 0.4874291 -[2,] 0.7383247 -[3,] 0.5757814 - -, , 4 - - [,1] -[1,] -0.3053884 -[2,] 1.5117812 -[3,] 0.3898432 - -, , 5 - - [,1] -[1,] -0.6212406 -[2,] -2.2146999 -[3,] 1.1249309 - -, , 6 - - [,1] -[1,] -0.04493361 -[2,] -0.01619026 -[3,] 0.94383621 - -, , 7 - - [,1] -[1,] 0.8212212 -[2,] 0.5939013 -[3,] 0.9189774 - -, , 8 - - [,1] -[1,] 0.78213630 -[2,] 0.07456498 -[3,] -1.98935170 - -, , 9 - - [,1] -[1,] 0.61982575 -[2,] -0.05612874 -[3,] -0.15579551 - -, , 10 - - [,1] -[1,] -1.4707524 -[2,] -0.4781501 -[3,] 0.4179416 - -> Data.c(cs) -, , 1 - - [,1] -[1,] -0.2807547 -[2,] 1.3197748 -[3,] 7.7332079 - -, , 2 - - [,1] -[1,] 1.720315 -[2,] -1.949413 -[3,] 1.051684 - -, , 3 - - [,1] -[1,] 14.8138609 -[2,] -0.9024312 -[3,] 0.2710277 - -, , 4 - - [,1] -[1,] -0.4130314 -[2,] 1.8065104 -[3,] -0.5520464 - -, , 5 - - [,1] -[1,] 1.913070 -[2,] 1.737613 -[3,] 13.435126 - -, , 6 - - [,1] -[1,] -0.3522399 -[2,] -0.4540178 -[3,] 2.7773206 - -, , 7 - - [,1] -[1,] -0.8415496 -[2,] -0.1243574 -[3,] 4.8029372 - -, , 8 - - [,1] -[1,] -1.268374 -[2,] 3.077498 -[3,] 1.635911 - -, , 9 - - [,1] -[1,] -0.9564330 -[2,] 0.7395454 -[3,] -1.2798578 - -, , 10 - - [,1] -[1,] 0.4020896 -[2,] 0.9720478 -[3,] 0.4833067 - -> ind(cs) - [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] -[1,] 0 0 0 0 0 0 1 0 0 0 -[2,] 0 0 0 0 1 0 0 0 0 0 -[3,] 0 0 0 0 0 0 1 0 0 0 -> summary(cs) -name of simulation: csim -rate of contamination: 0.100000 -real Data: -dimension of the observations: 1 -number of runs: 10 -size of sample: 3 -, , 1 - - [,1] -Min. -0.8356 -1st Qu. -0.7310 -Median -0.6265 -Mean -0.4261 -3rd Qu. -0.2214 -Max. 0.1836 - -, , 2 - - [,1] -Min. -0.8205 -1st Qu. -0.2455 -Median 0.3295 -Mean 0.3681 -3rd Qu. 0.9624 -Max. 1.5950 - -, , 3 - - [,1] -Min. 0.4874 -1st Qu. 0.5316 -Median 0.5758 -Mean 0.6005 -3rd Qu. 0.6571 -Max. 0.7383 - -, , 4 - - [,1] -Min. -0.30540 -1st Qu. 0.04223 -Median 0.38980 -Mean 0.53210 -3rd Qu. 0.95080 -Max. 1.51200 - -, , 5 - - [,1] -Min. -0.6212 -1st Qu. 0.2518 -Median 1.1250 -Mean 0.7471 -3rd Qu. 1.4310 -Max. 1.7380 - -, , 6 - - [,1] -Min. -0.04493 -1st Qu. -0.03056 -Median -0.01619 -Mean 0.29420 -3rd Qu. 0.46380 -Max. 0.94380 - -> Data(cs) # different data -, , 1 - - [,1] -[1,] -0.6264538 -[2,] 0.1836433 -[3,] -0.8356286 - -, , 2 - - [,1] -[1,] 1.5952808 -[2,] 0.3295078 -[3,] -0.8204684 - -, , 3 - - [,1] -[1,] 0.4874291 -[2,] 0.7383247 -[3,] 0.5757814 - -, , 4 - - [,1] -[1,] -0.3053884 -[2,] 1.5117812 -[3,] 0.3898432 - -, , 5 - - [,1] -[1,] -0.6212406 -[2,] 1.7376135 -[3,] 1.1249309 - -, , 6 - - [,1] -[1,] -0.04493361 -[2,] -0.01619026 -[3,] 0.94383621 - -, , 7 - - [,1] -[1,] -0.8415496 -[2,] 0.5939013 -[3,] 4.8029372 - -, , 8 - - [,1] -[1,] 0.78213630 -[2,] 0.07456498 -[3,] -1.98935170 - -, , 9 - - [,1] -[1,] 0.61982575 -[2,] -0.05612874 -[3,] -0.15579551 - -, , 10 - - [,1] -[1,] -1.4707524 -[2,] -0.4781501 -[3,] 0.4179416 - -> savedata(cs) # saves the object in the working directory of R... -> load("csim") # loads it again... -> Data(cs) # ...without the data - use simulate to return it! -NULL -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("Contsimulation-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("Dataclass-class") -> ### * Dataclass-class -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: Dataclass-class -> ### Title: Class "Dataclass" -> ### Aliases: Dataclass-class initialize,Dataclass-method -> ### Keywords: manip -> -> ### ** Examples -> -> D66 <- Dataclass(filename="N74", Data = matrix(1:36,6)) -> D66 -name of Dataclass: Data-Set -filename of Dataclass: N74 -number of runs: 1 -dimension of the observations: 6 -size of sample: 6 -object was generated by version: 2.5 -> # -> D <- Dataclass(Data = array(c(1,2,3,4,5,6),c(samplesize=2,obsdim=3,Runs=1)), -+ filename = "xyz.sav") -> # A new object of type "Dataclass" is created. -> # -> isOldVersion(D) ##NO! -[1] FALSE -> # -> savedata(D) -> # creates a file called "xyz.sav" where the information is saved and a -> # copy "xyz.sav.comment" without data -> Data(D) <- array(c(11,12,13,14,15,16),c(samplesize=2,obsdim=3,Runs=1)) # changes the data of D -> cload("xyz.sav") # loads the object without data - it is called "D.comment" -> D.comment -name of Dataclass: Data-Set -filename of Dataclass: xyz.sav -number of runs: 1 -dimension of the observations: 3 -size of sample: 2 -object was generated by version: 2.5 -> load("xyz.sav") # loads the original object "D" -> Data(D) # the original data: matrix(c(1,2,3,4,5,6),2) -, , 1 - - [,1] [,2] [,3] -[1,] 1 3 5 -[2,] 2 4 6 - -> #if you have distrTEst available: -> #evaluate(object = D, estimator = mean) # returns the mean of each variable -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("Dataclass-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("Simulation-class") -> ### * Simulation-class -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: Simulation-class -> ### Title: Class "Simulation" -> ### Aliases: Simulation-class Simulation initialize,Simulation-method -> ### Keywords: manip -> -> ### ** Examples -> -> N=Norm() # N is a standard normal distribution. -> S=Simulation(filename="xyz",runs=10,samplesize=3,seed=setRNG(),distribution=N) -> Data(S) # no data yet -NULL -> simulate(S) -> Data(S) # now there are random numbers -, , 1 - - [,1] -[1,] -0.6264538 -[2,] 0.1836433 -[3,] -0.8356286 - -, , 2 - - [,1] -[1,] 1.5952808 -[2,] 0.3295078 -[3,] -0.8204684 - -, , 3 - - [,1] -[1,] 0.4874291 -[2,] 0.7383247 -[3,] 0.5757814 - -, , 4 - - [,1] -[1,] -0.3053884 -[2,] 1.5117812 -[3,] 0.3898432 - -, , 5 - - [,1] -[1,] -0.6212406 -[2,] -2.2146999 -[3,] 1.1249309 - -, , 6 - - [,1] -[1,] -0.04493361 -[2,] -0.01619026 -[3,] 0.94383621 - -, , 7 - - [,1] -[1,] 0.8212212 -[2,] 0.5939013 -[3,] 0.9189774 - -, , 8 - - [,1] -[1,] 0.78213630 -[2,] 0.07456498 -[3,] -1.98935170 - -, , 9 - - [,1] -[1,] 0.61982575 -[2,] -0.05612874 -[3,] -0.15579551 - -, , 10 - - [,1] -[1,] -1.4707524 -[2,] -0.4781501 -[3,] 0.4179416 - -> Data(S) # the same data as before because the seed has not changed -, , 1 - - [,1] -[1,] -0.6264538 -[2,] 0.1836433 -[3,] -0.8356286 - -, , 2 - - [,1] -[1,] 1.5952808 -[2,] 0.3295078 -[3,] -0.8204684 - -, , 3 - - [,1] -[1,] 0.4874291 -[2,] 0.7383247 -[3,] 0.5757814 - -, , 4 - - [,1] -[1,] -0.3053884 -[2,] 1.5117812 -[3,] 0.3898432 - -, , 5 - - [,1] -[1,] -0.6212406 -[2,] -2.2146999 -[3,] 1.1249309 - -, , 6 - - [,1] -[1,] -0.04493361 -[2,] -0.01619026 -[3,] 0.94383621 - -, , 7 - - [,1] -[1,] 0.8212212 -[2,] 0.5939013 -[3,] 0.9189774 - -, , 8 - - [,1] -[1,] 0.78213630 -[2,] 0.07456498 -[3,] -1.98935170 - -, , 9 - - [,1] -[1,] 0.61982575 -[2,] -0.05612874 -[3,] -0.15579551 - -, , 10 - - [,1] -[1,] -1.4707524 -[2,] -0.4781501 -[3,] 0.4179416 - -> seed(S)=setRNG() -> simulate(S) -> Data(S) # different data -, , 1 - - [,1] -[1,] 1.3586796 -[2,] -0.1027877 -[3,] 0.3876716 - -, , 2 - - [,1] -[1,] -0.05380504 -[2,] -1.37705956 -[3,] -0.41499456 - -, , 3 - - [,1] -[1,] -0.3942900 -[2,] -0.0593134 -[3,] 1.1000254 - -, , 4 - - [,1] -[1,] 0.7631757 -[2,] -0.1645236 -[3,] -0.2533617 - -, , 5 - - [,1] -[1,] 0.6969634 -[2,] 0.5566632 -[3,] -0.6887557 - -, , 6 - - [,1] -[1,] -0.7074952 -[2,] 0.3645820 -[3,] 0.7685329 - -, , 7 - - [,1] -[1,] -0.1123462 -[2,] 0.8811077 -[3,] 0.3981059 - -, , 8 - - [,1] -[1,] -0.6120264 -[2,] 0.3411197 -[3,] -1.1293631 - -, , 9 - - [,1] -[1,] 1.4330237 -[2,] 1.9803999 -[3,] -0.3672215 - -, , 10 - - [,1] -[1,] -1.0441346 -[2,] 0.5697196 -[3,] -0.1350546 - -> savedata(S) # saves the object in the directory of R... -> load("xyz") # loads it again... -> Data(S) # ...without the data - use simulate to return it! -NULL -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("Simulation-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("cload") -> ### * cload -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: cload -> ### Title: cload -> ### Aliases: cload -> ### Keywords: methods file -> -> ### ** Examples -> -> # see Dataclass and Evaluation for examples -> ## The function is currently defined as -> function(filename){ -+ eval.parent(parse(text=paste("load(\"",filename,".comment\")", sep = ""))) -+ } -function (filename) -{ - eval.parent(parse(text = paste("load(\"", filename, ".comment\")", - sep = ""))) -} -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("cload", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("distrSimMASK") -> ### * distrSimMASK -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: distrSimMASK -> ### Title: Masking of/by other functions in package "distrSim" -> ### Aliases: distrSimMASK MASKING -> ### Keywords: programming distribution documentation -> -> ### ** Examples -> -> distrSimMASK() + +R Under development (unstable) (2015-05-02 r68310) -- "Unsuffered Consequences" +Copyright (C) 2015 The R Foundation for Statistical Computing +Platform: x86_64-unknown-linux-gnu (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 <- "distrSim" +> source(file.path(R.home("share"), "R", "examples-header.R")) +> options(warn = 1) +> library('distrSim') +Loading required package: setRNG +Loading required package: distr +Loading required package: startupmsg +:startupmsg> Utilities for Start-Up Messages (version 0.9.1) +: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.7) +: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.6) +: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 + +:distrSim> Simulation Classes Based on Package distr (version +:distrSim> 2.6) +:distrSim> +:distrSim> Some functions from package 'stats' are intentionally +:distrSim> masked ---see distrSimMASK(). +:distrSim> +:distrSim> +:distrSim> For more information see ?"distrSim", +:distrSim> NEWS("distrSim"), as well as +:distrSim> http://distr.r-forge.r-project.org/ +:distrSim> Package "distrDoc" provides a vignette to this package +:distrSim> as well as to several related packages; try +:distrSim> vignette("distr"). + + +Attaching package: ?distrSim? + +The following object is masked from ?package:stats?: + + simulate + +The following object is masked from ?package:base?: + + rbind + +> +> base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') +> cleanEx() +> nameEx("Contsimulation-class") +> ### * Contsimulation-class +> +> flush(stderr()); flush(stdout()) +> +> ### Name: Contsimulation-class +> ### Title: Class "Contsimulation" +> ### Aliases: Contsimulation-class Contsimulation +> ### initialize,Contsimulation-method +> ### Keywords: manip +> +> ### ** Examples +> +> N <- Norm() # N is a standard normal distribution. +> C <- Cauchy() # C is a Cauchy distribution +> cs <- Contsimulation(filename = "csim", ++ runs = 10, ++ samplesize = 3, ++ seed = setRNG(), ++ distribution.id = N, ++ distribution.c = C, ++ rate = 0.1) +> simulate(cs) +> # Each of the 30 random numbers is ideal (N-distributed) with +> # probability 0.9 and contaminated (C-distributed) with +> # probability = 0.1 +> Data(cs) +, , 1 + + [,1] +[1,] -0.6264538 +[2,] 0.1836433 +[3,] -0.8356286 + +, , 2 + + [,1] +[1,] 1.5952808 +[2,] 0.3295078 +[3,] -0.8204684 + +, , 3 + + [,1] +[1,] 0.4874291 +[2,] 0.7383247 +[3,] 0.5757814 + +, , 4 + + [,1] +[1,] -0.3053884 +[2,] 1.5117812 +[3,] 0.3898432 + +, , 5 + + [,1] +[1,] -0.6212406 +[2,] 1.7376135 +[3,] 1.1249309 + +, , 6 + + [,1] +[1,] -0.04493361 +[2,] -0.01619026 +[3,] 0.94383621 + +, , 7 + + [,1] +[1,] -0.8415496 +[2,] 0.5939013 +[3,] 4.8029372 + +, , 8 + + [,1] +[1,] 0.78213630 +[2,] 0.07456498 +[3,] -1.98935170 + +, , 9 + + [,1] +[1,] 0.61982575 +[2,] -0.05612874 +[3,] -0.15579551 + +, , 10 + + [,1] +[1,] -1.4707524 +[2,] -0.4781501 +[3,] 0.4179416 + +> Data.id(cs) +, , 1 + + [,1] +[1,] -0.6264538 +[2,] 0.1836433 +[3,] -0.8356286 + +, , 2 + + [,1] +[1,] 1.5952808 +[2,] 0.3295078 +[3,] -0.8204684 + +, , 3 + + [,1] +[1,] 0.4874291 +[2,] 0.7383247 +[3,] 0.5757814 + +, , 4 + + [,1] +[1,] -0.3053884 +[2,] 1.5117812 +[3,] 0.3898432 + +, , 5 + + [,1] +[1,] -0.6212406 +[2,] -2.2146999 +[3,] 1.1249309 + +, , 6 + + [,1] +[1,] -0.04493361 +[2,] -0.01619026 +[3,] 0.94383621 + +, , 7 + + [,1] +[1,] 0.8212212 +[2,] 0.5939013 +[3,] 0.9189774 + +, , 8 + + [,1] +[1,] 0.78213630 +[2,] 0.07456498 +[3,] -1.98935170 + +, , 9 + + [,1] +[1,] 0.61982575 +[2,] -0.05612874 +[3,] -0.15579551 + +, , 10 + + [,1] +[1,] -1.4707524 +[2,] -0.4781501 +[3,] 0.4179416 + +> Data.c(cs) +, , 1 + + [,1] +[1,] -0.2807547 +[2,] 1.3197748 +[3,] 7.7332079 + +, , 2 + + [,1] +[1,] 1.720315 +[2,] -1.949413 +[3,] 1.051684 + +, , 3 + + [,1] +[1,] 14.8138609 +[2,] -0.9024312 +[3,] 0.2710277 + +, , 4 + + [,1] +[1,] -0.4130314 +[2,] 1.8065104 +[3,] -0.5520464 + +, , 5 + + [,1] +[1,] 1.913070 +[2,] 1.737613 +[3,] 13.435126 + +, , 6 + + [,1] +[1,] -0.3522399 +[2,] -0.4540178 +[3,] 2.7773206 + +, , 7 + + [,1] +[1,] -0.8415496 +[2,] -0.1243574 +[3,] 4.8029372 + +, , 8 + + [,1] +[1,] -1.268374 +[2,] 3.077498 +[3,] 1.635911 + +, , 9 + + [,1] +[1,] -0.9564330 +[2,] 0.7395454 +[3,] -1.2798578 + +, , 10 + + [,1] +[1,] 0.4020896 +[2,] 0.9720478 +[3,] 0.4833067 + +> ind(cs) + [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] +[1,] 0 0 0 0 0 0 1 0 0 0 +[2,] 0 0 0 0 1 0 0 0 0 0 +[3,] 0 0 0 0 0 0 1 0 0 0 +> summary(cs) +name of simulation: csim +rate of contamination: 0.100000 +real Data: +dimension of the observations: 1 +number of runs: 10 +size of sample: 3 +, , 1 + + [,1] +Min. -0.8356 +1st Qu. -0.7310 +Median -0.6265 +Mean -0.4261 +3rd Qu. -0.2214 +Max. 0.1836 + +, , 2 + + [,1] +Min. -0.8205 +1st Qu. -0.2455 +Median 0.3295 +Mean 0.3681 +3rd Qu. 0.9624 +Max. 1.5950 + +, , 3 + + [,1] +Min. 0.4874 +1st Qu. 0.5316 +Median 0.5758 +Mean 0.6005 +3rd Qu. 0.6571 +Max. 0.7383 + +, , 4 + + [,1] +Min. -0.30540 +1st Qu. 0.04223 +Median 0.38980 +Mean 0.53210 +3rd Qu. 0.95080 +Max. 1.51200 + +, , 5 + + [,1] +Min. -0.6212 +1st Qu. 0.2518 +Median 1.1250 +Mean 0.7471 +3rd Qu. 1.4310 +Max. 1.7380 + +, , 6 + + [,1] +Min. -0.04493 +1st Qu. -0.03056 +Median -0.01619 +Mean 0.29420 +3rd Qu. 0.46380 +Max. 0.94380 + +> Data(cs) # different data +, , 1 + + [,1] +[1,] -0.6264538 +[2,] 0.1836433 +[3,] -0.8356286 + +, , 2 + + [,1] +[1,] 1.5952808 +[2,] 0.3295078 +[3,] -0.8204684 + +, , 3 + + [,1] +[1,] 0.4874291 +[2,] 0.7383247 +[3,] 0.5757814 + +, , 4 + + [,1] +[1,] -0.3053884 +[2,] 1.5117812 +[3,] 0.3898432 + +, , 5 + + [,1] +[1,] -0.6212406 +[2,] 1.7376135 +[3,] 1.1249309 + +, , 6 + + [,1] +[1,] -0.04493361 +[2,] -0.01619026 +[3,] 0.94383621 + +, , 7 + + [,1] +[1,] -0.8415496 +[2,] 0.5939013 +[3,] 4.8029372 + +, , 8 + + [,1] +[1,] 0.78213630 +[2,] 0.07456498 +[3,] -1.98935170 + +, , 9 + + [,1] +[1,] 0.61982575 +[2,] -0.05612874 +[3,] -0.15579551 + +, , 10 + + [,1] +[1,] -1.4707524 +[2,] -0.4781501 +[3,] 0.4179416 + +> savedata(cs) # saves the object in the working directory of R... +> load("csim") # loads it again... +> Data(cs) # ...without the data - use simulate to return it! +NULL +> +> +> +> cleanEx() +> nameEx("Dataclass-class") +> ### * Dataclass-class +> +> flush(stderr()); flush(stdout()) +> +> ### Name: Dataclass-class +> ### Title: Class "Dataclass" +> ### Aliases: Dataclass-class initialize,Dataclass-method +> ### Keywords: manip +> +> ### ** Examples +> +> D66 <- Dataclass(filename="N74", Data = matrix(1:36,6)) +> D66 +name of Dataclass: Data-Set +filename of Dataclass: N74 +number of runs: 1 +dimension of the observations: 6 +size of sample: 6 +object was generated by version: 2.6 +> # +> D <- Dataclass(Data = array(c(1,2,3,4,5,6),c(samplesize=2,obsdim=3,Runs=1)), ++ filename = "xyz.sav") +> # A new object of type "Dataclass" is created. +> # +> isOldVersion(D) ##NO! +[1] FALSE +> # +> savedata(D) +> # creates a file called "xyz.sav" where the information is saved and a +> # copy "xyz.sav.comment" without data +> Data(D) <- array(c(11,12,13,14,15,16),c(samplesize=2,obsdim=3,Runs=1)) # changes the data of D +> cload("xyz.sav") # loads the object without data - it is called "D.comment" +> D.comment +name of Dataclass: Data-Set +filename of Dataclass: xyz.sav +number of runs: 1 +dimension of the observations: 3 +size of sample: 2 +object was generated by version: 2.6 +> load("xyz.sav") # loads the original object "D" +> Data(D) # the original data: matrix(c(1,2,3,4,5,6),2) +, , 1 + + [,1] [,2] [,3] +[1,] 1 3 5 +[2,] 2 4 6 + +> #if you have distrTEst available: +> #evaluate(object = D, estimator = mean) # returns the mean of each variable +> +> +> +> cleanEx() +> nameEx("Simulation-class") +> ### * Simulation-class +> +> flush(stderr()); flush(stdout()) +> +> ### Name: Simulation-class +> ### Title: Class "Simulation" +> ### Aliases: Simulation-class Simulation initialize,Simulation-method +> ### Keywords: manip +> +> ### ** Examples +> +> N=Norm() # N is a standard normal distribution. +> S=Simulation(filename="xyz",runs=10,samplesize=3,seed=setRNG(),distribution=N) +> Data(S) # no data yet +NULL +> simulate(S) +> Data(S) # now there are random numbers +, , 1 + + [,1] +[1,] -0.6264538 +[2,] 0.1836433 +[3,] -0.8356286 + +, , 2 + + [,1] +[1,] 1.5952808 +[2,] 0.3295078 +[3,] -0.8204684 + +, , 3 + + [,1] +[1,] 0.4874291 +[2,] 0.7383247 +[3,] 0.5757814 + +, , 4 + + [,1] +[1,] -0.3053884 +[2,] 1.5117812 +[3,] 0.3898432 + +, , 5 + + [,1] +[1,] -0.6212406 +[2,] -2.2146999 +[3,] 1.1249309 + +, , 6 + + [,1] +[1,] -0.04493361 +[2,] -0.01619026 +[3,] 0.94383621 + +, , 7 + + [,1] +[1,] 0.8212212 +[2,] 0.5939013 +[3,] 0.9189774 + +, , 8 + + [,1] +[1,] 0.78213630 +[2,] 0.07456498 +[3,] -1.98935170 + +, , 9 + + [,1] +[1,] 0.61982575 +[2,] -0.05612874 +[3,] -0.15579551 + +, , 10 + + [,1] +[1,] -1.4707524 +[2,] -0.4781501 +[3,] 0.4179416 + +> Data(S) # the same data as before because the seed has not changed +, , 1 + + [,1] +[1,] -0.6264538 +[2,] 0.1836433 +[3,] -0.8356286 + +, , 2 + + [,1] +[1,] 1.5952808 +[2,] 0.3295078 +[3,] -0.8204684 + +, , 3 + + [,1] +[1,] 0.4874291 +[2,] 0.7383247 +[3,] 0.5757814 + +, , 4 + + [,1] +[1,] -0.3053884 +[2,] 1.5117812 +[3,] 0.3898432 + +, , 5 + + [,1] +[1,] -0.6212406 +[2,] -2.2146999 +[3,] 1.1249309 + +, , 6 + + [,1] +[1,] -0.04493361 +[2,] -0.01619026 +[3,] 0.94383621 + +, , 7 + + [,1] +[1,] 0.8212212 +[2,] 0.5939013 +[3,] 0.9189774 + +, , 8 + + [,1] +[1,] 0.78213630 +[2,] 0.07456498 +[3,] -1.98935170 + +, , 9 + + [,1] +[1,] 0.61982575 +[2,] -0.05612874 +[3,] -0.15579551 + +, , 10 + + [,1] +[1,] -1.4707524 +[2,] -0.4781501 +[3,] 0.4179416 + +> seed(S)=setRNG() +> simulate(S) +> Data(S) # different data +, , 1 + + [,1] +[1,] 1.3586796 +[2,] -0.1027877 +[3,] 0.3876716 + +, , 2 + + [,1] +[1,] -0.05380504 +[2,] -1.37705956 +[3,] -0.41499456 + +, , 3 + + [,1] +[1,] -0.3942900 +[2,] -0.0593134 +[3,] 1.1000254 + +, , 4 + + [,1] +[1,] 0.7631757 +[2,] -0.1645236 +[3,] -0.2533617 + +, , 5 + + [,1] +[1,] 0.6969634 +[2,] 0.5566632 +[3,] -0.6887557 + +, , 6 + + [,1] +[1,] -0.7074952 +[2,] 0.3645820 +[3,] 0.7685329 + +, , 7 + + [,1] +[1,] -0.1123462 +[2,] 0.8811077 +[3,] 0.3981059 + +, , 8 + + [,1] +[1,] -0.6120264 +[2,] 0.3411197 +[3,] -1.1293631 + +, , 9 + + [,1] +[1,] 1.4330237 +[2,] 1.9803999 +[3,] -0.3672215 + +, , 10 + + [,1] +[1,] -1.0441346 +[2,] 0.5697196 +[3,] -0.1350546 + +> savedata(S) # saves the object in the directory of R... +> load("xyz") # loads it again... +> Data(S) # ...without the data - use simulate to return it! +NULL +> +> +> +> cleanEx() +> nameEx("cload") +> ### * cload +> +> flush(stderr()); flush(stdout()) +> +> ### Name: cload +> ### Title: cload +> ### Aliases: cload +> ### Keywords: methods file +> +> ### ** Examples +> +> # see Dataclass and Evaluation for examples +> ## The function is currently defined as +> function(filename){ ++ eval.parent(parse(text=paste("load(\"",filename,".comment\")", sep = ""))) ++ } +function (filename) +{ + eval.parent(parse(text = paste("load(\"", filename, ".comment\")", + sep = ""))) +} +> +> +> +> cleanEx() +> nameEx("distrSimMASK") +> ### * distrSimMASK +> +> flush(stderr()); flush(stdout()) +> +> ### Name: distrSimMASK +> ### Title: Masking of/by other functions in package "distrSim" +> ### Aliases: distrSimMASK MASKING +> ### Keywords: programming distribution documentation +> +> ### ** Examples +> +> distrSimMASK() ###################################################################### # On masking of and by other functions in package "distrSim" ###################################################################### @@ -880,105 +854,98 @@ we intentionally mask the base function "rbind" however "rbind" may still be used in exactly the same way as before masking. -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("distrSimMASK", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("distrSimoptions") -> ### * distrSimoptions -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: distrSimoptions -> ### Title: functions to change the global variables of the package -> ### 'distrSim' -> ### Aliases: distrSimoptions getdistrSimOption MaxNumberofPlottedObsDims -> ### MaxNumberofPlottedRuns MaxNumberofSummarizedObsDims -> ### MaxNumberofSummarizedRuns -> ### Keywords: misc -> -> ### ** Examples -> -> distrSimoptions() -$MaxNumberofPlottedObs -[1] 4000 - -$MaxNumberofPlottedObsDims -[1] 6 - -$MaxNumberofPlottedRuns -[1] 6 - -$MaxNumberofSummarizedObsDims -[1] 6 - -$MaxNumberofSummarizedRuns -[1] 6 - -$MaxNumberofPrintedObsDims -[1] 10 - -$MaxNumberofPrintedObs -[1] 10 - -$MaxNumberofPrintedRuns -[1] 100 - -> distrSimoptions("MaxNumberofPlottedObsDims") -$MaxNumberofPlottedObsDims -[1] 6 - -> distrSimoptions("MaxNumberofPlottedObsDims" = 5) -> # or -> getdistrSimOption("MaxNumberofPlottedObsDims") -[1] 5 -> -> -> [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/distr -r 1008 From noreply at r-forge.r-project.org Sun May 3 07:15:55 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 07:15:55 +0200 (CEST) Subject: [Distr-commits] r1009 - branches/distr-2.6/pkg/distrSim Message-ID: <20150503051555.25358187765@r-forge.r-project.org> Author: stamats Date: 2015-05-03 07:15:54 +0200 (Sun, 03 May 2015) New Revision: 1009 Modified: branches/distr-2.6/pkg/distrSim/DESCRIPTION Log: minor change of Title and Description due to warning during check Modified: branches/distr-2.6/pkg/distrSim/DESCRIPTION =================================================================== --- branches/distr-2.6/pkg/distrSim/DESCRIPTION 2015-05-03 05:15:42 UTC (rev 1008) +++ branches/distr-2.6/pkg/distrSim/DESCRIPTION 2015-05-03 05:15:54 UTC (rev 1009) @@ -1,8 +1,8 @@ Package: distrSim Version: 2.6 -Date: 2013-09-13 -Title: Simulation Classes Based on Package distr -Description: (S4-)classes for setting up a coherent framework for simulation within the distr family of packages. +Date: 2015-05-03 +Title: Simulation Classes Based on Package 'distr' +Description: S4-classes for setting up a coherent framework for simulation within the distr family of packages. Depends: R(>= 2.14.0), methods, graphics, setRNG(>= 2006.2-1), distr(>= 2.5.2) Suggests: distrEx(>= 2.2) Imports: startupmsg From noreply at r-forge.r-project.org Sun May 3 07:16:15 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 07:16:15 +0200 (CEST) Subject: [Distr-commits] r1010 - branches/distr-2.6/pkg/distrSim/inst Message-ID: <20150503051615.DFE6C187904@r-forge.r-project.org> Author: stamats Date: 2015-05-03 07:16:15 +0200 (Sun, 03 May 2015) New Revision: 1010 Modified: branches/distr-2.6/pkg/distrSim/inst/CITATION Log: removed an old (no longer working) link to distr.pdf Modified: branches/distr-2.6/pkg/distrSim/inst/CITATION =================================================================== --- branches/distr-2.6/pkg/distrSim/inst/CITATION 2015-05-03 05:15:54 UTC (rev 1009) +++ branches/distr-2.6/pkg/distrSim/inst/CITATION 2015-05-03 05:16:15 UTC (rev 1010) @@ -14,7 +14,6 @@ number = 2, pages = "2--6", month = "May", - url = "http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR/distr.pdf", pdf = "http://CRAN.R-project.org/doc/Rnews/Rnews_2006-2.pdf", textVersion = paste("Ruckdeschel, P., Kohl, M., Stabla, T., & Camphausen, F. (2006)", "S4 Classes for Distributions")) From noreply at r-forge.r-project.org Sun May 3 07:19:06 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 07:19:06 +0200 (CEST) Subject: [Distr-commits] r1011 - branches/distr-2.6/pkg/distrTEst/inst Message-ID: <20150503051906.85AFC1878EE@r-forge.r-project.org> Author: stamats Date: 2015-05-03 07:19:06 +0200 (Sun, 03 May 2015) New Revision: 1011 Modified: branches/distr-2.6/pkg/distrTEst/inst/CITATION Log: removed an old (no longer working) link to distr.pdf Modified: branches/distr-2.6/pkg/distrTEst/inst/CITATION =================================================================== --- branches/distr-2.6/pkg/distrTEst/inst/CITATION 2015-05-03 05:16:15 UTC (rev 1010) +++ branches/distr-2.6/pkg/distrTEst/inst/CITATION 2015-05-03 05:19:06 UTC (rev 1011) @@ -14,7 +14,6 @@ number = 2, pages = "2--6", month = "May", - url = "http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR/distr.pdf", pdf = "http://CRAN.R-project.org/doc/Rnews/Rnews_2006-2.pdf", textVersion = paste("Ruckdeschel, P., Kohl, M., Stabla, T., & Camphausen, F. (2006)", "S4 Classes for Distributions")) From noreply at r-forge.r-project.org Sun May 3 07:19:28 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 07:19:28 +0200 (CEST) Subject: [Distr-commits] r1012 - branches/distr-2.6/pkg/distrTEst Message-ID: <20150503051928.6F51B1878EE@r-forge.r-project.org> Author: stamats Date: 2015-05-03 07:19:28 +0200 (Sun, 03 May 2015) New Revision: 1012 Modified: branches/distr-2.6/pkg/distrTEst/DESCRIPTION Log: minor change of Title due to warning during check Modified: branches/distr-2.6/pkg/distrTEst/DESCRIPTION =================================================================== --- branches/distr-2.6/pkg/distrTEst/DESCRIPTION 2015-05-03 05:19:06 UTC (rev 1011) +++ branches/distr-2.6/pkg/distrTEst/DESCRIPTION 2015-05-03 05:19:28 UTC (rev 1012) @@ -1,7 +1,7 @@ Package: distrTEst Version: 2.6 -Date: 2013-09-18 -Title: Estimation and Testing Classes Based on Package distr +Date: 2015-05-03 +Title: Estimation and Testing Classes Based on Package 'distr' Description: Evaluation (S4-)classes based on package distr for evaluating procedures (estimators/tests) at data/simulation in a unified way. Depends: R(>= 2.6.0), methods, graphics, setRNG(>= 2006.2-1), distrSim(>= 2.2) From noreply at r-forge.r-project.org Sun May 3 07:28:15 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 3 May 2015 07:28:15 +0200 (CEST) Subject: [Distr-commits] r1013 - branches/distr-2.6/pkg/distrTEst/tests/Examples Message-ID: <20150503052815.37F8018681D@r-forge.r-project.org> Author: stamats Date: 2015-05-03 07:28:14 +0200 (Sun, 03 May 2015) New Revision: 1013 Modified: branches/distr-2.6/pkg/distrTEst/tests/Examples/distrTEst-Ex.Rout.save Log: updated Rout.save file Modified: branches/distr-2.6/pkg/distrTEst/tests/Examples/distrTEst-Ex.Rout.save =================================================================== --- branches/distr-2.6/pkg/distrTEst/tests/Examples/distrTEst-Ex.Rout.save 2015-05-03 05:19:28 UTC (rev 1012) +++ branches/distr-2.6/pkg/distrTEst/tests/Examples/distrTEst-Ex.Rout.save 2015-05-03 05:28:14 UTC (rev 1013) @@ -1,529 +1,507 @@ - -R version 3.0.1 Patched (2013-09-02 r63805) -- "Good Sport" -Copyright (C) 2013 The R Foundation for Statistical Computing -Platform: i386-w64-mingw32/i386 (32-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 <- "distrTEst" -> source(file.path(R.home("share"), "R", "examples-header.R")) -> options(warn = 1) -> options(pager = "console") -> base::assign(".ExTimings", "distrTEst-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') -> -> ### * -> library('distrTEst') -Loading required package: setRNG -Loading required package: distrSim -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 - -:distrSim> Simulation classes based on package distr (version -:distrSim> 2.5.2) -:distrSim> -:distrSim> Some functions from package 'stats' are intentionally -:distrSim> masked ---see distrSimMASK(). -:distrSim> -:distrSim> -:distrSim> For more information see ?"distrSim", -:distrSim> NEWS("distrSim"), as well as -:distrSim> http://distr.r-forge.r-project.org/ -:distrSim> Package "distrDoc" provides a vignette to this package -:distrSim> as well as to several related packages; try -:distrSim> vignette("distr"). - - -Attaching package: 'distrSim' - -The following object is masked from 'package:stats': - - simulate - -The following object is masked from 'package:base': - - rbind - -:distrTEst> Estimation and Testing classes based on package -:distrTEst> distr (version 2.5) -:distrTEst> -:distrTEst> For more information see ?"distrTEst", -:distrTEst> NEWS("distrTEst"), as well as -:distrTEst> http://distr.r-forge.r-project.org/ -:distrTEst> Package "distrDoc" provides a vignette to this -:distrTEst> package as well as to several related packages; try -:distrTEst> vignette("distr"). - -> -> base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') -> cleanEx() -> nameEx("Evaluation-class") -> ### * Evaluation-class -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: Evaluation-class -> ### Title: Class "Evaluation" -> ### Aliases: Evaluation-class initialize,Evaluation-method -> ### Keywords: manip -> -> ### ** Examples -> -> N <- Norm() # N is a standard normal distribution. -> C <- Cauchy() # C is a Cauchy distribution -> cs <- Contsimulation(filename = "csim", -+ runs = 5, -+ samplesize=5000, -+ seed=setRNG(), -+ distribution.id = N, -+ distribution.c = C, -+ rate = 0.1) -> simulate(cs) -> # Each of the 25000 random numbers is ideal (N-distributed) with -> # probability 0.9 and contaminated (C-distributed) with probability = 0.1 -> summary(cs) -name of simulation: csim -rate of contamination: 0.100000 -real Data: -dimension of the observations: 1 -number of runs: 5 -size of sample: 5000 -, , 1 - - [,1] -Min. -4.633e+02 -1st Qu. -6.888e-01 -Median -9.882e-03 -Mean -5.081e-02 -3rd Qu. 7.174e-01 -Max. 1.133e+02 - -, , 2 - - [,1] -Min. -70.36000 -1st Qu. -0.69270 -Median -0.01484 -Mean -0.03787 -3rd Qu. 0.65770 -Max. 35.49000 - -, , 3 - - [,1] -Min. -198.00000 -1st Qu. -0.72410 -Median -0.05111 -Mean 0.41380 -3rd Qu. 0.67300 -Max. 1753.00000 - -, , 4 - - [,1] -Min. -3.247e+02 -1st Qu. -6.898e-01 -Median 5.874e-04 -Mean -1.625e-01 -3rd Qu. 6.886e-01 -Max. 4.682e+01 - -, , 5 - - [,1] -Min. -339.10000 -1st Qu. -0.65140 -Median 0.05992 -Mean -0.01367 -3rd Qu. 0.69830 -Max. 131.50000 - -> ev1 <- evaluate(cs, mean, resname="mean") # estimates the data with mean -> ev1 # bad results -An Evaluation Object -name of Dataobject: object -name of Datafile: csim -estimator: mean -Result: 'data.frame': 5 obs. of 2 variables: - $ mean.id: num -0.00319 -0.00989 -0.02207 0.01369 0.02614 - $ mean.re: num -0.0508 -0.0379 0.4138 -0.1625 -0.0137 -> ev2 <- evaluate(cs,median, resname="median") # estimates the data with median -> ev2 # better results because median is robust -An Evaluation Object -name of Dataobject: object -name of Datafile: csim -estimator: median -Result: 'data.frame': 5 obs. of 2 variables: - $ medn.id: num -0.01549 -0.01739 -0.04523 0.00723 0.05344 - $ medn.re: num -0.009882 -0.014837 -0.051108 0.000587 0.059924 -> savedata(ev1) -[1] "csim.mean" -[1] "ev1" -[1] "csim.mean.comment" -[1] "ev1.comment" -> # saves the evaluation with result as "csim.mean" and without result as -> # "csim.mean.comment" in the working directory # of R - "csim" is the -> # filename of the Contsimulation object, mean the name of the estimator -> rm(ev1) -> cload("csim.mean") -> # loads the evaluation without result - the object is called ev1.comment -> ev1.comment -An Evaluation Object -name of Dataobject: object -name of Datafile: csim -estimator: mean -> load("csim.mean") # loads the evaluation with result -> ev1 -An Evaluation Object -name of Dataobject: object -name of Datafile: csim -estimator: mean -Result: 'data.frame': 5 obs. of 2 variables: - $ mean.id: num -0.00319 -0.00989 -0.02207 0.01369 0.02614 - $ mean.re: num -0.0508 -0.0379 0.4138 -0.1625 -0.0137 -> plot(ev1) -> # -> #another function to be evaluated: -> severalThings<- function(x) {list("mean"=mean(x),"sd"=sd(as.vector(x)), "mad"=mad(x))} -> ev3 <- evaluate(cs, severalThings, resname="several") -> plot(ev3) -> plot(ev3, ylim=c(0,10), col=c("blue","green", "red")) -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("Evaluation-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("EvaluationList-class") -> ### * EvaluationList-class -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: EvaluationList-class -> ### Title: Class "EvaluationList" -> ### Aliases: Elist EvaluationList EvaluationList-class -> ### initialize,EvaluationList-method savedata,EvaluationList-method -> ### name,EvaluationList-method name<-,EvaluationList-method -> ### Elist,EvaluationList-method -> ### Keywords: list manip -> -> ### ** Examples -> -> N <- Norm() # N is a standard normal distribution. -> C <- Cauchy() # C is a Cauchy distribution -> cs <- Contsimulation(filename = "csim", -+ runs = 15, -+ samplesize=500, -+ seed=setRNG(), -+ distribution.id = N, -+ distribution.c = C, -+ rate = 0.1) -> simulate(cs) -> # Each of the 25000 random numbers is ideal (N-distributed) with -> # probability 0.9 and contaminated (C-distributed) with probability = 0.1 -> summary(cs) -name of simulation: csim -rate of contamination: 0.100000 -real Data: -dimension of the observations: 1 -number of runs: 15 -size of sample: 500 -, , 1 - - [,1] -Min. -7.832000 -1st Qu. -0.592900 -Median -0.006142 -Mean 0.262100 -3rd Qu. 0.681900 -Max. 76.610000 - -, , 2 - - [,1] -Min. -20.18000 -1st Qu. -0.79010 -Median -0.03902 -Mean 0.09946 -3rd Qu. 0.71340 -Max. 69.34000 - -, , 3 - - [,1] -Min. -107.60000 -1st Qu. -0.71170 -Median -0.07457 -Mean -0.23260 -3rd Qu. 0.72740 -Max. 4.94800 - -, , 4 - - [,1] -Min. -16.20000 -1st Qu. -0.67080 -Median 0.02934 -Mean 0.17750 -3rd Qu. 0.76710 -Max. 52.53000 - -, , 5 - - [,1] -Min. -4.05100 -1st Qu. -0.69020 -Median -0.05908 -Mean 0.01636 -3rd Qu. 0.73180 -Max. 14.23000 - -, , 6 - - [,1] -Min. -6.67900 -1st Qu. -0.60520 -Median -0.01256 -Mean -0.01041 -3rd Qu. 0.67910 -Max. 6.83300 - -> ev1 <- evaluate(cs, mean) # estimates the data with mean -> ev1 # bad results -An Evaluation Object -name of Dataobject: object -name of Datafile: csim -estimator: mean -Result: 'data.frame': 15 obs. of 2 variables: - $ mean.id: num 0.02264 -0.04594 -0.00299 -0.02954 0.0091 ... - $ mean.re: num 0.2621 0.0995 -0.2326 0.1775 0.0164 ... -> ev2 <- evaluate(cs,median) # estimates the data with median -> ev2 # better results because median is robust -An Evaluation Object -name of Dataobject: object -name of Datafile: csim -estimator: median -Result: 'data.frame': 15 obs. of 2 variables: - $ medn.id: num -0.0368 -0.0213 -0.0536 -0.0189 -0.0482 ... - $ medn.re: num -0.00614 -0.03902 -0.07457 0.02934 -0.05908 ... -> savedata(ev1) -[1] "csim.mean" -[1] "ev1" -[1] "csim.mean.comment" -[1] "ev1.comment" -> # saves the EvaluationList with result as "csim.mean" and without result as -> # "csim.mean.comment" in the working directory # of R - "csim" is the -> # filename of the Contsimulation object, mean the name of the estimator -> rm(ev1) -> cload("csim.mean") -> # loads the EvaluationList without result - the object is called ev1.comment -> ev1.comment -An Evaluation Object -name of Dataobject: object -name of Datafile: csim -estimator: mean -> load("csim.mean") # loads the EvaluationList with result -> ev1 -An Evaluation Object -name of Dataobject: object -name of Datafile: csim -estimator: mean -Result: 'data.frame': 15 obs. of 2 variables: - $ mean.id: num 0.02264 -0.04594 -0.00299 -0.02954 0.0091 ... - $ mean.re: num 0.2621 0.0995 -0.2326 0.1775 0.0164 ... -> ElistObj <- EvaluationList(ev1,ev2,name0="myEvalList") -> plot(ElistObj,ylim=matrix(c(-0.5,0.5,0.5,4),nrow=2),main=c("location","scale")) -> plot(ElistObj,ylim=c(-0.5,0.5),main=c("location"),runs0=3:12,dims0=1,evals0=2) -> ElistObj -An EvaluationList Object -name of Evaluation List: myEvalList -name of Dataobject: object -name of Datafile: csim ----------------------------------- -An Evaluation Object -estimator: mean -Result: 'data.frame': 15 obs. of 2 variables: - $ mean.id: num 0.02264 -0.04594 -0.00299 -0.02954 0.0091 ... - $ mean.re: num 0.2621 0.0995 -0.2326 0.1775 0.0164 ... ----------------------------------- -An Evaluation Object -estimator: median -Result: 'data.frame': 15 obs. of 2 variables: - $ medn.id: num -0.0368 -0.0213 -0.0536 -0.0189 -0.0482 ... - $ medn.re: num -0.00614 -0.03902 -0.07457 0.02934 -0.05908 ... -> summary(ElistObj) -name of Evaluation List: myEvalList -name of Dataobject: object -name of Datafile: csim ----------------------------------- -name of Evaluation: object -estimator: mean -Result: - mean.id mean.re - Min. :-0.056414 Min. :-0.33898 - 1st Qu.:-0.031666 1st Qu.:-0.03277 - Median :-0.006922 Median : 0.02029 - Mean :-0.006906 Mean : 0.02481 - 3rd Qu.: 0.005326 3rd Qu.: 0.13042 - Max. : 0.089858 Max. : 0.26208 ----------------------------------- -name of Evaluation: object -estimator: median -Result: - medn.id medn.re - Min. :-0.09221 Min. :-0.13948 - 1st Qu.:-0.05020 1st Qu.:-0.03568 - Median :-0.02996 Median :-0.02969 - Mean :-0.01646 Mean :-0.01515 - 3rd Qu.: 0.01899 3rd Qu.: 0.02496 - Max. : 0.08584 Max. : 0.07802 -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("EvaluationList-class", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> cleanEx() -> nameEx("distrTEstoptions") -> ### * distrTEstoptions -> -> flush(stderr()); flush(stdout()) -> -> base::assign(".ptime", proc.time(), pos = "CheckExEnv") -> ### Name: distrTEstoptions -> ### Title: functions to change the global variables of the package -> ### 'distrTEst' -> ### Aliases: distrTEstoptions getdistrTEstOption -> ### MaxNumberofPlottedEvaluationDims MaxNumberofPlottedEvaluations -> ### MaxNumberofSummarizedEvaluationDims MaxNumberofSummarizedEvaluations -> ### Keywords: misc -> -> ### ** Examples -> -> distrTEstoptions() -$MaxNumberofPlottedEvaluationDims -[1] 6 - -$MaxNumberofPlottedEvaluations -[1] 6 - -$MaxNumberofSummarizedEvaluations -[1] 15 - -$MaxNumberofPrintedEvaluations -[1] 15 - -> distrTEstoptions("MaxNumberofPlottedEvaluationDims") -$MaxNumberofPlottedEvaluationDims -[1] 6 - -> distrTEstoptions("MaxNumberofPlottedEvaluationDims" = 5) -> # or -> getdistrTEstOption("MaxNumberofPlottedEvaluationDims") -[1] 5 -> -> -> -> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv") -> base::cat("distrTEstoptions", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t") -> ### *