Re: [Rd] StructTS
Hi Roy Have you managed to find the source code for StructTS after all? I am looking for it as well but cant seem to find it, thanks Chris Roy Mendelssohn wrote: > > I apologize in advance if I picked the wrong list to post this to. I > have made an effort to find the answers to these questions on CRAN, > but if they are there, I couldn't find them, and I was going to email > the developer of StructTS directly but could not find who that is. > > I have 2 interrelated questions about StructTS > > 1. Where can I obtain the source code for StructTS if I wanted to > produce a similar function with an extended capability? > > 2. Would the person who developed StructTS have any interest in > adding the ability to include an AR term and/or a stochastic cycle? > > Thanks in advance, > > -Roy M. > > > > ** > "The contents of this message do not reflect any position of the U.S. > Government or NOAA." > ** > Roy Mendelssohn > Supervisory Operations Research Analyst > NOAA/NMFS > Environmental Research Division > Southwest Fisheries Science Center > 1352 Lighthouse Avenue > Pacific Grove, CA 93950-2097 > > e-mail: [EMAIL PROTECTED] (Note new e-mail address) > voice: (831)-648-9029 > fax: (831)-648-8440 > www: http://www.pfeg.noaa.gov/ > > "Old age and treachery will overcome youth and skill." > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > > -- View this message in context: http://www.nabble.com/StructTS-tp9857181p16627538.html Sent from the R devel mailing list archive at Nabble.com. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] StructTS
On 4/11/2008 7:23 AM, Christian_Ivaha wrote: > Hi Roy > > Have you managed to find the source code for StructTS after all? I am > looking for it as well but cant seem to find it, thanks StructTS is in the stats package, which is a base package. That means its source is part of the R source code. You can find the source of all base packages in https://svn.r-project.org/R/trunk/src/library. (This is the development branch; if you're looking for a particular version, replace trunk with tags/* or branches/*, where the * determines the version.) For example, the soon-to-be-released version 2.7.0 of StructTS would be in https://svn.r-project.org/R/branches/R-2-7-branch/src/library/stats/R/StructTS.R Duncan Murdoch > > Chris > > > > Roy Mendelssohn wrote: >> >> I apologize in advance if I picked the wrong list to post this to. I >> have made an effort to find the answers to these questions on CRAN, >> but if they are there, I couldn't find them, and I was going to email >> the developer of StructTS directly but could not find who that is. >> >> I have 2 interrelated questions about StructTS >> >> 1. Where can I obtain the source code for StructTS if I wanted to >> produce a similar function with an extended capability? >> >> 2. Would the person who developed StructTS have any interest in >> adding the ability to include an AR term and/or a stochastic cycle? >> >> Thanks in advance, >> >> -Roy M. >> >> >> >> ** >> "The contents of this message do not reflect any position of the U.S. >> Government or NOAA." >> ** >> Roy Mendelssohn >> Supervisory Operations Research Analyst >> NOAA/NMFS >> Environmental Research Division >> Southwest Fisheries Science Center >> 1352 Lighthouse Avenue >> Pacific Grove, CA 93950-2097 >> >> e-mail: [EMAIL PROTECTED] (Note new e-mail address) >> voice: (831)-648-9029 >> fax: (831)-648-8440 >> www: http://www.pfeg.noaa.gov/ >> >> "Old age and treachery will overcome youth and skill." >> >> __ >> R-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-devel >> >> > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] make check fails if called with --without-recommended-packages
Hi, just for information: On Suse 10.3 x86 > make check fails, if configure was called with --without-recommended-packages for the latest beta. The problem I stumbled upon is located in utlis. Here comes the relevant part of utils-Ex.Rout.fail in R-2.7.0/tests/Examples > ### ** Examples > > require(stats) > glmout <- capture.output(example(glm)) Fehler in .find.package(package, lib.loc, verbose = verbose) : there is no package called 'MASS' Calls: capture.output ... eval.with.vis -> eval.with.vis -> -> .find.package Ausführung angehalten Seems tests using recommended packages aren't disabled, even if given --without-recommended-packages. May be it's by design, i.e. make check shall only be run with recommended packages, may be it's a bug(let). Regards Detlef __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] make check fails if called with --without-recommended-packages
It is by design. Some tests will fail if you don't have iconv, also. From the manual: Failures are not necessarily problems as they might be caused by missing functionality, but you should look carefully at any reported discrepancies. and that option is not even documented in the manual. If you build without recommended packages or iconv or readline, you have to consciously do so and hence are expected to be aware that you have 'missing functionality'. On Fri, 11 Apr 2008, Detlef Steuer wrote: Hi, just for information: On Suse 10.3 x86 make check fails, if configure was called with --without-recommended-packages for the latest beta. The problem I stumbled upon is located in utlis. Here comes the relevant part of utils-Ex.Rout.fail in R-2.7.0/tests/Examples ### ** Examples require(stats) glmout <- capture.output(example(glm)) Fehler in .find.package(package, lib.loc, verbose = verbose) : there is no package called 'MASS' Calls: capture.output ... eval.with.vis -> eval.with.vis -> -> .find.package Ausführung angehalten Seems tests using recommended packages aren't disabled, even if given --without-recommended-packages. May be it's by design, i.e. make check shall only be run with recommended packages, may be it's a bug(let). Regards Detlef __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595__ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R_SHARE_DIR not defined for use in tests/Makefile running under Windows
You seem to be confusing environment and make variables. I think '$(R_SHARE_DIR)' is never set by R makefiles (except when building R), but may be set by make from an environment variable. On all (recentish) systems where the share dir is not ${R_HOME}/share, ${R_SHARE_DIR} is set by the 'R' shell script. There are such systems -- but not under Windows. So ${R_SHARE_DIR-${R_HOME}/share} is the environment variable you want to look at. On Mon, 7 Apr 2008, Tony Plate wrote: > The make variable $(R_SHARE_DIR) seems to be available for use in > tests/Makefile when running under Linux, but not Windows (R-2.6.2, R-2.6.1, > R-2.7.0 alpha 2008-04-06, under Windows XP 64 bit, built locally for 32 bit). > > Is this intentional, or an oversight? Is it OK to use $(R_HOME)/share > instead (seems to work OK)? > > I notice the following in /src/gnuwin32/front-ends/rcmdfn.c (from R-alpha > 2008-04-06), which would suggest that the intention was that R_SHARE_DIR > should be defined... (and I assume it would propagate to to be available in > a Makefile.) > > int rcmdfn (int cmdarg, int argc, char **argv) > { > /* tasks: >find R_HOME, set as env variable >set R_SHARE_DIR as env variable >set PATH to include R_HOME\bin >set PERL5LIB to %R_SHARE_DIR%/perl;%Perl5LIB% >set TEXINPUTS to %R_SHARE_DIR%/texmf;%TEXINPUTS% >set HOME if unset >launch %R_HOME%\bin\$* > */ > > -- Tony Plate > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] StructTS
No I didn't find it, but I assume it is in the main R source. -Roy On Apr 11, 2008, at 4:23 AM, Christian_Ivaha wrote: > > Hi Roy > > Have you managed to find the source code for StructTS after all? I am > looking for it as well but cant seem to find it, thanks > > Chris > > > > Roy Mendelssohn wrote: >> >> I apologize in advance if I picked the wrong list to post this to. I >> have made an effort to find the answers to these questions on CRAN, >> but if they are there, I couldn't find them, and I was going to email >> the developer of StructTS directly but could not find who that is. >> >> I have 2 interrelated questions about StructTS >> >> 1. Where can I obtain the source code for StructTS if I wanted to >> produce a similar function with an extended capability? >> >> 2. Would the person who developed StructTS have any interest in >> adding the ability to include an AR term and/or a stochastic cycle? >> >> Thanks in advance, >> >> -Roy M. >> >> >> >> ** >> "The contents of this message do not reflect any position of the U.S. >> Government or NOAA." >> ** >> Roy Mendelssohn >> Supervisory Operations Research Analyst >> NOAA/NMFS >> Environmental Research Division >> Southwest Fisheries Science Center >> 1352 Lighthouse Avenue >> Pacific Grove, CA 93950-2097 >> >> e-mail: [EMAIL PROTECTED] (Note new e-mail address) >> voice: (831)-648-9029 >> fax: (831)-648-8440 >> www: http://www.pfeg.noaa.gov/ >> >> "Old age and treachery will overcome youth and skill." >> >> __ >> R-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-devel >> >> > > -- > View this message in context: http://www.nabble.com/StructTS- > tp9857181p16627538.html > Sent from the R devel mailing list archive at Nabble.com. > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel ** "The contents of this message do not reflect any position of the U.S. Government or NOAA." ** Roy Mendelssohn Supervisory Operations Research Analyst NOAA/NMFS Environmental Research Division Southwest Fisheries Science Center 1352 Lighthouse Avenue Pacific Grove, CA 93950-2097 e-mail: [EMAIL PROTECTED] (Note new e-mail address) voice: (831)-648-9029 fax: (831)-648-8440 www: http://www.pfeg.noaa.gov/ "Old age and treachery will overcome youth and skill." __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Adding a Matrix Exponentiation Operator
Dear Martin et al., Paul Gilbert forwarded me your discussions on this topic. I have been interested in computing f(A), where A is any square matrix and f(.) is an analytic function whose Taylor-McLaurin series has a finite radius of convergence. There exist special algorithms when f(.) is square-root, exponential, logarithm (note: the TM series for this doesn't have a finite-radius of convergence), sine, and cosine. The easiest way to handle a general f(.) is via spectral decomposition, but that is limited to diagonalizable matrices, and is also ill-conditioned. A paper by Davies and Higham (SIAM 2003) provide an algorithm, the Schur-Parlett method, for doing this. I think this is the state-of-the-art for evaluating f(A). Higham also has a recent SIAM book (2008) on computing f(A). There are matlab codes provided with that, but it doesn't have the algorithm discussed in his (2003) paper. I asked him for the code, but he was unable to share it with me. I suspect this may be due to proprietary issues since this is implemented in the latest Matlab release. However, we should be able to do this in R based on the algorithmic description in is (2003) paper. Would this be of interest to the R group? Best, Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins University Ph: (410) 502-2619 Fax: (410) 614-9625 Email: [EMAIL PROTECTED] Webpage: http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martin Maechler Sent: Saturday, April 05, 2008 1:52 PM To: Rory Winston Cc: r-devel@r-project.org Subject: Re: [Rd] Adding a Matrix Exponentiation Operator > "RW" == Rory Winston <[EMAIL PROTECTED]> > on Sat, 5 Apr 2008 14:44:44 +0100 writes: RW> Hi all I recently started to write a matrix RW> exponentiation operator for R (by adding a new operator RW> definition to names.c, and adding the following code to RW> arrays.c). It is not finished yet, but I would like to RW> solicit some comments, as there are a few areas of R's RW> internals that I am still feeling my way around. RW> Firstly: RW> 1) Would there be interest in adding a new operator %^% RW> that performs the matrix equivalent of the scalar ^ RW> operator? Yes. A few weeks ago, I had investigated a bit about this and found several R-help/R-devel postings with code proposals and then about half dozen CRAN packages with diverse implementations of the matrix power (I say "power" very much on purpose, in order to not confuse it with the matrix exponential which is another much more interesting topic, also recently (+- two months?) talked about. Consequently I made a few timing tests and found that indeed, the "smart matrix power" {computing m^2, m^4, ... and only those multiplications needed} as you find it in many good books about algorithms and e.g. also in *the* standard Golub & Van Loan "Matrix Computation" is better than "the eigen" method even for large powers. matPower <- function(X,n) ## Function to calculate the n-th power of a matrix X { if(n != round(n)) { n <- round(n) warning("rounding exponent `n' to", n) } if(n == 0) return(diag(nrow = nrow(X))) n <- n - 1 phi <- X ## pot <- X # the first power of the matrix. while (n > 0) { if (n %% 2) phi <- phi %*% X if (n == 1) break n <- n %/% 2 X <- X %*% X } return(phi) } "Simultaneously" people where looking at the matrix exponential expm() in the Matrix package, and some of us had consequently started the 'expm' project on R-forge. The main goal there has been to investigate several algorithms for the matrix exponential, notably the one buggy implementation (in the 'Matrix' package until a couple of weeks ago, the bug stemming from 'octave' implementation). The authors of 'actuar', Vincent and Christophe, notably also had code for the matrix *power* in a C (building on BLAS) and I had added an R-interface '%^%' there as well. Yes, with the goal to move that (not the matrix exponential yet) into standard R. Even though it's not used so often (in percentage of all uses of R), it's simple to *right*, and I have seen very many versions of the matrix power that were much slower / inaccurate / ... such that a reference implementation seems to be called for. So, please consider install.packages("expm",repos="http://R-Forge.R-project.org";) -- but only from tomorrow for Windows (which installs a pre-compiled package), since I found that we had accidentally broken the package trivially by small changes two weeks ago. and then library(expm)
[Rd] Documentation: pls add xref from "sum" to "rowSums" (PR#11145)
Full_Name: Mike.Prager Version: 2.6.2 OS: Windows XP Prof + SP2 Submission from: (NULL) (192.154.40.252) Please add a cross-reference in R help files from "sum" to "rowSums" and also from "mean" to "rowMeans". Reasons: (1) New users may not be aware of rowSums, etc., and the simple functions will be their points of entry to the help files. (2) Even old users can't remember everything (or sometimes, much of anything). Thanks for considering it! __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] StructTS
Thanks a lot for that!!! Best Regards, Christian Ivaha PhD Student University of Glamorgan Faculty of Advanced Technology Treforest CF37 1DL -Original Message- From: Duncan Murdoch [mailto:[EMAIL PROTECTED] Sent: 11 April 2008 13:33 To: Ivaha C (AT) Cc: r-devel@r-project.org Subject: Re: [Rd] StructTS On 4/11/2008 7:23 AM, Christian_Ivaha wrote: > Hi Roy > > Have you managed to find the source code for StructTS after all? I am > looking for it as well but cant seem to find it, thanks StructTS is in the stats package, which is a base package. That means its source is part of the R source code. You can find the source of all base packages in https://svn.r-project.org/R/trunk/src/library. (This is the development branch; if you're looking for a particular version, replace trunk with tags/* or branches/*, where the * determines the version.) For example, the soon-to-be-released version 2.7.0 of StructTS would be in https://svn.r-project.org/R/branches/R-2-7-branch/src/library/stats/R/St ructTS.R Duncan Murdoch > > Chris > > > > Roy Mendelssohn wrote: >> >> I apologize in advance if I picked the wrong list to post this to. I >> have made an effort to find the answers to these questions on CRAN, >> but if they are there, I couldn't find them, and I was going to email >> the developer of StructTS directly but could not find who that is. >> >> I have 2 interrelated questions about StructTS >> >> 1. Where can I obtain the source code for StructTS if I wanted to >> produce a similar function with an extended capability? >> >> 2. Would the person who developed StructTS have any interest in >> adding the ability to include an AR term and/or a stochastic cycle? >> >> Thanks in advance, >> >> -Roy M. >> >> >> >> ** >> "The contents of this message do not reflect any position of the U.S. >> Government or NOAA." >> ** >> Roy Mendelssohn >> Supervisory Operations Research Analyst >> NOAA/NMFS >> Environmental Research Division >> Southwest Fisheries Science Center >> 1352 Lighthouse Avenue >> Pacific Grove, CA 93950-2097 >> >> e-mail: [EMAIL PROTECTED] (Note new e-mail address) >> voice: (831)-648-9029 >> fax: (831)-648-8440 >> www: http://www.pfeg.noaa.gov/ >> >> "Old age and treachery will overcome youth and skill." >> >> __ >> R-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-devel >> >> > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R_SHARE_DIR not defined for use in tests/Makefile running under Windows
Ok, thanks for the info. The reason I'm asking about this is that I'm trying to eliminate reasons for having a Makefile.win to accompany a Makefile in the tests directory of a package. I guess I can have /tests/Makefile conditionally set R_SHARE_DIR to $(R_HOME)/share if it is undefined. (aside: where can ${R_SHARE_DIR-${R_HOME}/share} be used? -- I couldn't get that syntax to do anything useful in gnu make v 3.79 from the R toolset for Windows.) It still seem that src/gnuwin32/front-ends/rcmdfn.c:rcmdfn() is not completing the tasks spelled out in the comments at the top of the function: >> /* tasks: >>find R_HOME, set as env variable >>set R_SHARE_DIR as env variable Further down in rcmdfn() there is the code: /* currently used by Rd2dvi and by perl Vars.pm (with default) */ strcpy(RSHARE, "R_START_DIR="); strcat(RSHARE, RHome); strcat(RSHARE, "/share"); putenv(RSHARE); However, neither $R_HOME/src/scripts/Rd2dvi nor $R_HOME/share/perl/R/Vars.pm refer to the env var R_START_DIR, though they do use R_SHARE_DIR (and no other files in the entire R source tree apart from rcmdfn.c contain the string R_START_DIR, AFAICS). So, is this just a simple typo of having R_START_DIR instead of R_SHARE_DIR in src/gnuwin32/front-ends/rcmdfn.c? On the topic of make variables vs environment variables, don't variables in the environment become make variables? This is what the gnu make documentation says: (http://www.gnu.org/software/make/manual/make.html#Environment) 6.9 Variables from the Environment ... Every environment variable that make sees when it starts up is transformed into a make variable with the same name and value... So, is there any difference between $(X) and ${X} (parenthesis vs braces) in variable references in makefiles? I see in a different thread that Prof Brian Ripley states (in the context of makefiles) "$(MYVAR) is a make variable, and ${MYVAR} is an environment variable" ("Problem with Makefile.win and environment variable", 2008/03/21), but AFAICS, the gnu make documentation suggests these can be used interchangeably (http://www.gnu.org/software/make/manual/make.html#Reference). And, is it ok to assume that the 'make' used for running tests will be a "gnu make", or is that a dangerous assumption (and the answer to my question above)? -- Tony Plate Prof Brian Ripley wrote: > You seem to be confusing environment and make variables. I think > '$(R_SHARE_DIR)' is never set by R makefiles (except when building R), > but may be set by make from an environment variable. > > On all (recentish) systems where the share dir is not ${R_HOME}/share, > ${R_SHARE_DIR} is set by the 'R' shell script. There are such systems > -- but not under Windows. > > So ${R_SHARE_DIR-${R_HOME}/share} is the environment variable you want > to look at. > > > On Mon, 7 Apr 2008, Tony Plate wrote: > >> The make variable $(R_SHARE_DIR) seems to be available for use in >> tests/Makefile when running under Linux, but not Windows (R-2.6.2, >> R-2.6.1, >> R-2.7.0 alpha 2008-04-06, under Windows XP 64 bit, built locally for >> 32 bit). >> >> Is this intentional, or an oversight? Is it OK to use $(R_HOME)/share >> instead (seems to work OK)? >> >> I notice the following in /src/gnuwin32/front-ends/rcmdfn.c (from R-alpha >> 2008-04-06), which would suggest that the intention was that R_SHARE_DIR >> should be defined... (and I assume it would propagate to to be >> available in >> a Makefile.) >> >> int rcmdfn (int cmdarg, int argc, char **argv) >> { >> /* tasks: >>find R_HOME, set as env variable >>set R_SHARE_DIR as env variable >>set PATH to include R_HOME\bin >>set PERL5LIB to %R_SHARE_DIR%/perl;%Perl5LIB% >>set TEXINPUTS to %R_SHARE_DIR%/texmf;%TEXINPUTS% >>set HOME if unset >>launch %R_HOME%\bin\$* >> */ >> >> -- Tony Plate >> >> __ >> R-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-devel >> > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel