[R] [R-pkgs] release 2.4 of distr-family of packages on CRAN

2013-02-08 Thread Peter Ruckdeschel
New versions 2.4 of our distr-family of packages are submitted to
CRAN and will soon be available on all mirrors

(i.e.; startupmsg, SweaveListingUtils, distr, distrEx, distrDoc,
distrEllipse, distrMod, distrSim, distrTEst, distrTeach)

In addition, there is a new package distrRmetrics with distr support
for (some) distributions provided in the Rmetrics family of packages.

For more details see the corresponding NEWS files in the pkgs, e.g.
news(package = "distr") or NEWS("distr") [the latter using fct NEWS
from pkg startupmsg].

We are looking forward to getting your RFEs, bug reports
or simple feedback,

Best, Peter and coauthors (CC).

___
R-packages mailing list
r-packa...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Negative exponential fit

2011-11-30 Thread Peter Ruckdeschel
Am 29.11.2011 07:06, schrieb Indrajit Sengupta:
> What have you tried so far - can you explain? "fitdistrplus" package is the 
> default package for fitting distributions.
> 
> Regards,
> Indrajit
> 
> 
> 
> 
>  From: rch4 
> To: r-help@r-project.org 
> Sent: Tuesday, November 29, 2011 8:39 AM
> Subject: [R] Negative exponential fit
>  
> We need help
> 
> We are doing a project for a statistical class in and we are looking at
> world record times in different running events over time. We are trying to
> fit the data with a negative exponential but we just cant seem to get a
> function that works properly. 
> we have on our x-axis the date and on the y-axis the time(in seconds). So as
> you can imagine, the times have decreased and appear to be approaching a
> limit. Any ideas for a nls function that would work for us would be greatly
> appreciated. 
> 
> Rob
> 
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/Negative-exponential-fit-tp4117889p4117889.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>   [[alternative HTML version deleted]]
> 

I do not want to shed out any doubt as to the merits of
pkg fitdistrplus, in particular for censored data, but
seconding Uwe's reply later in this thread, you may
also want to check out pkg distrMod on CRAN ---

M. Kohl, P. Ruckdeschel (2010): R Package distrMod: S4
  Classes and Methods for Probability Models. Journal of Statistical
  Software, 35(10), 1-27. URL http://www.jstatsoft.org/v35/i10/.

which offers quite some additional flexibility for model
fitting---including "new models" (built on distributions
which "have no name" but instead are image distributions
under arithmetic transformations of existing ones, see
example M2 in the cited ref) and (nonlinear) transformations
of the parameter (see Example p.15, cited ref).

Best regards,
Peter

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] [Workshop] Finance with R

2011-10-04 Thread Peter Ruckdeschel
The Financial Mathematics department of Fraunhofer ITWM 
is offering a two-days workshop on Finance with R:

%-
[Workshop] Finance with R
%-

Oct 20, 2011, 10:00-17:00 and
Oct 21, 2011,  9:00-16:00

Fraunhofer ITWM, Fraunhofer-Platz 1, 67663 Kaiserslautern,
Germany

%-
Scope and purpose
%-

This workshop provides an introduction to R for professionals 
and academics in Finance. 

It gives an insight into possibilities of data analysis and 
statistics with R, import of data sets, generation of graphics 
and preparation of reports, according to their relevance 
in Finance.

Besides providing insight into financial modeling in R, in 
particular we demonstrate the use of the Rmetrics family 
of R packages as well as an R bridge to the Quantlib library. 
We also cover integration of R into Excel, interaction with 
Matlab, and import from Bloomberg.

%
Benefits of attending
%

The workshop provides insight into statistical models and 
concepts in R which are useful for various problems arising 
in Finance. 

The attendees will be able to import datasets into R, analyze 
them statistically and apply concepts from time series modeling. 

In practical sessions, the attendees will learn and practice 
how to use R.

The fee for the workshop is 500 EUR.

