gbutils/0000755000176200001440000000000014244115037011724 5ustar liggesusersgbutils/NAMESPACE0000644000176200001440000000113114242721241013135 0ustar liggesusersimport(methods) importFrom(stats, rbinom, runif, uniroot) importFrom(utils, savehistory) importFrom(graphics, plot) importFrom(Rdpack, reprompt) exportMethods( pad # todo: is it necessary to export also methods for "pad<-"? ) exportClassPattern("objectPad") export( isargunnamed, isNA, mintersect, missing_arg, myouter, nposargs, pad, "pad<-", padcheck, parse_text, raw_history, shiftleft, shiftright, sim_complex, sim_numbers, sim_real, cdf2quantile, plotpdf, adjacencyOfClasses, pseudoInverse, rpoly ) gbutils/README.md0000644000176200001440000000522114243120457013204 0ustar liggesusers [![CRANStatusBadge](http://www.r-pkg.org/badges/version/gbutils)](https://cran.r-project.org/package=gbutils) [![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/gbutils)](https://www.r-pkg.org/pkg/gbutils) [![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/grand-total/gbutils?color=blue)](https://r-pkg.org/pkg/gbutils) [![R-CMD-check](https://github.com/GeoBosh/gbutils/workflows/R-CMD-check/badge.svg)](https://github.com/GeoBosh/gbutils/actions) Simulate real and complex numbers from distributions of their magnitude and arguments. Optionally, the magnitudes and/or arguments may be fixed in almost arbitrary ways. Plot density and distribution functions with automatic selection of suitable regions. Small programming utilities: check if an object is identical to NA, count positional arguments in a call, set intersection of more than two sets, check if an argument is unnamed, compute the graph of S4 classes in packages. # Installing gbutils The [latest stable version](https://cran.r-project.org/package=gbutils) is on CRAN. install.packages("gbutils") You can install the [development version](https://github.com/GeoBosh/gbutils) of `gbutils` from Github: library(devtools) install_github("GeoBosh/gbutils") # Overview Package `gbutils` is a collection of (mostly small) functions used interactively or in packages. ## Numeric computations - `sim_numbers()`, `sim_complex()`, `sim_real()` - Simulate real or complex numbers from (possibly partial) polar form specifications. - `cdf2quantile()` - Compute quantiles from a given distribution function. - `pseudoInverse()` - Compute pseudo-inverse matrices. - `rpoly()` - create polynomials with real coefficients from zeroes (roots) given in Cartesian or polar form. ## Graphics - `plotpdf()` - Plot functions with automatic determination of the "interesting" region (typically probability density and distribution functions) ## S4 classes - `adjacencyOfClasses()` - Create inheritance graphs of S4 classes defined in one or more packages. ## Programming utilities - `isNA()` - Is an object NA? - `isargunnamed()` - Is an element of a list named? - `missing_arg()` - Is an element of a pairlist missing? - `parse_text()` - Parse expressions. - `nposargs()` - Count the number of positional arguments used in a call. - `shiftleft()` `shiftright()` - Rotate vectors. ## Other - `mintersect()` - Set intersection of arbitrary number of arguments. - `myouter()` - Outer product using a non-vectorised function. - `raw_history()` Get the command history in a character vector. gbutils/man/0000755000176200001440000000000014244077073012506 5ustar liggesusersgbutils/man/raw_history.Rd0000644000176200001440000000143313501136655015345 0ustar liggesusers\name{raw_history} \alias{raw_history} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Get the command history } \description{ Get the command history.} \usage{ raw_history() } %- maybe also 'usage' for other objects documented here. \details{ The command history is saved to a temporary file with \code{savehistory} and read back into a character vector. } \value{ a character vector } \author{Georgi N. Boshnakov} %\note{ %%% ~~further notes~~ %} % %%% ~Make other sections like Warning with \section{Warning }{....} ~ % %\seealso{ %%% ~~objects to See Also as \code{\link{help}}, ~~~ %} \examples{ \dontrun{ hist <- raw_history() length(hist) } } % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \keyword{programming} gbutils/man/objectPad-class.Rd0000644000176200001440000000526213501136655015775 0ustar liggesusers\name{objectPad-class} \docType{class} \alias{objectPad-class} %\alias{pad,objectPad,missing-method} %\alias{pad,objectPad,ANY-method} \alias{pad<-,objectPad-method} \alias{initialize,objectPad-method} \title{Class "objectPad" objects and methods to store and retrieve information } \description{Objects of class "objectPad" can be used as storage of information. There are methods for storage and retrieval. } \section{Objects from the Class}{ Objects can be created by calls of the form \code{new("objectPad", ...)}. Currently the \code{...} arguments are ignored and an empty object is created. Objects of class "objectPad" have no user-level slots. Values are stored and retrieved with the function \code{pad}, for the former purpose using it on the left-hand side of an assignment. } \section{Slots}{ \describe{ \item{\code{.Data}:}{Object of class \code{"list"}, inherited from \code{"list"}. } } } \section{Extends}{ Class \code{"\linkS4class{list}"}, from data part. Class \code{"\linkS4class{vector}"}, by class "list", distance 2. } \section{Methods}{ \describe{ \item{initialize}{\code{signature(.Object = "objectPad")}: ... } \item{pad}{\code{signature(x = "objectPad", item = "missing")}: ... } \item{pad}{\code{signature(x = "objectPad", item = "ANY")}: ... } \item{pad<-}{\code{signature(x = "objectPad")}: ... } } } %\references{ ~put references to the literature/web site here ~ } \author{ Georgi Boshnakov } \note{ The methods for this class are set to work directly on objects from classes that have slot \code{pad} of class \code{objectPad}. Classes may define additional methods for the function \code{pad} (it is generic) to adapt it to their needs. % todo: Ne si spomnyam dali narochno napravich metodite da ne priemat % poveche ot edin argument za item. (Obstata fuktsiya za replacement pad<-() % priema ..., no analogat i pad() ne go pravi.) Zatova otkomentiram % nyakoi ot prmerite po-dolu. } \seealso{ \code{\link{pad-methods}} } \examples{ # create a pad and store some info. pa <- new("objectPad") pad(pa,"apple") <- "fruit" pad(pa,"sweets") <- "sweets" # pad(pa,"apple","dentist") <- "keeps away from her/him" # pad(pa,"sweets","dentist") <- "helps meeting her/him" pad(pa,"young Gauss") <- 100*(100+1)/2 pad(pa,"layman") <- sum(1:100) pad(pa,"apple") pad(pa,"sweets") # pad(pa,"apple","dentist") # pad(pa,"sweets","dentist") pad(pa,"young Gauss") - pad(pa,"layman") # create a class of vectors with a pad setClass("vecWithPad",representation(x="numeric",pad="objectPad")) a <- new("vecWithPad",x=1:10) pad(a,"mean") <- mean(a@x) # Compute and store the mean, and pad(a,"mean") # retrieve it } %\keyword{classes} \keyword{internal} gbutils/man/rpoly.Rd0000644000176200001440000001016514243151170014133 0ustar liggesusers\name{rpoly} \alias{rpoly} \title{Polynomials with real coefficients} \description{ Compute the coefficients of a polynomial with real coefficients, given its real zeroes (roots) and one representative for each complex pair. If complex numbers are given in polar form, there is an option to specify the complex arguments as multiples of \eqn{\pi}. } \usage{ rpoly(x = numeric(0), arg = numeric(0), real = numeric(0), argpi = FALSE, monic = TRUE) } \arguments{ \item{x}{ if \code{complex}, the roots (including the real ones), otherwise the moduli of the complex roots of the polynomial. In both cases only one representative for each complex pair should be included. } \item{arg}{ the complex arguments corresponding to the moduli in \code{x}. This argument is not needed when \code{x} is complex. } \item{real}{ the real roots of the polynomial. This argument is not needed when \code{x} is complex. } \item{argpi}{ if \code{TRUE}, then \code{arg} represents the complex arguments as a multiple of \eqn{\pi}, see section \sQuote{Details}. The default is \code{FALSE}. } \item{monic}{ if \code{TRUE}, the default, the coefficient of the highest term of the polynomialis is set to 1. if \code{FALSE}, the constant term is one. } } \details{ The complex zeroes of polynomials with real coefficients come in complex conjugated pairs. Only one representative from each pair should be supplied to \code{rpoly}. The other is added automatically. Of course, all real roots should be supplied, if any. If \code{x} is complex, it should contain all real roots and one representative for each comple pair. Otherise, if \code{x} is not complex, it contains the moduli of the numbers and \code{arg} contains the complex arguments. The two should be of equal length. With the default \code{FALSE} for \code{argpi}, the k-th root of the polynomial is \code{x[k]*cos(arg[k]) + i*x[k]*sin(arg[k])}. If \code{argpi} is \code{TRUE} it is \code{x[k]*cos(pi*arg[k]) + i*x[k]*sin(pi*arg[k])}. By default, a monic polinomial (the coefficient of the highest order term is 1) is created but if \code{monic} is \code{FALSE}, the constant term of the polynomial is set to 1 . The options for \code{argpi = TRUE} and/or \code{monic = FALSE} are convenient in some applications, e.g., time series analysis and digital signal processing. %% ~~ If necessary, more details than the description above ~~ } \value{ a real vector containing the coefficients of the polynomial. } %\references{ %%% ~put references to the literature/web site here ~ %} \author{Georgi N. Boshnakov} \note{ When \code{argpi} is \code{TRUE}, \eqn{\cos(\pi a)} is computed using \code{cospi(a)}. So this may differ slightly from the equivalent result obtained with \code{argpi = FALSE} and \code{b = pi*a}, which is computed as \code{cos(b) = cos(pi*a)}, see the example. } % %%% ~Make other sections like Warning with \section{Warning }{....} ~ \seealso{ \code{\link{sim_numbers}} } \examples{ ## z-1 rpoly(real = 1) ## roots 1, i, -i; p3(z) = (z-1)(z-i)(z+i) p3 <- rpoly(c(1, 1i)) p3 polyroot(p3) ## using polar for the complex roots (i = e^(i pi/2)) p3a <- rpoly(1, pi/2, real = 1) p3a ## mathematically, p3a is the same as p3 ## but the numerical calculation here gives a slight discrepancy p3a == p3 p3a - p3 ## using argpi = TRUE is somewhat more precise: p3b <- rpoly(1, 1/2, real = 1, argpi = TRUE) p3b p3b == p3 p3b - p3 ## indeed, in this case the results for p3b and p3 are identical: identical(p3b, p3) ## two ways to expand (z - 2*exp(i*pi/4))(z - 2*exp(-i*pi/4)) rpoly(2, pi/4) rpoly(2, 1/4, argpi = TRUE) ## set the constant term to 1; can be used, say, for AR models rpoly(2, pi/4, monic = FALSE) rpoly(2, 1/4, argpi = TRUE, monic = FALSE) } % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory (show via RShowDoc("KEYWORDS")): % \keyword{ ~kwd1 } % \keyword{ ~kwd2 } % Use only one keyword per line. % For non-standard keywords, use \concept instead of \keyword: % \concept{ ~cpt1 } % \concept{ ~cpt2 } % Use only one concept per line. gbutils/man/isNA.Rd0000644000176200001440000000364614242773122013634 0ustar liggesusers\name{isNA} \alias{isNA} \title{Check if an object is NA} \description{ Check if an object is NA. Always return TRUE of FALSE, a logical vector of length one. } \usage{ isNA(x) } \arguments{ \item{x}{any R object.} } \details{ \code{isNA} returns TRUE if the argument is a single NA, i.e. it is atomic, has length one, and represents an NA value. In any other case \code{isNA} returns \code{FALSE}. \code{isNA} is suitable for use in conditional constructs since it always returns a single value which is never NA. Note that \code{identical()} distinguishes different types of NA, i.e. \code{identical(x, NA)} is TRUE only if \code{x} is NA (logical). } \note{ The requirement that \code{x} is atomic means that \code{isNA(list(NA))} gives \code{FALSE}. For comparison, \code{is.na(list(NA))} gives \code{TRUE}. The same holds for classed lists, such as \code{is.na(structure(list(NA), class = "myclass"))}. } \value{ TRUE or FALSE } \author{Georgi N. Boshnakov} \seealso{ \code{\link{isTRUE}}, \code{\link{is.na}}, \code{\link{identical}} } \examples{ v <- c(1, NA, 3) isNA(v[2]) # TRUE ## a vector of two or more Na's is not isNA isNA(rep(NA,3)) # FALSE ## a list containing NA is not isNA isNA(list(NA)) # FALSE ## ... but is.na(list(NA)) # TRUE ## identical() distinguishes different types of NA: class(v) # "numeric", not "integer" identical(v[2], NA) # FALSE, NA on its own is "logical" identical(v[2], NA_integer_) # FALSE identical(v[2], NA_real_) # TRUE vi <- c(1L, NA_integer_, 3L) isNA(vi[2]) # TRUE class(vi) # "integer" identical(vi[2], NA_integer_) # TRUE identical(vi[2], NA_real_) # FALSE ## is.na(NULL) would give a warning isNA(NULL) # FALSE ## a length zero object is not NA, so isNA() returns FALSE: isNA(logical(0)) # FALSE ## is.na() has a different remit and returns a 0-length vector: is.na(logical(0)) # logical(0) } \keyword{NA} \keyword{logic} \keyword{manip} gbutils/man/pseudoInverse.Rd0000644000176200001440000000220113501136655015620 0ustar liggesusers\name{pseudoInverse} \alias{pseudoInverse} %- Also NEED an '\alias' for EACH other topic documented here. \title{Compute a pseudo-inverse matrix} \description{Compute a pseudo-inverse matrix using singular value decomposition and setting very small singular values to zero.} \usage{ pseudoInverse(a, tol = 1e-07) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{a}{a matrix} \item{tol}{a number, the threshold for non-zero singular values.} } \details{ The singular value decomposition of \code{a} is computed and singular values smaller than \code{tol} are set to zero. The result is formed using the standard formula. } \value{ a matrix } %\references{ %%% ~put references to the literature/web site here ~ %} % %\author{ %%% ~~who you are~~ %} % %\note{ %%% ~~further notes~~ %} % % %%% ~Make other sections like Warning with \section{Warning }{....} ~ % % %\seealso{ %%% ~~objects to See Also as \code{\link{help}}, ~~~ %} \examples{ ##---- Should be DIRECTLY executable !! ---- } % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \keyword{math} gbutils/man/mintersect.Rd0000644000176200001440000000233713501136655015154 0ustar liggesusers\name{mintersect} \alias{mintersect} \title{Set intersection of arbitrary number of arguments} \description{Set intersection of arbitrary number of arguments.} \usage{ mintersect(...) } \arguments{ \item{\dots}{arguments to be intersected, vectors of the same mode, see \code{intersect}.} } \details{ The base \R function \code{intersect} is a binary operation. \code{mintersect} works with any positive number of arguments. If called with one argument, \code{mintersect} returns it. This is unlike \code{intersect} which gives an error in this case. Calling \code{mintersect} with no arguments is an error (as it is for \code{intercect}). } \value{ a vector representing the intersection of the arguments } % \references{ % %% ~put references to the literature/web site here ~ % } \author{Georgi N. Boshnakov} % \note{ % %% ~~further notes~~ % } % % %% ~Make other sections like Warning with \section{Warning }{....} ~ % % \seealso{ % %% ~~objects to See Also as \code{\link{help}}, ~~~ % } \examples{ mintersect(1:20, 3:18, 7:12) mintersect(letters[1:20], letters[3:18], letters[7:12]) mintersect(1:4) } % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \keyword{programming} gbutils/man/adjacencyOfClasses.Rd0000644000176200001440000001645513501136655016531 0ustar liggesusers\name{adjacencyOfClasses} \alias{adjacencyOfClasses} \title{Adjacency graph of classes in packages} \description{ Get inheritance graph of classes in one or more packages. } \usage{ adjacencyOfClasses(packages, externalSubclasses = FALSE, result = c("default", "matrixOfPairs", "adjacencyMatrix"), Wolfram = FALSE) } \arguments{ \item{packages}{names of one or more packages, a character vector} \item{externalSubclasses}{ if \code{TRUE}, exclude subtrees of classes not defined in any of the packages listed in argument \code{packages}. } \item{result}{ format of the result, can be missing or one of \code{"default"}, \code{"matrixOfPairs"}, \code{"adjacencyMatrix"}, see Details. } \item{Wolfram}{ if \code{TRUE}, print a suitable graph expression to be run by Mathematica, see Details. } } \details{ \Sexpr[stage=build,results=hide]{library("gbutils")} \code{adjacencyOfClasses} computes a graph representation of the dependencies of S4 classes defined in one or more packages (as specified by argument \code{package}) and returns a list. The contents of the list returned by \code{adjacencyOfClasses} depend on argument \code{result}. Partial matching is used for the value of argument \code{result}, e.g., "adj" is equivalent to "adjacencyMatrix". If \code{externalSubclasses = FALSE}, the default, subclasses defined outside the requested packages are excluded. This is typically what the user will be looking for. To get a complete tree, set \code{externalSubclasses} to \code{TRUE}. The S4 classes are represented by the vertices of the graph. Component \code{"vertices"} of the result gives them as a character vector. References below to the \eqn{i}{i-}th class or vertex correspond to the order in this vector. No attempt is made to arrange the vertices in a particular order. An empty list is returned if this vector is empty. If \code{result} is missing or \code{"default"}, the edges of the graph are represented by a character vector. Each edge is represented by a string with an arrow \code{"->"} from a superclass to a subclass. Here is an example that shows that this package defines one class, which is a subclass of \code{"list"}: \printExample{adjacencyOfClasses("gbutils")} This illustrates the effect of argument \code{"externalSubclasses"}: \printExample{adjacencyOfClasses("gbutils", externalSubclasses = TRUE)} The edge, "vector -> list" was omitted in the previous example since this relationship is defined elsewhere. This resulted in class \code{"vector"} being dropped also from the vertices, since it is not defined in \code{"gbutils"} and none of the remaining edges contains it. If \code{result} is \code{"matrixOfPairs"}, the edges of the graph are represented by a character matrix with two columns, where each row represents an edge from the element in the first column to the element in the second. In this example there is one edge, so the matrix contains one row: \printExample{adjacencyOfClasses("gbutils", result = "matrixOfPairs")} If \code{result} is \code{"adjacencyMatrix"}, the adjacency matrix of the graph is in component "AM" of the returned list. Element \eqn{(i,j)} of this matrix is equal to one, if the \eqn{j}{j-}th class is a superclass to the \eqn{i}{i-}th. In other words, the \eqn{j}{j-}th column gives the superclasses of the \eqn{i}{i-}th class. Here the element in position (1,2) is non-zero, so \code{"list"} is the superclass of \code{"objectPad"}: \printExample{adjacencyOfClasses("gbutils", result = "adjacencyMatrix")} Note that including the vertices in the result is not redundant, since some may not be in any edge. This can happen if a class does not have any superclasses and subclasses. As described above the result is not converted to a graph object but it can be fed to functions provided by a number of \R packages. An additional option is to use argument \code{Wolfram}. If \code{Wolfram} is \code{TRUE}, a suitable Mathematica command is printed. It can be evaluated in a Mathematica session (e.g., by copy/paste) to produce a graphical representation of the graph and/or be manipulated further by it. This feature is a side effect, the return value of \code{adjacencyOfClasses} is as controlled by the other arguments. For example, the return value below is as without argument \code{"Wolfram"} but, in addition, the printed line defines a Wolfram language graph in terms of its vertices and edges: \printExample{adjacencyOfClasses("gbutils", Wolfram = TRUE)} Setting \code{result = "adjacencyMatrix"} in the last \R command exports the graph in terms of its adjacency matrix: \printExample{adjacencyOfClasses("gbutils", Wolfram = TRUE, result = "adjacencyMatrix")} } \value{ a list with some of the following components (as described in Details): \item{vertices}{a character vector of S4 class names,} \item{edges}{the edges of the graph, in the format controlled by argument \code{results} (not present when \code{result} is equal to \code{"adjacencyMatrix"}),} \item{AM}{the adjacency matrix of the graph (present only when \code{result} is \code{"adjacencyMatrix"}).} } \references{ \insertRef{Rpackage:graph}{gbutils} \insertRef{Rpackage:Rgraphviz}{gbutils} \insertRef{Rpackage:classGraph}{gbutils} } \author{Georgi N. Boshnakov} %\note{ %%% ~~further notes~~ %} % %%% ~Make other sections like Warning with \section{Warning }{....} ~ % \seealso{ \code{?methods::classesToAM} which is used for the main computation here, \insertCiteOnly{Rpackage:classGraph;textual}{gbutils} for a suite of related functions. \insertCiteOnly{Rpackage:graph;textual}{gbutils} for creation and manipulation of graphs, and \insertCiteOnly{Rpackage:Rgraphviz;textual}{gbutils} for visualisation of graphs. } \examples{ adjacencyOfClasses("gbutils") adjacencyOfClasses("gbutils", TRUE) adjacencyOfClasses("gbutils", FALSE, "matrixOfPairs") adjacencyOfClasses("gbutils", TRUE, "matrixOfPairs") adjacencyOfClasses("gbutils", FALSE, "adjacencyMatrix") adjacencyOfClasses("gbutils", TRUE, "adjacencyMatrix") ## as above, also represent the graph using the edges adjacencyOfClasses("gbutils", Wolfram = TRUE) adjacencyOfClasses("gbutils", TRUE, Wolfram = TRUE) ## here the graph is represented by the adjacency matrix: adjacencyOfClasses("gbutils", FALSE, "adjacencyMatrix", Wolfram = TRUE) adjacencyOfClasses("gbutils", TRUE, "adjacencyMatrix", Wolfram = TRUE) if(requireNamespace("graph", quietly = TRUE) && requireNamespace("Rgraphviz", quietly = TRUE)) withAutoprint({ ## another package adjacencyOfClasses("graph") ac1 <- adjacencyOfClasses("graph", FALSE, "adjacencyMatrix") ## note the use of t() below gr_ac1 <- graph::graphAM(adjMat = t(ac1$AM), edgemode = "directed") if(require("Rgraphviz", quietly = TRUE, warn.conflicts = FALSE)) plot(gr_ac1) ## more than one package ac2 <- adjacencyOfClasses(c("graph", "Rgraphviz"), FALSE, "adjacencyMatrix") gr_ac2 <- graph::graphAM(adjMat = t(ac2$AM), edgemode = "directed") if(require("Rgraphviz", quietly = TRUE)) plot(gr_ac2) }) } % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \keyword{programming} \keyword{S4classes} % use one of RShowDoc("KEYWORDS") gbutils/man/sim_numbers.Rd0000644000176200001440000001565114242415273015324 0ustar liggesusers\name{sim_numbers} \alias{sim_numbers} \title{ Simulation based on polar form specifications } \description{ Simulate real and complex numbers from polar form specifications. The numbers may be partially or fully specified. The distributions of absolute values and arguments/signs are specified independently. } \usage{ sim_numbers(type = rep(as.character(NA), length(abs)), abs = rep(as.numeric(NA), length(type)), sign = rep(as.numeric(NA), length(type)), values = NULL, ...) } \arguments{ \item{type}{ character vector specifying the types of the eigenvalues, see Details.} \item{abs}{ vector of absolute values (moduli).} \item{sign}{ vector of signs (for reals) and arguments (for complex numbers), see Details for interpretation.} \item{values}{values, see details.} \item{\dots}{ additional arguments to be passed to \code{sim_real} and \code{sim_complex}.} } \details{ % NA's are filled with simulated values. \code{sim_numbers} simulates a vector of real and complex numbers with given distributions of their polar parts. It is possible also to fix some of the numbers or one of their polar parts. The length of the simulated vector is inferred from the length of \code{type} or \code{abs}, so one of them must be provided. \code{sim_numbers} is a flexible front-end for \code{sim_real} and \code{sim_complex}. \code{sim_numbers} generates a vector of values with types specified by argument \code{type} and/or inferred from argument \code{values}. The recommended way to use \code{sim_numbers} is to provide argument \code{type}. % and use the other arguments only when needed. \code{type[i]} specifies the type of the i-th element of the result: real (\code{type[i]=="r"}), complex (\code{type[i]=="c"}) or representing a complex conjugate pair (\code{type[i]=="cp"}). If \code{values} is provided, the imaginary parts of its non-NA elements are used to fill \code{NA} elements of \code{type} ("r" if zero, "cp" otherwise). Some (or even all) values may be fixed or partially fixed with the help of arguments \code{abs}, \code{sign} and \code{values}. A non-missing value of \code{values[i]} fixes the i-th element of the result to that value. Simlarly \code{abs[i]} fixes the modulus and \code{sign[i]} fixes the sign/argument of the i-th element. If \code{values[i]} is not \code{NA}, then it takes precedence and \code{abs[i]} and \code{sign[i]} are ignored. For real numbers \code{sign} is the sign with possible values 1 (positive) or -1 (negative). For complex numbers, \code{sign} is the argument and is in the interval (-pi,pi). If \code{values} is supplied, then \code{NA} entries in \code{type} are replaced by "r" or "cp" depending on whether or not the imaginary parts of the corresponding entries in \code{values} are equal to zero. A check is done for consistency when both \code{type[i]} and \code{values[i]} are non-missing. Generally, \code{values} is meant to be used for values that are fixed and available directly in Cartesian form, to avoid having to fill the corresponding entries of \code{abs} and \code{sign}. \code{NA} entries of \code{abs} and \code{sign} are filled with simulated values, the remaining entries are considered fixed and left unchanged. The default generator is uniform (0,1) for \code{abs}, uniform (-pi,pi) for the argument of complex values, and 1 or -1 with p=1/2 for the sign of real values. To specify a different generator for the moduli and absolute values, use argument \code{absgen}, giving it a function or the name of a function. The arguments for this function can be specified by \code{absarg} (as a list). Similarly, the generator for arguments of complex numbers can be specified by \code{arggen} and \code{argarg}. Finally, the probability for the real numbers to be positive is given by \code{signprob}. These arguments are not in the signature of the function since they are passed on directly (via \code{"..."}) to the underlying \code{sim_complex} and \code{sim_real}, see their documentation and the examples below for further details. } \value{ a list with components \item{values}{vector of values; it is of type \code{numeric} if all values are real and \code{complex} otherwise. } \item{type}{a character vector of the types as above} } %\references{ ~put references to the literature/web site here ~ } \note{ Values of type "cp" (complex pairs) are represented by one element, the complex conjugate elements are NOT generated. (todo: maybe add an argument to control this) The convention for the sign of a real eigenvalue is 1 and -1, not 0 and pi. % In the lower level function \code{sim_real} this argument % is called \code{sign} not \code{arg}. The checks for consistency between \code{type} and \code{values} are not complete and only straightforward use is recommended. The current defaults for the arguments, see the signature above, require that at least one of \code{type} and \code{abs} is not missing. % For compatility with old versions of the function (before the % introduction of \code{type}), \code{values} may be a character % vector. In this case \code{type} is set to \code{values}. } \author{Georgi N. Boshnakov} \seealso{ \code{\link{sim_real}}% , \code{\link{sim_complex}} } \examples{ ## one real number and one complex conjugated pair ## (maybe to specify a cubic polynomial through its roots) sim_numbers(type = c("r", "cp")) ## here the real value is fixed to have modulus 1, leaving the sign unspecified sim_numbers(type = c("r", "cp"), abs = c(1, NA)) ## now the real value is fixed to 1, ## the complex pair has argument +-pi/2, and free modulus: sim_numbers(type = c("r", "cp"), abs = c(1, NA), sign = c(0, pi/2)) ## using argument 'values' to fix some values; ## here the the third value is fixed: sim_numbers(type = c("r", "cp", "r"), values = c(NA,NA,3)) # type[3] = "r" sim_numbers(type = c("r", "cp", "cp"), values = c(NA,NA,3i)) # type[3] = "cp" ## type[3] can be left NA since it can be inferred from values[3]: sim_numbers(type = c("r", "cp", NA), values = c(NA,NA,3)) # type[3] = "r" sim_numbers(type = c("r", "cp", NA), values = c(NA,NA,3i)) # type[3] = "cp" ## it is an error to have a mismatch between args `type' and value: \dontrun{ sim_numbers(type = c("r", "cp", "cp"), values = c(NA,NA,3)) sim_numbers(type = c("r", "cp", "r"), values = c(NA,NA,3i)) } ## simulate 10 reals with the default generators sim_numbers(rep("r", 10)) ## simulate modulus from Rayleigh distribution ## rR <- function(n, sigma = 1) sigma * sqrt(-2*log(runif(n))) sim_numbers(type = c("cp", "cp"), absgen = rR, absarg = list()) # test the the components are N(0,1) ## (not run to save time for CRAN check) ## \dontrun{ ## v <- sim_numbers(type = rep("cp", 10000), absgen = "rR", ## absarg = list(sigma = 1)) ## ks.test(Re(v$values), "pnorm") ## ks.test(Im(v$values), "pnorm") ## } } \keyword{ distribution } \keyword{simulation} gbutils/man/plotpdf.Rd0000644000176200001440000000543413501136655014450 0ustar liggesusers\name{plotpdf} \alias{plotpdf} %- Also NEED an '\alias' for EACH other topic documented here. \title{ Plot a probability denstity function } \description{ Plot a probability denstity function with x-axis limits determined by quantiles of the distribution. Quantiles are computed using a quantile function or cumulative distribution function, whichever is supplied. } \usage{ plotpdf(pdf, qdf, cdf, lq = 0.01, uq = 0.99, ...) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{pdf}{probability density to be plotted, a function.} \item{qdf}{quantile function to be used for computation of quantiles, a function.} \item{cdf}{cumulative distribution function to be used for computation of quantiles, a function. This argument is used if \code{qdf} is not given, see `Details' section.} \item{lq}{lower quantile, used in the computation of the left limit.} \item{uq}{upper quantile, used in the computation of the right limit.} \item{\dots}{additional arguments to be passed on to the \code{plot} function.} } \details{ The function plots \code{pdf(x)} over the interval (xmin,xmax) where xmin and xmax are the \code{lq}th and \code{uq}th quantiles, respectively, of the distribution. The quantile function, \code{qdf}, is used, if supplied. Otherwise the quantiles are computed numerically from the cdf. Argument \code{pdf} is not required to be a pdf, it may be any function. For example, the same way of choosing the limits may be appropriate for a plot of the cdf, see the examples. Similarly, \code{qdf} and \code{cdf} need not be related to \code{pdf}. } % \value{ % The function is used mainly for the side effect of producing the % plot. The return value is that of \code{plot}. % } \author{Georgi N. Boshnakov} \seealso{ \code{\link{cdf2quantile}} } \examples{ pdf1 <- function(x) dnorm(x, mean = 100, sd = 5) qdf1 <- function(x) qnorm(x, mean = 100, sd = 5) cdf1 <- function(x) pnorm(x, mean = 100, sd = 5) plot(pdf1) # needs to specify 'from' and 'to' args for meaningful plot plotpdf(pdf1, qdf1) # using quantile function plotpdf(pdf1, cdf = cdf1) # using cdf plotpdf(pdf1, cdf = cdf1, lq = 0.001, uq = 0.999) # ... and non-default quantiles plotpdf(cdf1, cdf = cdf1, lq = 0.001, uq = 0.999) # plot a cdf ## a mixture distribution: pf1 <- function(x){ 0.25 * pnorm(x, mean = 3, sd = 0.2) + 0.75 * pnorm(x, mean = -1, sd = 0.5) } df1 <- function(x){ 0.25 * dnorm(x, mean = 3, sd = 0.2) + 0.75 * dnorm(x, mean = -1, sd = 0.5) } plotpdf(df1, cdf = pf1) # plot the pdf plotpdf(pf1, cdf = pf1) # plot the cdf c(cdf2quantile(0.05, pf1), cdf2quantile(0.95, pf1)) } % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \keyword{hplot} \keyword{dplot} gbutils/man/cdf2quantile.Rd0000644000176200001440000000435513501136655015362 0ustar liggesusers\name{cdf2quantile} \alias{cdf2quantile} \title{ Calculate a quantile from a distribution function } \description{ Numerically calculate a quantile from a distribution function. } \usage{ cdf2quantile(p, cdf, interval = c(-3, 3), lower = min(interval), upper = max(interval), \dots) } \arguments{ \item{p}{ a number in the interval (0,1). } \item{cdf}{cumulative distribution function, a function.} \item{interval}{interval in which to look for the root, see Details.} \item{lower}{lower end point of the interval.} \item{upper}{upper end point of the interval.} \item{\dots}{any further arguments to be passed to the root finding function and the cdf, see Details.} } \details{ The quantile, \eqn{q}, is computed numerically as the solution of the equation \eqn{cdf(q)-p=0}. Function \code{uniroot} is used to find the root. To request higher precision, set argument \code{tol}. Other arguments in \code{...} are passed on to \code{cdf}. \code{uniroot} needs an interval where to look for the root. There is a default one, which is extended automatically if it does not contain the quantile. This assumes that argument \code{cdf} is an increasing function (as it should be). To override the default interval, use argument \code{interval} (a vector of two numbers) or \code{lower} and/or \code{upper}. This may be necessary if the support of the distribution is not the whole real line and \code{cdf} does not cope with values outside the support of the distribution. } \value{The computed quantile as a number.} \author{Georgi N. Boshnakov} \seealso{ \code{\link{plotpdf}} } \examples{ cdf2quantile(0.95, pnorm) cdf2quantile(0.05, pexp) # support [0,Inf) is no problem for cdf2quantile(0.05, plnorm) # for built-in distributions. ## default predicision is about 4 digits after decimal point cdf2quantile(0.95, pnorm, mean = 3, sd = 1) cdf2quantile(0.05, pnorm, mean = 3, sd = 1) qnorm(c(0.95, 0.05), mean = 3, sd = 1) ## request a higher precision: cdf2quantile(0.05, pnorm, mean = 3, sd = 1, tol = 1e-8) cdf2quantile(0.05, pnorm, mean = 3, sd = 1, tol = 1e-12) ## see also examples for plotpdf() } % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \keyword{distribution} gbutils/man/pad-methods.Rd0000644000176200001440000000353513501136655015205 0ustar liggesusers\name{pad-methods} \docType{methods} \alias{pad} \alias{pad<-} \alias{pad-methods} \alias{pad,ANY,ANY-method} \alias{pad,ANY,missing-method} \alias{pad,objectPad,missing-method} \alias{pad,objectPad,ANY-method} \alias{padcheck} \title{ Store and get data in pad objects } \description{ Get and store information in a pad. \code{pad} can be used on the lefthand side of an assignment to store information in an object and as normal function call to retrieve previously stored information. } \usage{ pad(x, item) pad(x, item, ...) <- value } \arguments{ \item{x}{ the object where the information is stored. } \item{item}{ the \code{item} to be stored or extracted. } \item{value}{ the value to be stored } \item{...}{ additional arguments (??? are these really possible? !!!) } } \details{ This is a generic function. There are methods for \code{x} of class \code{objectPad}. The generic works with the slot \code{pad} of \code{x}. Currently there is no check if there is one. To remove an item use \code{pad(x,item) <- NULL}. So, by definition, items may not have the value \code{NULL}. \code{padcheck} checks if \code{item} has a value and if so returns \code{TRUE}. Otherwise it returns \code{FALSE}. } \value{ The requested item. If \code{item} is missing a named list containing all stored items. } \section{Methods}{ \describe{ \item{x = "objectPad", item = "missing"}{ get all items stored in the pad \code{x}, as a named list. } \item{x = "objectPad", item = "ANY"}{ get the requested \code{item} from the pad \code{x}. } \item{x = "ANY", item = "missing"}{ get all items stored in the pad of \code{x} as a named list. } \item{x = "ANY", item = "ANY"}{ get the requested \code{item} from the pad of \code{x}. } }} \author{ Georgi N. Boshnakov } \seealso{ \code{\linkS4class{objectPad}} } %\keyword{methods} \keyword{internal} gbutils/man/missing_arg.Rd0000644000176200001440000000300513501136655015272 0ustar liggesusers\name{missing_arg} \alias{missing_arg} \title{Check if an element of a pairlist is missing} \description{Check if an element of a pairlist is missing.} \usage{ missing_arg(arg) } \arguments{ \item{arg}{the object to test.} } \details{ The argument passed to \code{missing_arg} is typically an element of a \code{pairlist} or the list produced by \code{alist()}. \code{missing_arg} returns \code{TRUE} if it is missing and \code{FALSE} otherwise. Objects of type \code{pairlist} come up at R level almost exclusively as the formal arguments of functions. \code{missing_arg} can be useful when they are manipulated programmatically. } \value{ TRUE or FALSE } \author{Georgi N. Boshnakov} %\seealso{ %%% ~~objects to See Also as \code{\link{help}}, ~~~ %} \examples{ lmargs <- formals(lm) class(lmargs) # pairlist missing_arg(lmargs$data) ## which arguments of lm() have no (explicit) defaults? sapply(lmargs, missing_arg) ## This gives an error: ## pairlist(x = 3, y = , z = 5) ## an example with alist() pl2 <- alist(a = "", b = , c = 3) class(pl2) # list ## this shows that 'b' is missing, 'a' and 'c' are not: sapply(pl2, missing_arg) # FALSE TRUE FALSE ## superficially, 'b' is equal to the empty string: pl2[[2]] sapply(pl2, function(x) x == "") # TRUE TRUE FALSE ## with pairlist the results are the same: g <- function(a = "", b, c = 3) NULL a.g <- formals(g) class(a.g) # pairlist sapply(a.g, missing_arg) # FALSE TRUE FALSE a.g[[2]] sapply(a.g, function(x) x == "") # TRUE TRUE FALSE } \keyword{programming} gbutils/man/myouter.Rd0000644000176200001440000000232513501136655014500 0ustar liggesusers\name{myouter} \alias{myouter} \alias{shiftleft} \alias{shiftright} \title{ Functions for some basic operations } \description{ Small utility functions } \usage{ myouter(x, y, fun) shiftleft(x, k = 1) shiftright(x, k = 1) } \arguments{ \item{x}{a vector.} \item{y}{a vector.} \item{k}{a non-negative integer.} \item{fun}{a function, see `Details'.} } \details{ \code{myouter(x,y,fun)} computes the outer product of \code{x} and \code{y} using the function \code{fun}. The result is a matrix with \eqn{(i,j)}th element equal to \code{fun(x[i],y[j])}. It is not required for fun to be able to work with vector arguments. The function does the computations in \R using a simple double loop. So, it is a convenience function, not a speed improving one. \code{shiftright(x,k)} rotates the vector \code{x} \code{k} positions to the right. \code{shiftleft(x,k)} rotates the vector \code{x} \code{k} positions to the left. } \value{ for \code{myouter}, a matrix, as described in `Details' for \code{shiftleft} and \code{shiftright}, a vector } %\references{ ~put references to the literature/web site here ~ } \author{Georgi N. Boshnakov} %\note{} %\seealso{ \code{\link{pcAcf}} } %\examples{ %} \keyword{programming} gbutils/man/parse_text.Rd0000644000176200001440000000360213501136655015151 0ustar liggesusers\name{parse_text} \alias{parse_text} %- Also NEED an '\alias' for EACH other topic documented here. \title{Parse expressions residing in character vectors} \description{ Parse expressions residing in character vectors. Similar to parse() but keeping or not the source is controlled by an argument rather than global options. } \usage{ parse_text(text, ..., keep = TRUE) } %- maybe also 'usage' for other objects documented here. \arguments{ \item{text}{the text to parse, normally a character vector but can be anything that \code{parse} accepts for this artgument.} \item{\dots}{additional arguments to be passed on to \code{parse}.} \item{keep}{required setting for option \verb{keep.source}, see details.} } \details{ This is like \code{parse(text=text,\dots)}, except that whether or not the source is kept is controlled by argument \code{keep}, not by \code{options("keep.source")}. \code{parse_text} sets \code{options("keep.source")} to \code{keep} (if they are different) before calling \code{parse} and restores it afterwards. } \value{ an expression representing the parsed text, see \code{\link{parse}} for details } \author{Georgi N. Boshnakov} \note{ The usual setting of option "keep.source" in interactive sessions is TRUE. However, in `R CMD check' it is FALSE. As a consequence, if the documentation of a package uses functions that depend on option "keep.source" being \code{TRUE}, then some examples may run fine when copied and pasted in an R session but (rightly) fail `R CMD check'. The oposite may also happen, in that the documentation passes `R CMD check' or Sweave files successfully build but some examples do not work when copied and pasted in an interactive session. } \seealso{ \code{\link{parse}} } % \examples{ % } % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \keyword{programming} gbutils/man/sim_complex.Rd0000644000176200001440000000675413501136655015325 0ustar liggesusers\name{sim_complex} \alias{sim_complex} \alias{sim_real} \title{ Simulate real or complex numbers using polar form} \description{ Simulate complex numbers with given distributions for the modulus and the argument and real numbers with given distributions for the absolute value and the sign. Some of the values may be partially or fully specified. } \usage{ sim_complex(abs, arg, absgen = "runif", absarg = list(0, 1), arggen = runif, argarg = list(-pi, pi), ...) sim_real(abs, sign, signprob = 0.5, absgen = "runif", absarg = list(0, 1), ...) } \arguments{ \item{abs}{ vector of absolute values. } \item{sign}{ vector of signs (1 or -1). } \item{signprob}{ probability for a positive sign. } \item{arg}{ vector of arguments (of complex numbers). } \item{absgen}{ generator for the absolute values, a function or a character string naming a function. } \item{absarg}{ arguments for \code{absgen}. } \item{arggen}{ generator for the arguments of the complex numbers, a function or a string naming a function. } \item{argarg}{ arguments for \code{arggen}. } \item{\dots}{ not used, simplifies the call from \code{sim_numbers}. } } \details{ \code{sim_real} simulates real numbers by simulating separately their absolute values and signs. \code{sim_complex} simulates complex numbers by simulating separately their moduli and arguments. Both functions replace \code{NA}'s in argument \code{abs} with values simulated by the function specified by \code{absgen}. Arguments for \code{absgen} are specified by the (possibly named) list \code{absarg}. Similarly, \code{sim_complex} replaces \code{NA}'s in argument \code{arg} with values simulated according to \code{arggen} and \code{argarg}. Further, \code{sim_real} replaces \code{NA}'s in argument \code{sign} with a random sample of ones and minus ones, where the probability for the positive value is \code{signprob}. Only \code{NA} entries in \code{abs}, \code{arg} and \code{sign} are filled with simulated values, the remaining entries are left unchanged. This means that some (and even all) values may be specified partially or completely. \code{abs} is combined with \code{arg} or \code{sign} to create the result. These arguments are expected to be of matching shape and length but this is not enforced and the usual recycling rules will apply if this is not the case (not recommended to rely on this). The default range for the (complex) argument is (-pi,pi). } \value{ for \code{sim_real}, a vector of real numbers for \code{sim_complex}, a vector of complex numbers } %\references{ ~put references to the literature/web site here ~ } \author{Georgi N. Boshnakov} \note{ Currently the shape of the result for \code{sim_real} is the same as that of argument \code{abs}. But \code{sim_complex} always returns a vector. Probably this inconsistency should be removed. } \seealso{ \code{\link{sim_numbers}} which offers more flexible interface to these functions. } \examples{ ## x[1] is fixed to 1, x[2] is negative with random magnitude: x <- sim_real(c(1,NA,NA,NA), c(1, -1, NA, NA)) ## z[1] fixed to 1, the remaining elements of z ## have random magnitude and fixed arguments: z <- sim_complex(c(1,NA,NA,NA), c(0, pi/2, pi, -pi/2)) ## without restrictions sim_complex(rep(NA,4)) sim_real(rep(NA,4)) ## moduli unrestricted; arguments restricted sim_complex(rep(NA,4), c(0, pi/2, pi, -pi/2)) } \keyword{distribution} \keyword{simulation} gbutils/man/isargunnamed.Rd0000644000176200001440000000216513501136655015453 0ustar liggesusers\name{isargunnamed} \alias{isargunnamed} \title{ Is an element of a list named? } \description{ Check if a component of a list is not named. } \usage{ isargunnamed(x, k) } \arguments{ \item{x}{ a list. } \item{k}{ an integer, specifies a position in \code{x}. } } \details{ \code{isargunnamed(x,k)} returns TRUE if the k-th component of \code{x} is not named and FALSE otherwise. Argument \code{x} is typically a list of arguments used in a call to a function, such as the one obtained by \code{list(...)} in the body of a function definition. If \code{k} is not positive, \code{isargunnamed} returns FALSE. } \value{ TRUE or FALSE } \author{Georgi N. Boshnakov} %\note{ } \seealso{\code{\link{match.call}} in base package} \examples{ li1 <- list(a=1, 2, 3) isargunnamed(li1, 1) isargunnamed(li1, 2) ## wholly unnamed list li2 <- list(1, 2, 3) isargunnamed(li2, 1) isargunnamed(li2, 2) ## using in a function definition f1 <- function(...){ dots <- list(...) for(i in seq(along=dots)) cat(i, isargunnamed(dots, i), "\n") } f1(1) f1(a = 3, 4, c = 5) f1(x = "a", y = "b") } \keyword{programming} gbutils/man/nposargs.Rd0000644000176200001440000000375713501136655014642 0ustar liggesusers\name{nposargs} \alias{nposargs} \title{ Function to count the number of positional arguments used in a call } \description{ Calculates the number of positional arguments used in a call. } \usage{ nposargs(x, a = FALSE) } \arguments{ \item{x}{ a call object, usually obtained from \code{sys.call()}. } \item{a}{ if \code{a[1]} is \code{TRUE} make a correction to distinguish \code{x[]} from \code{x[i]}, see details. } } \details{ \code{nposargs} is mainly for use in the body of function definitions, paricularly for functions or methods that wish to mimic the behaviour of \code{"["}. \code{nposargs} gives the number of positional arguments used in a call. It also takes into account empty arguments like those used in expressions like \code{x[1, ]}. Optionally, it makes a particular correction that is peculiar for "[" - if there are no named arguments in the call and the count of the arguments is 2 and \code{a[1]=TRUE}, it decreases the count by one, i.e. returns 1. This is to distinguish between a \code{x[]} and \code{x[i]} which both would give 2 otherwise. I have forgotten the details but, roughly speaking, x[i] becomes "["(x,i) while x[] becomes "["(x,), i.e. \R puts the comma after x in any case. } \value{ the number of positional arguments in the call } \author{Georgi N. Boshnakov} \note{ I wrote this function (a long time ago) for use in methods for \code{"["}. \code{a[1]} above is typically obtained by a call \code{missing(i)} somewhere at the beginning of the function. In my application I put the results of several such calls in a vector, hence the check for \code{a[1]} rather than \code{a}, For \code{"["}, we may set \code{a = c(missing(i), missing(j), missing(k))}. } % \seealso{ ~~objects to See Also as \code{\link{help}}, ~~~ } \examples{ f <- function(x,y,z,...){ call <- sys.call() nposargs(call) } f(a,b,c) # 3 f(a, , ) # 3 f(a, ) # 2 f(a) # 1 f(, ) # 2 f(, a, ) # 3 f() # 0 } \keyword{programming} gbutils/TODO0000644000176200001440000000017213501136655012420 0ustar liggesusers * for sim_real and related - allow conditional distributions (i.e. dependence between the modulus and the argument) gbutils/DESCRIPTION0000644000176200001440000000325014244115037013432 0ustar liggesusersPackage: gbutils Type: Package Title: Utilities for Simulation, Plots, Quantile Functions and Programming Version: 0.5 Date: 2022-05-27 Depends: methods Imports: stats, utils, Rdpack (>= 0.9) Suggests: testthat (>= 3.0.0), classGraph, graph, Rgraphviz RdMacros: Rdpack Authors@R: person(given = c("Georgi", "N."), family = "Boshnakov", role = c("aut", "cre"), email = "georgi.boshnakov@manchester.ac.uk") Description: Plot density and distribution functions with automatic selection of suitable regions. Numerically invert (compute quantiles) distribution functions. Simulate real and complex numbers from distributions of their magnitude and arguments. Optionally, the magnitudes and/or arguments may be fixed in almost arbitrary ways. Create polynomials from roots given in Cartesian or polar form. Small programming utilities: check if an object is identical to NA, count positional arguments in a call, set intersection of more than two sets, check if an argument is unnamed, compute the graph of S4 classes in packages. URL: https://github.com/GeoBosh/gbutils (devel), https://geobosh.github.io/gbutils/ (website) BugReports: https://github.com/GeoBosh/gbutils/issues License: GPL (>= 2) Encoding: UTF-8 Collate: parse_text.R sim_numbers.R isNA.R mintersect.R pad.R args.R history.R cdf2qf.R S4utils.R pseudoInverse.R rpoly.R Config/testthat/edition: 3 NeedsCompilation: no Packaged: 2022-05-27 07:31:07 UTC; georgi Author: Georgi N. Boshnakov [aut, cre] Maintainer: Georgi N. Boshnakov Repository: CRAN Date/Publication: 2022-05-27 09:30:07 UTC gbutils/build/0000755000176200001440000000000014244077073013032 5ustar liggesusersgbutils/build/vignette.rds0000644000176200001440000000035414244077073015373 0ustar liggesusersuQ0,Q&& Ņ7S 旋HZ6BHGH Ҡo{%?UIESf19.PC=2ٹy d_#Wڨ\V%T I1DJ#ay$3@AZ͹jnnTn~fׯ^+^~xrB5N[y[lISMBFR7񋶴5} # z{}ZoMƲe{3_qT@<1hHUv~*ď |xrl Mu[^+?.Jx*SAE[.1 ~11dUJ[.ν(&1c kՋb"Bv(xbY*v G1Wn2v_w,jfA ԙeeukjeIxig;ۨeFߖT[m Ĵ:?Lrģ-H`7suk b?0iP'xٺS+ja$]K!aƻga;s'Z B Z s\JPTYg&j˥vllށJZR3Q̕$y DRM>X3 tmPBYMx:B XaIoZv 4Īּꕈd{w!~#OM|zWGM|sxr!o@ (_?eFI w?v]ߋfd½&X V1;헭Ð:y{r3ں.niRinX'C{Rni/*ZX!:H.c ,^: AΩRzg8ybBDW6n|x^ aRXW&cp z̞|j ģXdP[l>Fgw4-b8a.g9%Y(?2>".d?Rìl>O!%C aJn+PULb9<`bŲe(N^|;s٠f![+mwqC XSA@6}y S:QvsQw8 ʽHvZG O@Vߝ17ܔhiJ֠I=Aa_V%C NwA/[oI'E$yfaZif֓ 7bDъ8GV(c,K@6<ռڌHLLx&&K~J d;+<4PyM-f1g.r?0_4+UF~?mk\wvOkh{OfeٔHe"+S 7JβڌCD<ެ c'@f"HI\^F™1!w`V#! ac8 yXXv{ DccF vc|:!w ꍋ?ˤ~l&Bw!oe3|oϲ<=\Yȳg>qǵ65'ѮQ ?+c cK rxr)P:Aɝ^|AmU`תn8DF!N¹ sSi4%k2gza.3ŽjsFsØg%`ҥ5H,!̒*J׎k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hUJ HD ʤpU#%?F&c7 x&Ӱb'CGw?kxU7 Up ucuu*a?C&cFi_ [Bo N;v4ퟁ*8qewJ> N}[ScGV OxhM@cBEݿ#CM3dB+g _!̔iNy4 46I_;)e=N(\zs:bcdԿ RiȧbhD;U <_ysG gF3KW([,]䕶/ο ɵ3N\ɰmf Y*jT^=`#~sCxrs6OO+Wi&L=vdOrDSRh4&&ٴ{B)Oת 8*;*j$<։yYVL#R'+34|p KHҿS*I_Xz~"T赍7E.W[.::+e]x4ϟ}~F(JFކ|I" EϱyV 2ߜYrV> p7'P'9!,~qGնxZ$: CޟX0G Hy 0Qd(Id_AD$_,!w\~ J._ 0c_4KۻwV9ޮUژ?A.!c3miNbFj6r~{ks59K,cYvx F;ZbέTswˏr^f^zx˅rU+mC1XShSX >{l~DIބ|auO*Dt+zm |~F++~ ߿_/C/Iȓ8ٲFqf83)Bj[ql21mMBëo3ʸ+Ԧ{z,_ %2](dLhX~KiuCWא r?D~,iysQݕݒj/g,7v&CG !?<}bd"#pΏahʇ]A>La',-$RihLO=0#?Zޞ8- C~\AyiUPO˗yN!:As"b-%G-K{Cy rd,zwM3k/!2=I~䖬[ΑwׯzeZ+fآY҂˹+O%\ H}fC.GCW8(ar2V.{''w gqqlgL^Y?gf5sfD_~g=Oe.0fGh@;=%_A*jNܕ@&$?Y#eR`tٓae٭6_:!A0rPO$7Js-dXi!Z>LLHUWzb>wuyz߃-^Tr%{lF# cLf|S : gO|nܻ7s{c>~沪^7DS?o_ ֪bZgbutils/tests/0000755000176200001440000000000014242736714013077 5ustar liggesusersgbutils/tests/testthat/0000755000176200001440000000000014244115037014726 5ustar liggesusersgbutils/tests/testthat/test-missing_arg.R0000644000176200001440000000020514242774636020343 0ustar liggesuserstest_that("missing_arg works", { lmargs <- formals(lm) class(lmargs) # pairlist expect_true(missing_arg(lmargs$data)) }) gbutils/tests/testthat/test-isNA.R0000644000176200001440000000053714242744075016675 0ustar liggesuserstest_that("isNA works", { expect_identical(isNA(list(NA)), FALSE) # not atomic expect_identical(isNA(c(NA, NA)), FALSE) # length > 1 expect_identical(isNA(1), FALSE) # not NA expect_identical(isNA(NA), TRUE) expect_identical(isNA(NA_integer_), TRUE) expect_identical(isNA(NA_real_), TRUE) }) gbutils/tests/testthat/test-poly.R0000644000176200001440000000236414242740475017026 0ustar liggesuserstest_that("rpoly works ok", { ## z-1 expect_equal(rpoly(real = 1), c(-1,1)) ## roots 1, i, -i; p3(z) = (z-1)(z-i)(z+i) p3 <- rpoly(c(1, 1i)) p3 ## using polar for the complex roots (i = e^(i pi/2)) p3a <- rpoly(1, pi/2, real = 1) expect_equal(p3a, c(-1, 1, -1, 1)) ## mathematically, p3a is the same as p3 ## but the numerical calculation here gives a slight discrepancy ## p3a == p3 # [1] TRUE FALSE FALSE TRUE ## p3a - p3 # [1] 0.000000e+00 2.220446e-16 -2.220446e-16 0.000000e+00 ## Note: expect_equal ignores this small difference ## using argpi = TRUE is somewhat more precise: ## p3b <- rpoly(1, 1/2, real = 1, argpi = TRUE) ## p3b ## expect_equal(p3b, c(-1, 1, -1, 1)) ## p3b == p3 # [1] TRUE TRUE TRUE TRUE ## p3b - p3 # [1] 0 0 0 0 ## ## indeed, in this case the results for p3b and p3 are identical: ## identical(p3b, p3) # TRUE ## two ways to expand (z - 2*exp(i*pi/4))(z - 2*exp(-i*pi/4)) rpoly(2, pi/4) rpoly(2, 1/4, argpi = TRUE) ## set the constant term to 1; can be used, say, for AR models rpoly(2, pi/4, monic = FALSE) rpoly(2, 1/4, argpi = TRUE, monic = FALSE) }) gbutils/tests/testthat.R0000644000176200001440000000007214242736714015061 0ustar liggesuserslibrary(testthat) library(gbutils) test_check("gbutils") gbutils/vignettes/0000755000176200001440000000000014244077073013743 5ustar liggesusersgbutils/vignettes/Plot_pdf.Rnw0000644000176200001440000000720013501136655016176 0ustar liggesusers% preamble taken from the vignette in package strucchange % \documentclass[12pt,a4paper]{article} \usepackage[left=20mm,right=20mm,top=20mm,bottom=20mm]{geometry} \usepackage{graphicx,color,alltt} \usepackage[authoryear,round,longnamesfirst]{natbib} \usepackage{hyperref} \definecolor{Red}{rgb}{0.7,0,0} \definecolor{Blue}{rgb}{0,0,0.8} \definecolor{hellgrau}{rgb}{0.55,0.55,0.55} \newcommand{\E}{\mbox{$\mathsf{E}$}} \newcommand{\VAR}{\mbox{$\mathsf{VAR}$}} \newcommand{\COV}{\mbox{$\mathsf{COV}$}} \newcommand{\p}{\mbox{$\mathsf{P}$}} \newcommand{\email}[1]{\href{mailto:#1}{\normalfont\texttt{#1}}} \newenvironment{smallexample}{\begin{alltt}\small}{\end{alltt}} \setlength{\parskip}{0.5ex plus0.1ex minus0.1ex} \setlength{\parindent}{0em} \bibpunct{(}{)}{;}{a}{}{,} \newcommand{\ui}{\underline{i}} \newcommand{\oi}{\overline{\imath}} \RequirePackage{color} \definecolor{Red}{rgb}{0.5,0,0} \definecolor{Blue}{rgb}{0,0,0.5} \definecolor{hellgrau}{rgb}{0.55,0.55,0.55} \hypersetup{% hyperindex,% colorlinks,% linktocpage,% plainpages=false,% linkcolor=Blue,% citecolor=Blue,% urlcolor=Red,% pdfstartview=Fit,% pdfview={XYZ null null null}% } \usepackage{verbatim} \usepackage{shortvrb} \MakeShortVerb{\|} %\MakeShortVerb{"} \begin{document} \SweaveOpts{engine=R,eps=FALSE} %\VignetteIndexEntry{Plotting with plotpdf()} %\VignetteDepends{gbutils} %\VignetteKeywords{plot, pdf, cdf, quantiles} %\VignettePackage{gbutils} \setkeys{Gin}{width=0.4\textwidth} <>= library(gbutils) @ \title{Plotting with plotpdf()} \author{Georgi N. Boshnakov} \date{} \maketitle The function |plotpdf()| plots a function, usually probability density (pdf) or cumulative distribution function (cdf), over an interval containing the ``interesting'' part of the function. The interval is based on quantiles computed from a supplied cdf or quantile function. |plotpdf()| is most useful when the quantiles are not readily availaible but here are some examples with a normal distribution to illustrate the idea: <<>>= pdf1 <- function(x) dnorm(x, mean = 100, sd = 5) # pdf qdf1 <- function(x) qnorm(x, mean = 100, sd = 5) # qf cdf1 <- function(x) pnorm(x, mean = 100, sd = 5) # cdf @ |plot(pdf1)| works but needs arguments 'from' and 'to' for a meaningful plot. We can simply pass the quantile function to |plotpdf()| to achieve this: <>= plotpdf(pdf1, qdf1) @ Similar result is obtained by supplying the cdf, which is handy when the quantiles are not easily available: <>= plotpdf(pdf1, cdf = cdf1) @ By default, the lower and upper $0.01$ quantiles are used to set the limits on the $x$-axis. This can be changed with arguments |lq| and |uq| <>= plotpdf(pdf1, cdf = cdf1, lq = 0.001, uq = 0.999) @ <>= plotpdf(cdf1, cdf = cdf1, lq = 0.001, uq = 0.999) # plot a cdf @ The pdf and cdf of a mixture distribution are usually straight-forward. Here is an example: <<>>= pf1 <- function(x){ 0.25 * pnorm(x, mean = 3, sd = 0.2) + 0.75 * pnorm(x, mean = -1, sd = 0.5) } df1 <- function(x){ 0.25 * dnorm(x, mean = 3, sd = 0.2) + 0.75 * dnorm(x, mean = -1, sd = 0.5) } @ Here is a plot of the pdf: <>= plotpdf(df1, cdf = pf1) # plot the pdf @ ... and this produces the cdf: <>= plotpdf(pf1, cdf = pf1) # plot the cdf @ Additional arguments can be specified as for |plot()|: <>= plotpdf(pf1, cdf = pf1) # plot the cdf plotpdf(df1, cdf = pf1, add = TRUE, col = "blue") # overlay the pdf @ \bigskip{} |plotpdf()| uses |cdf2quantile()| to compute quantiles from a cdf. |cdf2quantile()| can be used directly, as well: <<>>= c(q5pc = cdf2quantile(0.05, pf1), q95pc = cdf2quantile(0.95, pf1)) @ \end{document} gbutils/R/0000755000176200001440000000000014244077073012134 5ustar liggesusersgbutils/R/isNA.R0000644000176200001440000000052013501136655013103 0ustar liggesusers## 2014-11-10 new file isNA <- function(x){ # 2014-11-10 return TRUE if x is a single NA value and FALSE otherwise. is.atomic(x) && length(x) == 1 && is.na(x) } ## similar code used internally in package Rdpack, e.g. is.missing.arg in parse_pairlist missing_arg <- function(arg) typeof(arg) == "symbol" && deparse(arg) == "" gbutils/R/sim_numbers.R0000644000176200001440000000700313501136655014577 0ustar liggesusers## 2014-10-21 moved from mcompanion # 2015-10-15 - default value for sign sim_real <- function(abs, sign = rep(NA_real_, length(abs)), signprob = 0.5, absgen = "runif", absarg = list(0,1), ...){ abs[is.na(abs)] <- do.call(absgen, c(sum(is.na(abs)), absarg)) sign[is.na(sign)] <- rbinom(sum(is.na(sign)),1,signprob) sign[sign==0] <- -1 abs * sign # note: result has same shape as abs and sign. } # maybe it should be always a vector! ??? # 2015-10-15 - default value for arg sim_complex <- function(abs, arg = rep(NA_real_, length(abs)), absgen = "runif", absarg = list(0,1), arggen = runif, argarg = list(-pi,pi), ... ){ abs[is.na(abs)] <- do.call(absgen, c(sum(is.na(abs)), absarg)) arg[is.na(arg)] <- do.call(arggen, c(sum(is.na(arg)), argarg)) complex(modulus=abs, argument=arg) # note: result is a vector } # 2014-10-21: changed argument "eigval" and component # "eigval" of the returned value to "values" sim_numbers <- function(type = rep(as.character(NA), length(abs)), abs = rep(as.numeric(NA), length(type)), sign = rep(as.numeric(NA), length(type)), values = NULL, ... ){ stopifnot(is.character(type)) # new 2015-10-15 if(is.null(values)){ res <- rep(as.numeric(NA), length(type)) # 2014-06-01 was: as.complex(NA) }else{ stopifnot(length(values) == length(type)) # new 2015-10-15 flags <- !is.na(values) if(any(flags)){ # 2015-10-15 - modified # replace NA's in type with inferred types (from values) type[is.na(type) & flags & Im(values) == 0] <- "r" type[is.na(type) & flags & Im(values) != 0] <- "cp" # complex pair, not "c" # stop if values contradicts type if(!all(type[flags & Im(values) == 0] == "r") || !all(type[flags & Im(values) != 0] == "c" | type[flags & Im(values) != 0] == "cp" ) ## all(!is.na(type))--ne proveryavam, mozhe tova da e polezno ponyakoga. ## (note on 2015-10-15: this is an old comment, below it is ignored!) ){ stop("Argument 'values' is inconsistent with 'type' or 'abs'") } } res <- values } if(any(is.na(type))) # new 2015-10-15 ; todo: check that they are in c("r","c","cp") ? stop(paste("Some NA elements in type could not be resolved:\n", "\ttype = [", paste0(type, collapse=", "), "]")) sel <- type=="r" & is.na(res) res[sel] <- sim_real(abs[sel], sign[sel],...) sel <- (type=="cp" | type=="c") & is.na(res) # 2014-06-01 conditional, to keep it real if no complex values are required # otherwise res will become complex even if length(sel)==0 # 2015-11-13 was: if(length(sel) > 0) ... # (doesn't do what is intended!) if(any(sel)) res[sel] <- sim_complex(abs[sel], sign[sel], ...) list(values=res, type=type) } gbutils/R/pseudoInverse.R0000644000176200001440000000052313501136655015107 0ustar liggesusers## moved here from package mixAR pseudoInverse <- function(a, tol = 1e-7){ # todo: think about the default for 'tol'. asvd <- svd(a) asvd$d[asvd$d < tol] <- Inf # so that 1/Inf = 0, see below if(length(asvd$d)>1) asvd$v %*% diag(1/asvd$d) %*% t(asvd$u) else asvd$v %*% t(asvd$u) / asvd$d # krapka } gbutils/R/mintersect.R0000644000176200001440000000046313501136655014434 0ustar liggesusersmintersect <- function(...){ wrk <- list(...) if(length(wrk)==0) # 2015-02-12 was: return(character(0)) stop("no arguments supplied, at least one is required") res <- wrk[[1]] if(length(wrk) > 1) for(i in 2:length(wrk)) res <- intersect(res, wrk[[i]]) res } gbutils/R/pad.R0000644000176200001440000000364013501136655013023 0ustar liggesuserssetClass("objectPad", representation("list") # , prototype = prototype(list()) ) setMethod("initialize", "objectPad", function(.Object,...) { # callNextMethod mozhe da e neobhodim za naslednitsi na tozi class. # .Object <- callNextMethod() # dali e na pravilnoto myasto? sklad <- list() get <- function(x){ if(missing(x)) sklad else sklad[[x]] } set <- function(x,value){ sklad[[x]] <<- value } .Object$get <- get .Object$set <- set .Object } ) setGeneric("pad", def = function(x,item){standardGeneric("pad")}, useAsDefault = function(x,item){ pad(x@pad,item) } # mozhe s poveche proverki! ) setGeneric("pad<-", def = function(x,item,...,value){standardGeneric("pad<-")}, useAsDefault = function(x,item,...,value){ if(length(list(...))>0) pad(x@pad,item,...) <- value else pad(x@pad,item) <- value x # the above expects that the required values are changed internally. # otherwise assignments to x and/or x@pad will be necessary. } ) setMethod("pad", signature(x = "objectPad", item = "missing") , function(x){ x$get() } ) setMethod("pad", signature(x = "objectPad", item = "ANY") , function(x,item){ x$get(item) } ) setMethod("pad", signature(x = "ANY", item = "missing") , function(x){ x@pad$get() } ) setReplaceMethod("pad", signature(x = "objectPad", item = "ANY", value="ANY") , function(x,item,value){ x$set(item,value); x } ) padcheck <- function(x, item){ # check if item is set, very crude. wrk <- pad(x,item) !is.null(wrk) } gbutils/R/S4utils.R0000644000176200001440000001232313501136655013624 0ustar liggesusers## class2Graph ## classesToAM("MonicFilterClass") ## search() ## classesToAM("ArFilter") ## classesToAM("ArFilter", abbreviate = 0) ## classesToAM("ArFilter", includeSubclasses = TRUE, abbreviate = 0) ## classesToAM("VirtualMonicFilter", includeSubclasses = TRUE, abbreviate = 0) ## classesToAM("VirtualMonicFilter", includeSubclasses = TRUE) ## classesToAM("VirtualMonicFilter", includeSubclasses = TRUE, abbreviate = 0) ## getClasses(asNamespace("sarima")) ## m <- classesToAM(getClasses(asNamespace("sarima")), includeSubclasses = TRUE, abbreviate = 0) ## dim(m) ## m ## search() ## ls(asNamespace("gbutils")) adjacencyOfClasses <- function(packages, externalSubclasses = FALSE, result = c("default", "matrixOfPairs", "adjacencyMatrix"), Wolfram = FALSE){ if(!is.character(packages)) stop("argument 'packages' must be a character vector of names of one or more packages") ## !!! TODO: 'requireNamespace' may have to be changed to 'require', ## since in some cases S4 classes do not become visible. ## Example: 'stats4' (maybe that's the only one, since it does wicked things with base R functions) flags <- sapply(packages, function(pkg) !requireNamespace(pkg)) if(any(flags)) stop("one or more of the requested packages is not available") keep_externals <- externalSubclasses result <- match.arg(result) classes <- lapply(packages, function(pkg) getClasses(asNamespace(pkg)) ) ## TODO: optionally prefix with package names? classes <- unlist(classes) am <- classesToAM(classes, includeSubclasses = rep(TRUE, length(classes)), abbreviate = 0) if(result == "adjacencyMatrix"){ if(!keep_externals){ # no, rectangular matrix is not standard # ## drop rows corresponding to external classes # ind0 <- rownames(am) %in% classes # am <- am[ind0, , drop = FALSE] # keep <- apply(am, 2, function(x) any(x != 0)) # am <- am[ , keep, drop = FALSE] ## prune row0 <- ! (rownames(am) %in% classes) am[row0, ] <- 0 ## remove empty col0 <- apply(am, 2, function(x) all(x == 0)) if(any(row0 & col0)){ keep <- !(row0 & col0) am <- am[keep, keep, drop = FALSE] } } cl <- rownames(am) if(Wolfram){ vertices <- paste0("{", paste0(cl, collapse = ","), "}") ## t(am) since Wolfram interpretes the direction of the edges the other way round rows <- apply(t(am), 1, function(x) paste0( "{", paste0(x, collapse = ", "), "}") ) wmat <- paste0("{", paste0(rows, collapse = ",\n"), " }\n") wrk <- paste0("AdjacencyGraph[", vertices, ", ", wmat, ", VertexLabels -> Automatic", "]") cat(wrk, "\n\n") } return(list(vertices = cl, AM = am)) } colnam <- colnames(am) rownam <- rownames(am) included <- character(0) .clpair <- function(x){ if(keep_externals || rownames(am)[x[1]] %in% classes ){ included <<- c(included, colnam[x[2]], rownam[x[1]]) paste0(colnam[x[2]], " -> ", rownam[x[1]]) }else "" } .clpair2 <- function(x){ if(keep_externals || rownames(am)[x[1]] %in% classes ) c(colnam[x[2]], rownam[x[1]]) else c("", "") } ind <- which(am != 0, arr.ind = TRUE) switch(result, "default" = { if(length(classes) == 0) return(list()) if(length(ind) > 0){ res <- apply(ind, 1, .clpair ) res <- res[res != ""] names(res) <- NULL }else res <- character(0) cl <- unique(c(classes, included)) if(Wolfram){ vertices <- paste0("{", paste0(cl, collapse = ","), "}") edges <- if(length(ind) > 0) paste0("{", paste0(res, collapse = ", "), "}") else "{}" wrk <- paste0("Graph[", vertices, ", ", edges, ", VertexLabels -> Automatic", "]") cat(wrk, "\n\n") } res <- list(vertices = cl, edges = res) }, "matrixOfPairs" = { if(length(classes) == 0) return(list()) res <- t(apply(ind, 1, .clpair2 )) rownames(res) <- NULL emptyrows <- apply(res, 1, function(x) all(x == "")) if(any(emptyrows)){ keep <- !emptyrows res <- res[keep, , drop = FALSE] } cl <- unique(c(classes, res)) if(Wolfram) warning("currently 'Wolfram' is not implemented for matrixOfPairs, use 'default' instead") res <- list(vertices = cl, edges = res) }, ## otherwise stop("the requested type of unimplemented is not implemented yet") ) res } gbutils/R/args.R0000644000176200001440000000424713501136655013217 0ustar liggesusers## from package pcts # zapsmall - chops numbers # 2013-04-02 - obsolete, used it exclusively with from=1, seq_len() is better. # seqinc <- # returns a length(0) numeric vector if from>to # function(from,to){ # useful for "for" loops # seq(from,length.out=max(0,to-from+1)) # do we need "by" or other arguments? # } shiftright <- function(x,k=1){ # works only for 0 <= k <= length(x) ! if(k == 0) # 2014-02-02 bug fix was returning numeric(0) when k=0 ! return(x) ind <- 1:(length(x)-k) c(x[-ind],x[ind]) } shiftleft <- function(x,k=1){ # works only for 0 <= k <= length(x) ! if(k == 0) # 2014-02-02 bug fix was returning numeric(0) when k=0 ! return(x) ind <- seq_len(k) # basically ind <- 1:k, but empty vector if k==0 to work for k=0. c(x[-ind],x[ind]) # TODO: however, this line will not work properly for k == 0, # therefore the "if" remedy above. } myouter <- function(x,y,fun){ res <- matrix(0, nrow=length(x), ncol=length(y)) for(i in 1:length(x)) for(j in 1:length(y)) res[i,j] <- fun(x[i],y[j]) res } nposargs <- function(x,a=FALSE){# x is expected to be a call, usually the result of sys.call() wrk <- as.list(x) tot <- length(wrk) - 1 nameswrk <- names(wrk) named <- if(!is.null(nameswrk)) length(nameswrk[nameswrk!=""]) else 0 res <- tot - named # a patch needed for my purposes follows if( named == 0 && res == 2 && a[1] ) res <- res-1 res } ## 2015-02-12 removed myargnames() since it has identical functionality to allNames ## ## myargnames <- function(x){ # x is expected to be a list ## nameswrk <- names(x) ## res <- if(is.null(nameswrk)) ## character(length(x)) ## else ## nameswrk ## res ## } isargunnamed <- function(x,k){ if( 0= 0)) modsq <- x^2 minustwoRe <- - 2 * x * if(argpi) cospi(arg) else cos(arg) } res <- 1 for(k in seq_along(real)){ res <- c(0, res) - c(real[k] * res, 0) } for(k in seq_along(modsq)){ res <- c(0, 0, res) + c(0, minustwoRe[k] * res, 0) + c(modsq[k] * res, 0, 0) } if(monic) res else res / res[1] } gbutils/NEWS.md0000644000176200001440000000274714243101602013024 0ustar liggesusers# gbutils 0.4.0.9000 * new function `rpoly()` creates polynomials with real coefficients from their zeroes (roots) given in Cartesian or polar form. * minor edits of the documentation of `adjacencyOfClasses()`. # gbutils 0.4-0 (CRAN) # gbutils 0.3-1 * deal with a NOTE on CRAN. * new function `pseudoInverse()` (moved here from package mixAR). * new examples for converting results of `adjacencyOfClasses()` to graph objects and plotting them. # gbutils 0.2-4 - 0.3.0 (CRAN) * new function `adjacencyOfClasses()` gives the graph of the classes defined in one or more packages in several ways. It can also give a Wolfram language expression which can be evaluated in Mathematica, see the help page for details and examples. * use Rd macro `\printExample` from package `Rdpack` for some examples in details section (see `adjacencyOfClasses()`). # gbutils 0.2-3 * created `README.*`. * added website created with 'pkgdown'. * added github URL to DESCRIPTION. # gbutils 0.2-2 * corrected a couple of typo's in the vignette. # gbutils 0.2-1 (CRAN) * New function `missing_arg()` returns TRUE if an element of a pairlist is missing. * New function `plotpdf()` plots probability density and related functions over automatically selected intervals (based on cdf of qf). * New function `cdf2quantile()` numerically computes quantiles of a given cdf. This is mainly for use by `plotpdf()`. * A vignette illustrates `plotpdf()`. # gbutils 0.2-0 (CRAN) * First CRAN version gbutils/MD50000644000176200001440000000427514244115037012244 0ustar liggesusers286af3202c8d2999e573f79a621ce791 *DESCRIPTION 532a775775a50b3da0a9f061da399f24 *NAMESPACE 6bc3257318dc970d11578bd2e6ddf7dc *NEWS.md 8ab411de250851f8de9d2c5803aebd09 *R/S4utils.R 4dfd508726d4d7ac4a83e778b9045a22 *R/args.R eefc1e8cd00d2c71f482e5d861641097 *R/cdf2qf.R 6f26c9bf76ae12adb0bbfec05f656064 *R/history.R a4f8dc9f80b4310e46d99693ecf76f9e *R/isNA.R df87d44b450bbd135752d8abc758dc47 *R/mintersect.R 22f64f916c2920b48e0505fb4407c500 *R/pad.R 1c4e1f551bdb5687aab77cbe0ef690c9 *R/parse_text.R 8af1fad75af507e25fc2ed84228d434d *R/pseudoInverse.R af69f105cb1da5e07b00159531194e9e *R/rpoly.R e6ece8bd36434639c48a59356526c5f1 *R/sim_numbers.R 6d98a61ba46a8c48c7a73420da6e8549 *README.md e4def518ec4ac66446db013f0a8b0d40 *TODO 4a0db7c1833d11f00d59429d1eb74503 *build/partial.rdb a3fa32620b114aafb5673492fa30c9c4 *build/vignette.rds 0ebc687753f5e512c2f0276275daefc3 *inst/REFERENCES.bib 31e78f81e4facebeb081ea29cd7a1fb1 *inst/doc/Plot_pdf.R b35d48ca7c9fffc94e9d16aa1beca62b *inst/doc/Plot_pdf.Rnw bbda5d134bd84c8268b218726e1321ff *inst/doc/Plot_pdf.pdf 71d79a9a61bde87971e9ef9b2f04dc97 *man/adjacencyOfClasses.Rd 74a3f84ff0c049777db1a7864987fc33 *man/cdf2quantile.Rd 73643cd341a927842c72605bf8d504a0 *man/isNA.Rd d53e1748d5fdccdc53bc06b4ee890c81 *man/isargunnamed.Rd 6367745b6230f6b73959693ca9bbc81e *man/mintersect.Rd 7aea6f6c53e8892f40e8e0c2837ba1f9 *man/missing_arg.Rd 14eb84b323fd6f3fc79258ae589efbd0 *man/myouter.Rd 73e6d0054d987b66affdfcb4402825a9 *man/nposargs.Rd 7446ed95d813cf26feb1fc28e497cada *man/objectPad-class.Rd f06b5de9d4d8064f3ebc6e146d102dad *man/pad-methods.Rd d657374fd0a826f38cb34a66d1c15403 *man/parse_text.Rd d924baea827eb5de2ba4bd63fb32ca40 *man/plotpdf.Rd c92aae123f70451203e4099bc93f6b1d *man/pseudoInverse.Rd e0a1be4a490ba3615ab398f8066505b1 *man/raw_history.Rd 4ebad589a285bf2b9ba45e55bd3947ce *man/rpoly.Rd 44d5ebc28bd0b4bebd5546e76bc50d88 *man/sim_complex.Rd 7a5bfc30724d2fad73445d0fd004e313 *man/sim_numbers.Rd dbb53d28a1fb16e6de3b4563d83fdb87 *tests/testthat.R 9d7f56c495f2c960fe22a0fe5a31f81e *tests/testthat/test-isNA.R f4711c7c4912ed6f813145644d5e2ab6 *tests/testthat/test-missing_arg.R 49dd86ef70e6a35497a84bc16f814cf0 *tests/testthat/test-poly.R b35d48ca7c9fffc94e9d16aa1beca62b *vignettes/Plot_pdf.Rnw gbutils/inst/0000755000176200001440000000000014244077073012710 5ustar liggesusersgbutils/inst/REFERENCES.bib0000644000176200001440000000143713501136655015011 0ustar liggesusers@Manual{Rpackage:classGraph, title = {classGraph: Construct Graphs of S4 Class Hierarchies}, author = {Martin Maechler}, year = {2015}, note = {(partly based on code from Robert Gentleman) R package version 0.7-5}, url = {https://CRAN.R-project.org/package=classGraph}, } @Manual{Rpackage:graph, title = {graph: A package to handle graph data structures}, author = {R. Gentleman and Elizabeth Whalen and W. Huber and S. Falcon}, year = {2017}, note = {R package version 1.56.0}, } @Manual{Rpackage:Rgraphviz, title = {Rgraphviz: Provides plotting capabilities for R graph objects}, author = {Kasper Daniel Hansen and Jeff Gentry and Li Long and Robert Gentleman and Seth Falcon and Florian Hahne and Deepayan Sarkar}, year = {2017}, note = {R package version 2.22.0}, } gbutils/inst/doc/0000755000176200001440000000000014244077073013455 5ustar liggesusersgbutils/inst/doc/Plot_pdf.R0000644000176200001440000000474414244077073015360 0ustar liggesusers### R code from vignette source 'Plot_pdf.Rnw' ################################################### ### code chunk number 1: Plot_pdf.Rnw:61-62 ################################################### library(gbutils) ################################################### ### code chunk number 2: Plot_pdf.Rnw:77-80 ################################################### pdf1 <- function(x) dnorm(x, mean = 100, sd = 5) # pdf qdf1 <- function(x) qnorm(x, mean = 100, sd = 5) # qf cdf1 <- function(x) pnorm(x, mean = 100, sd = 5) # cdf ################################################### ### code chunk number 3: Plot_pdf.Rnw:85-86 ################################################### plotpdf(pdf1, qdf1) ################################################### ### code chunk number 4: Plot_pdf.Rnw:91-92 ################################################### plotpdf(pdf1, cdf = cdf1) ################################################### ### code chunk number 5: Plot_pdf.Rnw:97-98 ################################################### plotpdf(pdf1, cdf = cdf1, lq = 0.001, uq = 0.999) ################################################### ### code chunk number 6: Plot_pdf.Rnw:101-102 ################################################### plotpdf(cdf1, cdf = cdf1, lq = 0.001, uq = 0.999) # plot a cdf ################################################### ### code chunk number 7: Plot_pdf.Rnw:106-112 ################################################### pf1 <- function(x){ 0.25 * pnorm(x, mean = 3, sd = 0.2) + 0.75 * pnorm(x, mean = -1, sd = 0.5) } df1 <- function(x){ 0.25 * dnorm(x, mean = 3, sd = 0.2) + 0.75 * dnorm(x, mean = -1, sd = 0.5) } ################################################### ### code chunk number 8: Plot_pdf.Rnw:116-117 ################################################### plotpdf(df1, cdf = pf1) # plot the pdf ################################################### ### code chunk number 9: Plot_pdf.Rnw:121-122 ################################################### plotpdf(pf1, cdf = pf1) # plot the cdf ################################################### ### code chunk number 10: Plot_pdf.Rnw:127-129 ################################################### plotpdf(pf1, cdf = pf1) # plot the cdf plotpdf(df1, cdf = pf1, add = TRUE, col = "blue") # overlay the pdf ################################################### ### code chunk number 11: Plot_pdf.Rnw:136-137 ################################################### c(q5pc = cdf2quantile(0.05, pf1), q95pc = cdf2quantile(0.95, pf1)) gbutils/inst/doc/Plot_pdf.pdf0000644000176200001440000025476414244077073015741 0ustar liggesusers%PDF-1.5 % 7 0 obj << /Length 1208 /Filter /FlateDecode >> stream xWK6W!1$EQ$=mP6blKf}9J΢iEr3o#F2z3Wޯeysm P mDh&*n{omfRXYdImtÕ{>H+ݣo2)#2kPIUY)$7 9M_[?8C1eߧQ(;UyQD)a{N,jL +A(IBBS Val%L&Y]ajxLL*~ U -Ky{Z{Dܰ-{pi[HpwNd[ 91+ UGz/;yb=5"}Ќ`K;.6,crrKliXL刨.Bpٙwj HQR#`-rlcц,߷4"Tfn:oTľg'{2]=Trd2o9u5Sg(R,C>C=HhkF]Ba@LBhR Ckœ>i y*_JyΎ4e.h&rYQ=xXt0p` G0+4E`i]v?"MYy0| v)g)g.rpAFyH'Kcqj[fl<!0xVN`SG*@?'Y<=^aJI.~g;ܴd+wSĵd2KUQ%fd'*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x$ !i@ڐH[EE1PL ⢖V6QP>U(j MFkt,:.FW8c1L&ӎ9ƌaX: rbl1 {{{;}#tp8_\8"Ey.,X%%Gщ1-9ҀKl.oo/O$&'=JvMޞxǥ{=Vs\x ‰N柜>ucKz=s/ol|ϝ?y ^d]ps~:;/;]7|WpQoH!ɻVsnYs}ҽ~4] =>=:`;cܱ'?e~!ańD#G&}'/?^xI֓?+\wx20;5\ӯ_etWf^Qs-mw3+?~O~ endstream endobj 24 0 obj << /Length 644 /Filter /FlateDecode >> stream xUɎ0 + b"Q^ A;]n|qēdDysȭKHxT/=ʼnHr9(Iόa7+xaX,5:b"B{ރP_ʯ%_phq|DgvK^q5d[_P 3ft-~-ۀJS!! O3&RYG: Q1l<1gk Scn{$SgˑsdLr3eG:6O.$W>,0#3~/  UΪdN϶Hj+"v]'뮺gN0u/IO:%\HB| AF"$".6wRk`ˉI{N;lئ;Rd(c&8 d(ŷb*!*F*fJ{[5sS9%5ߏL %w#َ>mMZfN-J˕5o˫Y ]:er'>)OvZ<3qXv:Ź[/\w"mu ˆ|R2peFZ?7LGL=_J9a>+$йРl9a~ endstream endobj 5 0 obj << /Type /XObject /Subtype /Form /FormType 1 /PTEX.FileName (/tmp/RtmpmxyLyA/Rbuild867d486d42c9/gbutils/vignettes/Plot_pdf-004.pdf) /PTEX.PageNumber 1 /PTEX.InfoDict 27 0 R /BBox [0 0 432 432] /Resources << /ProcSet [ /PDF /Text ] /Font << /F2 28 0 R>> /ExtGState << >>/ColorSpace << /sRGB 29 0 R >>>> /Length 1059 /Filter /FlateDecode >> stream xVˎGW>̬-!ޑ|89vAyagzEBi{M(5qdQ(ik>Cч헧?{N/!Z?^oKPw+o[.F5r2zJ&T3J[*j@UX510Q\9P+{ᕅ$&EWDk#;F`Ka-gΑDێWt'6MY̒˞Hc3h"*'c;ޯs%Ir\=Oɺ7gVِ/QH0ct!I8RI4ۦ}@ G!Eˁ1eBh:&%q~6I+)iU_3H|}/5`8 ,$%a 7$[ϯ% m=^9oqŚTl!m 6]vbQp+, f|Z2/1>|c4zZ|-[:U3Neg[XЖ#q,r%',K} jK~p^[b1jByBUWs)sŶe?ZG(Ԟ/Ѹs`4׻5m{s zCBQ~ zK2]DN}z_ݭmѿAW zwrbлs'/ݯ~5/L4jAuWݯ}zn0ntu~o:jV anq=R/E@w_wgtPp%;_sf7/GoQ[̿bq#JSƮ#t^^ l"]''BsKvZ7ۍ^|SGp㗏attx98*7̈p#(pƏgKpjFyo[./ERow:z> \p4wa MKBJ~:zD endstream endobj 31 0 obj << /Alternate /DeviceRGB /N 3 /Length 2596 /Filter /FlateDecode >> stream xwTSϽ7PkhRH H.*1 J"6DTpDQ2(C"QDqpId߼y͛~kg}ֺLX Xňg` lpBF|،l *?Y"1P\8=W%Oɘ4M0J"Y2Vs,[|e92<se'9`2&ctI@o|N6(.sSdl-c(2-yH_/XZ.$&\SM07#1ؙYrfYym";8980m-m(]v^DW~ emi]P`/u}q|^R,g+\Kk)/C_|Rax8t1C^7nfzDp 柇u$/ED˦L L[B@ٹЖX!@~(* {d+} G͋љς}WL$cGD2QZ4 E@@A(q`1D `'u46ptc48.`R0) @Rt CXCP%CBH@Rf[(t CQhz#0 Zl`O828.p|O×X ?:0FBx$ !i@ڐH[EE1PL ⢖V6QP>U(j MFkt,:.FW8c1L&ӎ9ƌaX: rbl1 {{{;}#tp8_\8"Ey.,X%%Gщ1-9ҀKl.oo/O$&'=JvMޞxǥ{=Vs\x ‰N柜>ucKz=s/ol|ϝ?y ^d]ps~:;/;]7|WpQoH!ɻVsnYs}ҽ~4] =>=:`;cܱ'?e~!ańD#G&}'/?^xI֓?+\wx20;5\ӯ_etWf^Qs-mw3+?~O~ endstream endobj 20 0 obj << /Type /XObject /Subtype /Form /FormType 1 /PTEX.FileName (/tmp/RtmpmxyLyA/Rbuild867d486d42c9/gbutils/vignettes/Plot_pdf-005.pdf) /PTEX.PageNumber 1 /PTEX.InfoDict 32 0 R /BBox [0 0 432 432] /Resources << /ProcSet [ /PDF /Text ] /Font << /F2 33 0 R>> /ExtGState << >>/ColorSpace << /sRGB 34 0 R >>>> /Length 1090 /Filter /FlateDecode >> stream xV7 )X&Eok ` ; Eʎ]`3v%0 |p78zMBxC)5qdQ(ik~;h{W<-=;^!rbT#'DnB5qPzs4FQeé.5rcSUd[7e00 MOffOd> buDEį 8j y\SW[WܬK|f?˙խyoм緸{g`8wo]O]M/u6-@.PM7Nl{ڸo`~ ;M]bc {[' i>_iYw@+*p\{+wOq妰߲Kak ,/utRcV&ܳRgS5ww/Gw endstream endobj 36 0 obj << /Alternate /DeviceRGB /N 3 /Length 2596 /Filter /FlateDecode >> stream xwTSϽ7PkhRH H.*1 J"6DTpDQ2(C"QDqpId߼y͛~kg}ֺLX Xňg` lpBF|،l *?Y"1P\8=W%Oɘ4M0J"Y2Vs,[|e92<se'9`2&ctI@o|N6(.sSdl-c(2-yH_/XZ.$&\SM07#1ؙYrfYym";8980m-m(]v^DW~ emi]P`/u}q|^R,g+\Kk)/C_|Rax8t1C^7nfzDp 柇u$/ED˦L L[B@ٹЖX!@~(* {d+} G͋љς}WL$cGD2QZ4 E@@A(q`1D `'u46ptc48.`R0) @Rt CXCP%CBH@Rf[(t CQhz#0 Zl`O828.p|O×X ?:0FBx$ !i@ڐH[EE1PL ⢖V6QP>U(j MFkt,:.FW8c1L&ӎ9ƌaX: rbl1 {{{;}#tp8_\8"Ey.,X%%Gщ1-9ҀKl.oo/O$&'=JvMޞxǥ{=Vs\x ‰N柜>ucKz=s/ol|ϝ?y ^d]ps~:;/;]7|WpQoH!ɻVsnYs}ҽ~4] =>=:`;cܱ'?e~!ańD#G&}'/?^xI֓?+\wx20;5\ӯ_etWf^Qs-mw3+?~O~ endstream endobj 21 0 obj << /Type /XObject /Subtype /Form /FormType 1 /PTEX.FileName (/tmp/RtmpmxyLyA/Rbuild867d486d42c9/gbutils/vignettes/Plot_pdf-006.pdf) /PTEX.PageNumber 1 /PTEX.InfoDict 37 0 R /BBox [0 0 432 432] /Resources <<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WpQoH!ɻVsnYs}ҽ~4] =>=:`;cܱ'?e~!ańD#G&}'/?^xI֓?+\wx20;5\ӯ_etWf^Qs-mw3+?~O~ endstream endobj 43 0 obj << /Type /XObject /Subtype /Form /FormType 1 /PTEX.FileName (/tmp/RtmpmxyLyA/Rbuild867d486d42c9/gbutils/vignettes/Plot_pdf-009.pdf) /PTEX.PageNumber 1 /PTEX.InfoDict 54 0 R /BBox [0 0 432 432] /Resources << /ProcSet [ /PDF /Text ] /Font << /F2 55 0 R>> /ExtGState << >>/ColorSpace << /sRGB 56 0 R >>>> /Length 1093 /Filter /FlateDecode >> stream xMo]E W5c{mH@*uE Jy홛3TQU>gl9&Nw.}N(ԕJIZ$1*ӯ_~|riy3k}-駣3uMPpBiT*>(4 LRdA 6: j Ö=Y!N $ũK}˔rFl=Q+`%Sag2(%VQ M\x }1ƹz\Ve[[PW\Irb(:Q`c=6BÈā͒; K"Lٜ+~t-j<"]/ALz󛺣e-p4 -_зA`2{7H+1FN7;. `Q$=3!Ec, 6Ai^2x$#5[puuXQb+^N#B#8)`(\$z#-ioNl~E`C_wAqpSnJvdmr \IyAelnuBc{w.^ec?H\NVwYImgL8}ף|J~/}ۂϪ`U~9 \]}&G,Źk>v5A =JOFƼRAzsRUy Ww &UYh 2;)0`?yBʺ <>|aeZYc_ 7;FixڽJy/> stream xwTSϽ7PkhRH H.*1 J"6DTpDQ2(C"QDqpId߼y͛~kg}ֺLX Xňg` lpBF|،l *?Y"1P\8=W%Oɘ4M0J"Y2Vs,[|e92<se'9`2&ctI@o|N6(.sSdl-c(2-yH_/XZ.$&\SM07#1ؙYrfYym";8980m-m(]v^DW~ emi]P`/u}q|^R,g+\Kk)/C_|Rax8t1C^7nfzDp 柇u$/ED˦L L[B@ٹЖX!@~(* {d+} G͋љς}WL$cGD2QZ4 E@@A(q`1D `'u46ptc48.`R0) @Rt CXCP%CBH@Rf[(t CQhz#0 Zl`O828.p|O×X ?:0FBx$ !i@ڐH[EE1PL ⢖V6QP>U(j MFkt,:.FW8c1L&ӎ9ƌaX: rbl1 {{{;}#tp8_\8"Ey.,X%%Gщ1-9ҀKl.oo/O$&'=JvMޞxǥ{=Vs\x ‰N柜>ucKz=s/ol|ϝ?y ^d]ps~:;/;]7|WpQoH!ɻVsnYs}ҽ~4] =>=:`;cܱ'?e~!ańD#G&}'/?^xI֓?+\wx20;5\ӯ_etWf^Qs-mw3+?~O~ endstream endobj 61 0 obj << /Length 459 /Filter /FlateDecode >> stream xڵTMo0 Wh"Qd hb msa@ӤK$IQЇMǏĈˆntHN`SCټܲaV߶Q|5?Ls߬}̤iPkK>h;mMkskIwյ3(hhs?> /ExtGState << >>/ColorSpace << /sRGB 65 0 R >>>> /Length 1636 /Filter /FlateDecode >> stream xnEEnR$XlDk(8daK]Cu>?rhs96_6zCAZzDkhZ)׃xE!A #_I%=NKV @7w )GSawuwSn㻻koOl[TP{԰Ԉ_![?^^y[BUA2ތcD62NVy%YloXh6lBrCzJjchjTkJvnm|55qk\ԭqt_Ƌmf(vYkN4|޼[jfst͇eio6ׄ[GkdM]Zz-χglLT: +%L;>Wǻ DP'yҁɓDB)-? FeI#ʅ#lXGPg<#FTniJ^衒y\rǒKvx=cI%_r"ǒvl_ƒV4ظdgG%4pe3t 3 لOec"9Bb4vn!KG,04x cN ~ʼþC%0  D 0 [;`h> ) endstream endobj 67 0 obj << /Alternate /DeviceRGB /N 3 /Length 2596 /Filter /FlateDecode >> stream xwTSϽ7PkhRH H.*1 J"6DTpDQ2(C"QDqpId߼y͛~kg}ֺLX Xňg` lpBF|،l *?Y"1P\8=W%Oɘ4M0J"Y2Vs,[|e92<se'9`2&ctI@o|N6(.sSdl-c(2-yH_/XZ.$&\SM07#1ؙYrfYym";8980m-m(]v^DW~ emi]P`/u}q|^R,g+\Kk)/C_|Rax8t1C^7nfzDp 柇u$/ED˦L L[B@ٹЖX!@~(* {d+} G͋љς}WL$cGD2QZ4 E@@A(q`1D `'u46ptc48.`R0) @Rt CXCP%CBH@Rf[(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ǶB~1Tz}J "E)A\&2Q.Ip`|;_ִ}B{f`Ʋ"l"g 55h㍾('}Sh&< +rqt=~aMwᖆ h eIW3Bl݌ y*(,Fw?8ƶ(Zkwn4GPE&D[ jLF¬{Y,M(d8?/Xܣp7HkS4-.I".ݡwzK֘ ˡ5BLvRSm^.6eٓa" bVԿf9ms4s)Or^HոEZ:(/ Ѕ/-s\V_JKe~w:Qu[ \9ߵsŌan)9/XmZWDN`pl7>k iCkUR3Ckx;%][$wny^}RX?!Tv endstream endobj 86 0 obj << /Producer (pdfTeX-1.40.20) /Author()/Title()/Subject()/Creator(LaTeX with hyperref)/Keywords() /CreationDate (D:20220527083107+01'00') /ModDate (D:20220527083107+01'00') /Trapped /False /PTEX.Fullbanner (This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) kpathsea version 6.3.1) >> endobj 2 0 obj << /Type /ObjStm /N 61 /First 469 /Length 2208 /Filter /FlateDecode >> stream xZ[o~ׯEAQ8Nc;'i ?-DJ IIlvhZevfً,`iɤeR&SUϴLc٠XdNs5P "0P0 ӊI-X1ib@1o0?J7Иc`F0%L)Q/8f (|G aЂY,T`V3kR8Z*%<3e@mԌTrQ1^G!J AUa cx Ã}e|e1eLI^"YQ+^B6O$Yu^/f\L'ɢŸeyjҌyf!Cp-&(]C7)ShG!f3]=RSei;p*Y .Ӭa:]xWIwO) ^wy}ʋ段h|wޞG 4RNq:8ok̭Oz{{yIJqR tvfl.[ґ'#bģnlΕżC|(u+02zFSMer2(WC^9X4tXКPjT$-ycG(PZOr Ci8+#IjJ#i5dZ) .VK:@ 8!ƁZ6 9*Jܳ 4GrdX6/ 1 fGh5BGKH PУU$`.s_!KSWk>Mͪor}%e1 ?|!PfQ2?vjk~fLax|KԦe޶l{%6jyCrʾDE Vf&F ڙo%fś!ܪacY[MuF]6д͌U;t[mVݶޔ#m)H2 Ղގ~K闭,m+MB+:}ܠ[$6ME[ZK/;@LgI+k3mA:M-mt%n=-g#(u>lts~l~iO(} oGD[gJ|3m{jOG޾aC$W̴/s-s[J8Vt.m@_e͠qڱd1%:Nl_gnJ`rt:{Y#~pc[A:<} ܋"bH<._W~;KXiG ] /Length 252 /Filter /FlateDecode >> stream xѻ.Dar\mƸ̌1D-FL)t  R9n~Y;kg'IY$E2;LLڠ؂a"hVșpV~e:M"lB ] =Bba fx=p}o JIQq髷e@&L?^,,yma lzvTjfn=%_6``-|ٟ endstream endobj startxref 88062 %%EOF gbutils/inst/doc/Plot_pdf.Rnw0000644000176200001440000000720013501136655015710 0ustar liggesusers% preamble taken from the vignette in package strucchange % \documentclass[12pt,a4paper]{article} \usepackage[left=20mm,right=20mm,top=20mm,bottom=20mm]{geometry} \usepackage{graphicx,color,alltt} \usepackage[authoryear,round,longnamesfirst]{natbib} \usepackage{hyperref} \definecolor{Red}{rgb}{0.7,0,0} \definecolor{Blue}{rgb}{0,0,0.8} \definecolor{hellgrau}{rgb}{0.55,0.55,0.55} \newcommand{\E}{\mbox{$\mathsf{E}$}} \newcommand{\VAR}{\mbox{$\mathsf{VAR}$}} \newcommand{\COV}{\mbox{$\mathsf{COV}$}} \newcommand{\p}{\mbox{$\mathsf{P}$}} \newcommand{\email}[1]{\href{mailto:#1}{\normalfont\texttt{#1}}} \newenvironment{smallexample}{\begin{alltt}\small}{\end{alltt}} \setlength{\parskip}{0.5ex plus0.1ex minus0.1ex} \setlength{\parindent}{0em} \bibpunct{(}{)}{;}{a}{}{,} \newcommand{\ui}{\underline{i}} \newcommand{\oi}{\overline{\imath}} \RequirePackage{color} \definecolor{Red}{rgb}{0.5,0,0} \definecolor{Blue}{rgb}{0,0,0.5} \definecolor{hellgrau}{rgb}{0.55,0.55,0.55} \hypersetup{% hyperindex,% colorlinks,% linktocpage,% plainpages=false,% linkcolor=Blue,% citecolor=Blue,% urlcolor=Red,% pdfstartview=Fit,% pdfview={XYZ null null null}% } \usepackage{verbatim} \usepackage{shortvrb} \MakeShortVerb{\|} %\MakeShortVerb{"} \begin{document} \SweaveOpts{engine=R,eps=FALSE} %\VignetteIndexEntry{Plotting with plotpdf()} %\VignetteDepends{gbutils} %\VignetteKeywords{plot, pdf, cdf, quantiles} %\VignettePackage{gbutils} \setkeys{Gin}{width=0.4\textwidth} <>= library(gbutils) @ \title{Plotting with plotpdf()} \author{Georgi N. Boshnakov} \date{} \maketitle The function |plotpdf()| plots a function, usually probability density (pdf) or cumulative distribution function (cdf), over an interval containing the ``interesting'' part of the function. The interval is based on quantiles computed from a supplied cdf or quantile function. |plotpdf()| is most useful when the quantiles are not readily availaible but here are some examples with a normal distribution to illustrate the idea: <<>>= pdf1 <- function(x) dnorm(x, mean = 100, sd = 5) # pdf qdf1 <- function(x) qnorm(x, mean = 100, sd = 5) # qf cdf1 <- function(x) pnorm(x, mean = 100, sd = 5) # cdf @ |plot(pdf1)| works but needs arguments 'from' and 'to' for a meaningful plot. We can simply pass the quantile function to |plotpdf()| to achieve this: <>= plotpdf(pdf1, qdf1) @ Similar result is obtained by supplying the cdf, which is handy when the quantiles are not easily available: <>= plotpdf(pdf1, cdf = cdf1) @ By default, the lower and upper $0.01$ quantiles are used to set the limits on the $x$-axis. This can be changed with arguments |lq| and |uq| <>= plotpdf(pdf1, cdf = cdf1, lq = 0.001, uq = 0.999) @ <>= plotpdf(cdf1, cdf = cdf1, lq = 0.001, uq = 0.999) # plot a cdf @ The pdf and cdf of a mixture distribution are usually straight-forward. Here is an example: <<>>= pf1 <- function(x){ 0.25 * pnorm(x, mean = 3, sd = 0.2) + 0.75 * pnorm(x, mean = -1, sd = 0.5) } df1 <- function(x){ 0.25 * dnorm(x, mean = 3, sd = 0.2) + 0.75 * dnorm(x, mean = -1, sd = 0.5) } @ Here is a plot of the pdf: <>= plotpdf(df1, cdf = pf1) # plot the pdf @ ... and this produces the cdf: <>= plotpdf(pf1, cdf = pf1) # plot the cdf @ Additional arguments can be specified as for |plot()|: <>= plotpdf(pf1, cdf = pf1) # plot the cdf plotpdf(df1, cdf = pf1, add = TRUE, col = "blue") # overlay the pdf @ \bigskip{} |plotpdf()| uses |cdf2quantile()| to compute quantiles from a cdf. |cdf2quantile()| can be used directly, as well: <<>>= c(q5pc = cdf2quantile(0.05, pf1), q95pc = cdf2quantile(0.95, pf1)) @ \end{document}