For further details, see
http://www.itwm.fraunhofer.de/en/departments/financial-mathematics/events/2011-workshop-series.html

Peter Ruckdeschel

-- 
Dr. habil. Peter Ruckdeschel, Abteilung Finanzmathematik, F3.17
Fraunhofer ITWM, Fraunhofer Platz 1, 67663 Kaiserslautern
Telefon:  +49 631/31600-4699   Fax:  +49 631/31600-5699
E-Mail :  peter.ruckdesc...@itwm.fraunhofer.de
http://www.itwm.fraunhofer.de/abteilungen/finanzmathematik/mitarbeiterinnen/mitarbeiter/dr-peter-ruckdeschel.html

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] problem with function "Truncate" in package "distr"

2011-09-23 Thread Peter Ruckdeschel
Am 21.09.2011 17:05, schrieb Uwe Ligges:
> 
> 
> On 21.09.2011 11:53, Duarte Viana wrote:
>> Hello all,
>>
>> Can someone tell me why the following mixture of two log-normal
>> distributions does not get truncated? What puzzles me is that the
>> function works almost always, but for certain combinations (like the
>> one below), it does not.
>>
>> # R code example
>> library(distr)
>> mix<-UnivarMixingDistribution(Lnorm(3.2,0.5),Lnorm(5.4,0.6),mixCoeff=c(0.3,0.7))
>>
>> mix.trunc<-Truncate(mix,lower=0.001,upper=3000)
>> distr.sample<-r(mix.trunc)(100)
>> range(distr.sample)
>>
>> Why do I get values over 3000 (which was the defoned upper limit)?
>>
>> Some help would be greatly appreciated.
> 
> 
> Some question for the author of package distr, I believe.
> 
> Uwe Ligges
> 

seconded, Uwe, and settled off-line
[BTW was an issue of the globally set accuracy].

Best, Peter (one of the authors of distr)

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] [R-pkgs] New package versions for distr- and robast- families

2011-01-26 Thread Dr. Peter Ruckdeschel



New versions 2.3 of our distr-family of packages are now
available on CRAN.

(i.e.; startupmsg, SweaveListingUtils,
   distr, distrEx, distrDoc, distrEllipse,
   distrMod, distrSim, distrTEst, distrTeach)

Most importantly, we have included:

+ a quasi-MC trick by Nataliya Horbenko to better produce
  image distributions under complicated, not necessarily
  monotone transformations
+ enhanced function qqplot
+ (enhanced) support for GEV distribution
+ new functional kMad
+ as well as several bug fixes

For more details see the corresponding NEWS files
(e.g. news(package = "distr")
or using function NEWS from package startupmsg
i.e. NEWS("distr")).

We are looking forward to getting your RFEs, bug reports 
or simple feedback,

Best,

Peter, Matthias, Nataliya




New versions 0.8 of our RobASt-family of packages are now
available on CRAN.

(i.e.; RandVar, RobAStBase, ROptEst,
   RobLox, ROptEstOld, ROptEstTS, RobRex,
   RobLoxBioC)

Most importantly, we have included:

+ a quasi-MC trick by Nataliya Horbenko to better produce
  random variables under complicated not necessarily
  monotone transformations

+ enhanced functions
   infoPlot, (plots relative information used for coordinates
  of a parameter estimator)
   ddPlot, (distance-distance plot)
   cniperPointPlot, (cniper concept for seemingly harmless
contamination behavior)
   qqplot (now gets outlier corrected versions)

+ new risks: asAnscombe, asL1, asL4
  for asymptotic L1 L4 risk, and optimal bias robust estimator,
   to given efficiency loss in ideal model

+ new helper methods makeIC
  to apply to functions or list of functions
  for easily producing (suboptimal) ICs

+ new function getReq for two ICs IC1 and IC2
  to compute a radius interval where IC1 is better
  than IC2 acc. to G-Risk

+ new function getMaxIneff() to compute,
  for any IC of class 'IC', the maximal inefficiency
  for radius r varying in [0,Inf)

+ as well as several bug fixes

For more details see the corresponding NEWS files
(e.g. news(package = "RobAStBase")
or using function NEWS from package startupmsg
i.e. NEWS("RobAStBase")).

We are looking forward to getting your RFEs, bug reports 
or simple feedback,


Best,

Peter, Matthias, Nataliya


--------

-- 
Dr. Peter Ruckdeschel, Abteilung Finanzmathematik, F3.17
Fraunhofer ITWM, Fraunhofer Platz 1, 67663 Kaiserslautern
Telefon:  +49 631/31600-4699
Fax:  +49 631/31600-5699
E-Mail :  peter.ruckdesc...@itwm.fraunhofer.de

___
R-packages mailing list
r-packa...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Latex and Stangle()

2010-05-08 Thread Peter Ruckdeschel
sorry for my late reply,

Am 06.05.2010 13:16, schrieb Silvano:
> It worked very well.
> 
> Thanks Frank and Ruihong, both solutions were great.

you might also want to try out package

  SweaveListingsUtils

from CRAN, which provides some extra features
interfacing the 'listings' package and Sweave;

in particular it supports syntax highlighting in
different styles of attached packages
[dynamic; i.e.; keyword definitions are made only
 at attach time of extra packages]

as well as functionality to include R / Rd source
files (sniplets) copied from an url, thereby
avoiding inconsistencies between vignettes
and documented source code.

I do not know whether this suits
your demands, but anyway...

Kind regards
Peter
[Maintainer of SweaveListingsUtils]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Latex and Stangle()

2010-05-08 Thread Peter Ruckdeschel
sorry for my late reply,

Am 06.05.2010 13:16, schrieb Silvano:
> It worked very well.
> 
> Thanks Frank and Ruihong, both solutions were great.

you might also want to try out package

  SweaveListingsUtils

from CRAN, which provides some extra features
interfacing the 'listings' package and Sweave;

in particular it supports syntax highlighting in
different styles of attached packages
[dynamic; i.e.; keyword definitions are made only
 at attach time of extra packages]

as well as functionality to include R / Rd source
files (sniplets) copied from an url, thereby
avoiding inconsistencies between vignettes
and documented source code.

I do not know whether this suits
your demands, but anyway...

Kind regards
Peter
[Maintainer of SweaveListingsUtils]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how can generate from trunceted gamma distribution in R ?

2009-12-14 Thread Peter Ruckdeschel

> Duncan Murdoch wrote:
>> On 11/12/2009 7:12 AM, khaz...@ceremade.dauphine.fr wrote:
>>> Hi, all
>>> How can generate a sample from truncated inverse  gamma distribution
>>> in R?
>>
>> Using the inverse CDF method or rejection sampling are possible,
>> depending on what your truncation is like.  If your truncation forces
>> the observations far out into the tails, you need to be careful about
>> rounding and underflow when using the the inverse CDF method.
>>
>> Duncan Murdoch
>>
> 
> I think perusal of this paper might be a good idea:
> 
> Sampling Truncated Normal, Beta, and Gamma Densities
> Paul Damien and Stephen G. Walker
> Journal of Computational and Graphical Statistics, Vol. 10, No. 2 (Jun.,
> 2001), pp. 206-215
> 
> Remembering that the inverse gamma is the inverse of a gamma, you may be
> able to get a truncated inverse gamma from a truncated (at the other
> end) gamma. Alternatively, the methodology outlined in the paper most
> likely can be modified for the inverse gamma.
> 
> David Scott
> 

While David Scott's reply definitely gives a more problem specific
solution than we could offer, you might also want to look at package
"distr" on CRAN where a general truncation operator for distributions is
provided --- see ?Truncate (after installing/attaching package distr).

The inverse Gamma so far is not implemented to distr as an S4-class
(you could easily do this yourself, though). But, as David Scott
mentioned you can produce it by something along the lines

require(distr)
G0 <- Gammad(scale = 2.3, shape = 1.4) ## generates a Gamma distribution
G <- 1/G0 ## the corresponding inverse Gamma
d(G)(2) ### density of G at 2
p(G)(4) ## cdf of G at 4 ...

## example for Truncated G
TG <- Truncate(G, lower=0, upper=0.9)
 ## the lower=0  is somehow redundant in this case, will see if this
 ## can be set automatically in a next release..

q(TG)(0.99) ## upper 1% quantile

## and some functionals:
require(distrEx)
E(TG)
mad(TG)
sd(TG)

## I am not claiming that this code gives extremely accurate results,
## but for higher accuracy, you could easily overload operator "/" for
## operands "numeric", "Gammad" (and if you like, correspondingly,
## write methods for E())

Note that our package even takes into account that you might
want to use log-scales if you are interested in the tails,
so it takes up Duncan Murdoch's comment in some sense,
automatically.


Best, Peter

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] distr package

2009-10-09 Thread Peter Ruckdeschel
Thanks David,

for answering this question.

> On Oct 8, 2009, at 4:33 AM, msig...@yahoo.com wrote:
> 
>> Dear all
>> when I try to install "distr", the following error appears, I am using
>> R in windows. can u suggest me?
>>
> 
> I'm not a Windows user, but the obvious questions would be "How?". What
> commands or method? and "Which?" (version of Windows and the ever
> present question for Vista users ... what is your level of admin
> privileges), and "Is that everything?" (was that the entire output?)
> 
> And the second obvious question: Why have you not included output from:
> 
>  sessionInfo()
> 
> Perhaps a not so obvious question that you should answer:  what is the
> output from:
> 
>  .libPaths()
> 
> 
>> Error in normalizePath(path) :
>>  path[1]="C:\Program Files\R\R-2.9.1\library/distr": The system cannot
>> find the file specified

I can assist David's comments.

@ the original poster:

It might be a backslash thing (and does not seem to be
connected to package distr in any respect):

Within R, even on Windows, you can use the forward slash as folder
separator, so your trailing "/distr" seems to be oK.

Backslashes, which in R on Windows may also serve for this purpose,
have to be escaped, so you might eigher try

"C:/Program Files/R/R-2.9.1/library/distr"

or

"C:\\Program Files\\R\R-2.9.1\\library/distr"

In fact you have not told us all you saw, I suppose:
Didn't you get this warning, too?

In addition: Warning messages:
1: '\P' is an unrecognized escape in a character string
2: '\R' is an unrecognized escape in a character string
3: '\R' is an unrecognized escape in a character string
4: unrecognized escapes removed from "C:\Program Files\R\R-2.9.1/distr"

which already told you the problem.

btw: it would be nice also if you could at least tell us your
name so that we can address you personally.

Peter Ruckdeschel,
maintainer of package distr

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] pass "..." to multiple sub-functions

2009-10-01 Thread Peter Ruckdeschel
Dear Baptiste,

> I know I have seen this discussed before but I haven't been successful
> in searching for "ellipsis", "dots", "..." in the archives. I would
> like to filter "..." arguments according to their name, and dispatch
> them to two sub-functions, say fun1 and fun2. I looked at lm() but it
> seemed more complicated than I need as it modifies the calling
> function among other things. What is the best approach for this? My
> current version presented below seems very awkward.
> 
> Best regards,
> 
> baptiste
> 
> sessionInfo()
> R version 2.9.2 (2009-08-24)
> i386-apple-darwin8.11.1
> 
> fun1 <- function(col, row){
>   print(col)
>   print(row)
> }
> 
> fun2 <- function(x){
>   print(x)
> }
> 
> foo <- function(..., lty=1){
> 
>   dots <- list(...)
> 
>   cl <- match.call()
> 
>   col <- eval.parent(cl$col)
>   row <- eval.parent(cl$row)
> 
>   params.fun1 <-  c("col", "row")
> 
>   removed <- na.omit(match(names(cl), params.fun1))
>   # index whichever arguments were passed to fun1
> 
>   fun1(col, row)
> 
>   fun2(dots[seq_along(dots)[-removed]])

Instead of passing all remaining arguments stacked into
one list (= 1 argument x to function fun2) you might want
to be able to retain them as distinct arguments;

so you might want to replace fun2 by

  fun2.a <- function(...) print(list(...))

and the call to fun2 in foo by

  do.call(fun2.a, dots.remaining)

where, sticking to your code, you could obtain
dots.remaining as

   removed <- na.omit(match(names(cl), params.fun1))
   dots.remaining <- dots[seq_along(dots)[-removed]]

or by

   removed <- c("lty",params.fun1)
   ## I assume you do not want to pass on argument "lty"...
   dots.remaining <- cl[-1] ### remove the function name
   dots.remaining <- dots.remaining[! names(dots.remaining)
 %in% removed]

Best, Peter

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Sweavelistingutil: Encoding problems

2009-09-04 Thread Peter Ruckdeschel
Hello Rasmus,

> I am not sure whether this is a bug or lack of R experience.

It is not your lack of R experience, and whether it is a bug
I am not sure ;-)

> However, I am using your Sweavelistingutil package, which is very
> nice. 

Thank you.

> Obviously I use it to create LaTeX files. These are encoded in
> utf8.
> 
> However, when I use the Sweavelistingutil is uses some funky
> character for "`" and "'" that is not recognized.

This is an issue I already have run into, too, more specifically,
when a (Linux-based) colleage sent me something I wanted to proceed
working on under Windows.

The easy solution is to use

   options(fancyQuotes=FALSE)

in your R-code which avoids these "too-fancy" quotes.

Otherwise it is a TeX-package listings issue.

I have just looked into the documentation
listings.pdf (see vignette to SweaveListingUtils
for the exact reference).

On p.13/14 the authors propose to set

   extendedchars=false

"[...] to avoid having listings get entangled in the other package’s
extended-character treatment."

I have hence just included this parameter as default in
the devel version of SweaveListingUtils (on r-forge, btw).

For the moment, you could use

<>=
require(SweaveListingUtils)
SweaveListingoptions(intermediate = FALSE)
SweaveListingoptions(Rset = c(getSweaveListingOption("Rset"),
  "extendedchars" = "false"))
SweaveListingPreparations(ae = FALSE)
@

in your .Rnw (or .Rtex) file.

[BTW: the R-command
  setToBeDefinedPkgs(pkgs = c("SweaveListingUtils","distr"),

  keywordstyles = c("\\bf\\color{blue}","\\bf\\color{red}"))

is /not/ needed in general --- it is just for the purpose of
the vignette, ie. for producing the package-individual
coloring of keywords for /our/ packages
distr, SweaveListingUtils (and in general, you will not be
using distr, will you?)
OTOH you might want to use some similar command to give special
markup to keywords of your documented packages.

(In our devel-version there already is a corresponding comment...)
]

HTH, Peter

> Here is an example from my tex-file:
> 
> ,
> |   Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> `
> 
> When comping this I get the following error:
> 
> ,
> | ERROR: Package inputenc Error: Unicode char
> | \u8:\...@fillfixed@\...@ec not set up
> `
> 
> There is /no problem/ when I the normal sweave-package.
> 
> The relevant part of my preamble looks like this:
> 
> ,
> | \documentclass[a4paper]{scrartcl}
> | \usepackage{scrpage2}
> | \usepackage[english,danish]{babel}
> | \usepackage[T1]{fontenc}
> | \usepackage[utf8]{inputenc}
> `
> 
> And the "R-settings" looks like this (basically copied from the viginette):
> 
> ,
> | %\usepackage[noae]{Sweave}
> | \SweaveOpts{keep.source=TRUE}
> | % 
> ---
> | <>=
> | require(SweaveListingUtils)
> | SweaveListingoptions(intermediate = FALSE)
> | SweaveListingPreparations(ae = FALSE)
> | setToBeDefinedPkgs(pkgs = c("SweaveListingUtils","distr"),
> |keywordstyles = 
> c("\\bf\\color{blue}","\\bf\\color{red}"))
> | @Hello,
> 
> I am not sure whether this is a bug or lack of R experience.
> 
> However, I am using your Sweavelistingsutil package, which is very
> nice. Obviously I use it to create LaTeX files. These are encoded in
> utf8.
> 
> However, when I use the Sweavelistingsutil is uses some funky
> character for "`" and "'" that is not recongnized.
> 
> Here is an example from my tex-file:
> 
> ,
> |   Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> `
> 
> When comping this I get the following error:
> 
> ,
> | ERROR: Package inputenc Error: Unicode char
> | \u8:\...@fillfixed@\...@ec not set up
> `
> 
> There is /no problem/ when I the normal sweave-package.
> 
> The relevant part of my preamble looks like this:
> 
> ,
> | \documentclass[a4paper]{scrartcl}
> | \usepackage{scrpage2}
> | \usepackage[english,danish]{babel}
> | \usepackage[T1]{fontenc}
> | \usepackage[utf8]{inputenc}
> `
> 
> And the "R-settings" looks like this (basically copied from the viginette):
> 
> ,
> | %\usepackage[noae]{Sweave}
> | \SweaveOpts{keep.source=TRUE}
> | % 
> ---
> | <>=
> | require(SweaveListingUtils)
> | SweaveListingoptions(intermediate = FALSE)
> | SweaveListingPreparations(ae = FALSE)
> | setToBeDefinedPkgs(pkgs = c("SweaveListingUtils","distr"),
> |keywordstyles = 
> c("\\bf\\color{blue}","\\bf\\color{red}"))
> | @
> | % 
> ---
> | \lstdefinestyle{TeXstyle}{fancyvrb=true,escapechar=`,language=[LaTeX]TeX,%
> | basicstyle={\color{black}\small},%
> | keywordstyle={\bf\color{black}},%
> |
> commentstyle={\color{Rcommentcolor}\ttfamily\itshape},%
> | lite

Re: [R] SweaveListingUtils question

2009-07-16 Thread Peter Ruckdeschel
Hi Karsten,

as you will know, SweaveListingUtils is a contributed package,
so it is a good habit to address the package maintainer (which
is me in this case) directly.

I clearly do not mind discussing this on r-help, but maybe
this already quite busy mailing list should not be bothered
too much with packages (like mine) which are "only" contributed.

A note for future questions:

In case of SweaveListingUtils (and similarly for other contributed
packages I am the maintainer of), this package is developped under
   r-forge,   https://r-forge.r-project.org
and on this platform, I have set up an archieved mailing list
devoted to package development of SweaveListingUtils:
   distr-swvlistut...@lists.r-forge.r-project.org
Please address this list for future questions concerning this package.

> recently I read about the SweaveListingUtils package and now I would
> like to try it out. However I can not make it run...

Let's see why...

> Below is a minimal example. The problem seems the following line,
> generated by the package:
>
> \ifthenelse{\boolean{swe...@gin}}{\setkeys{gin}{width=0.6\textwidth}}{}%

Actually, this is part of the TeX style file Sweave.sty shipped
out with R;  now for our special definitions of environments Sinput,
Soutput, and Scode, we decided to only insert those parts of Sweave.sty
which still are necessary and issue these ourselves within the output
of SweaveListingPreparations().

So we need to prevent Sweave() (the R command) to insert
a "\usepackage{Sweave}" before \begin{docoment} in order to avoid
redefinitions (which caused your error).

This can be done by inserting

%
% this comment persuades Sweave not to insert \usepackage{Sweave}
%

to your .Rnw / .Rtex file. (Sweave() will find this and think
this is not in comments...)
Then everything should work; hopefully, at least.

Kind regards,
Peter

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] [R-pkgs] SweaveListingUtils --- a package for joining markup provided by TeX package 'listings' with Sweave

2009-07-02 Thread Peter Ruckdeschel
As indicated in some off-list mail by Frank E. Harrell Jr.,
the announcement of the availability of package

%-
SweaveListingUtils
%-

on CRAN, mingled into mail "New versions for the distr-family of
packages" to R-pkgs from 21 Apr 2009, will probably have gone
unnoticed by some people who might be interested in this package.

Briefly, SweaveListingUtils provides utilities to make accessible
the markup commands provided by TeX package 'listings' (Heinz and Moses
(2007)) for use with Sweave (confer Leisch(2002a,b,2003).

R-functions for setting R-markup in Sweave by means of 'listings'
command \lstset are defined. (lstsetR, lstsetRd)

R-Comments will automatically be set in a different style using
\lstset- resp. lstsetR()- argument 'commentstyle'.

Different coloring for input, output and comments is set by default.

.Rd markup is defined as a new "sublanguage" of TeX for listings package.

Perhaps most useful is a feature for automatic keyword registration
to listings for markup: We dynamically create a list of such keywords
by masking/extending commands require(), library() such that, in
addition to the usual behavior, these commands after attaching package
SweaveListingUtils issue TeX (or more specifically listings) code
registering for markup all keywords found by ls() in the search() list;
besides this side effect require(), library() should behave as usual.
This way, each package can have its own markup style which can be useful
to highlight ones own new functions in a different way.

Finally, SweaveListingUtils also covers inclusion of code
sniplets from a repository / an url (notably/by default from r-forge).
This can help to include R code from source files in some package
R folder to be consistently documented in some vignette.

For details you may wish to consider  ?lstinputSourceFromRForge
and vignette "ExampleSweaveListingUtils".

I'd look forward to receiving questions, comments and
suggestions

Best,
Peter Ruckdeschel

___
R-packages mailing list
r-packa...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] [R-pkgs] New versions for the distr-family of packages

2009-04-20 Thread Peter Ruckdeschel
---
New versions released for the distr family of package
---

We would like to announce the availability on CRAN (with possibly a
minor delay until on every mirror) of new versions of our packages 
in the "distr"-family (version 2.1), i.e.; "distr", "distrEx", 
"distrSim", "distrTEst", "distrDoc",  "distrMod", and "distrTeach", 
as well as our supporting package "startupmsg" and the new
(supporting) package "SweaveListingUtils".

[all of them require R >= 2.6.0]

For details, please also refer to the NEWS file of the corresponding
package, accessible via NEWS("") [after require()]

---
Devel versions on r-forge
---

Development of these packages is done under r-forge project /distr/:

http://r-forge.r-project.org/projects/distr/
http://distr.r-forge.r-project.org/

If you find this project interesting and would like to collaborate, you are
warmly welcome. You may find more information on how to collaborate under

http://distr.r-forge.r-project.org/HOWTO-collaborate.txt

We look forward to receiving questions, comments and suggestions

Peter Ruckdeschel
Matthias Kohl

Below you find a list of major improvements in version 2.1:

%-
SweaveListingUtils:
%-
  + a new package devoted to joining markup provided by TeX package
  'listings' with Sweave;
  + also covers inclusion of code sniplets from an url
 (notably r-forge) in order to ease consistency
  of documentation with code that is being developed.
see also ?lstinputSourceFromRForge and
vignette "ExampleSweaveListingUtils"
%-
distr
%-
  COMPOUND DISTRIBUTIONS
  + new support of compound distributions,
  see ?CompoundDistribution, class?CompoundDistribution
  ENHANCED ACCURACY
  + by log scale
   Following Peter Dalgaard's hint
 https://stat.ethz.ch/pipermail/r-help/2008-September/174295.html
   we use the log.p argument to be able to simulate accurately from
   the far out tails.
  + refined collapsing technique for DiscreteDistribution
  + more frequent use of FFT for convolution by better treatment of
  joint lattices
  AUTOMATIC GENERATION OF IMAGE DISTRIBUTION
  + slot r is now /much/ faster / slimmer for results of *,/,^
  + slot d for results of *,/, exp() now is correct at 0 by extrapolation
  COMFORT METHODS
  + getLow/getUp methods  (for "reasonable" endpoints for distributions with
   possibly unbounded support) for
   *DiscreteDistribution,
   *AbscontDistribution,
   *UnivarLebDecDistribution,
   *UnivarMixingDistribution
  + q.r, p.l (methods for right continuous quantile function
  and left continuous cdf) for
   * DiscreteDistribution
   * AbscontDistribution (takes care of constancy regions in p)
   * UnivarLebDecDistribution
   * UnivarMixingDistribution
  + prob methods (returning vectors/matrices of probabilities of support)
   + DiscreteDistribution
   + UnivarLebDecDistribution (conditional/unconditional)
  + p.ac, d.ac, p.discrete, d.discrete methods (for
UnivarLebDecDistribution)
now conditional/unconditional
%-
distrEx
%-
  FUNCTIONALS
  + expectation gains explicit arguments to set accuracy locally;
  + median and IQR are now defined for UnivariateCondDistribution
  + cross-checked (and bug-fixed) particular functionals against
  general implementations
  DISTRIBUTIONS
  + gains distribution Pareto; ported from pkg actuar by Nataliya Horbenko
  DISTANCES:
  + introduces distances asymmetric total variation distances
 *OAsymTotalVarDist
 *AsymTotalVarDist
  + TotalVarDist and HellingerDist gain extra arguments
  to better control the integration range and exactness
%-
distrMod
%-
  MODELS
  + added mad.const to guarantee for mad-consistency in location scale model
  for general central distribution
  TRAFO
  + fixed some inconsistencies with slot trafo:
  now when trafo is a function, we try to keep it as a function under
  moves of the parametric model
  + trafo.fct() to access the "function" aspect of trafo
  + trafoEst() transforming an estimator of class "estimate"
  consistently  by a "trafo" function
  ESTIMATION
  + enhanced Covariance calculation for CvMDist-MD

Re: [R] Integral implicit function

2007-12-10 Thread Peter Ruckdeschel

Have you tried vectorizing the inner function? 
Hint: integrate() calls the integrand vectorwise... 
in your example,
  integrate(Vectorize(f),lower=1,upper=2)
should do what you expected.

Best,
Peter


Eddy H. G. Bekkers wrote:
> 
> Hi,
> 
> Could somebody help me with the following. I want to calculate the
> integral over an implicit function. I thought to integrate over a function
> depending on uniroot. In previous topics I found a thread about finding
> the root of an integral. And that works. But the other way around, does
> not work. Does R support this?
> 
> I included the following example. The function in the example is very easy
> and can be solved explicitly, but when it does not work for such an easy
> function it will certainly not work for a more difficult function. First
> the root of an integral (which works) and then the integral of a function
> dependent on uniroot:
> 
> # Calculating the root of an integral
> 
> a<- function(x,y)
> {x-y}
> 
> b<- function(y)
> {integrate(a,lower=1,upper=2,y=y)$value}
> 
> d<- uniroot(b,c(0,10))$root
> 
> print(d)
> 
> # Calculating the integral of a function dependent on uniroot
> 
> e<- function(u,v)
> {u-v}
> 
> f<- function(v)
> {uniroot(e,c(0,10),v=v)$root}
> 
> g<- integrate(f,lower=1,upper=2)$value
> 
> print(g)
> 
> Does anyone have suggestions how to proceed? By the way, the implicit
> function I am targeting does have a unique solution, it is only not
> explicitly solvable, i.e. in the example above, you cannot solve u as a
> function of v explicitly, so as to substitute it in the integrand. 
> 
> 
> Thanks a lot in advance for your help,
> 
> Best regards,
> 
> Eddy Bekkers
> Department of Economics
> Erasmus University Rotterdam
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Integral-implicit-function-tp14201932p14260535.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.