similar to: random sequences for rnorm and runif

Displaying 20 results from an estimated 800 matches similar to: "random sequences for rnorm and runif"

2011 Apr 04
3
How to speed up grouping time series, help please
I retrieve for a few hundred times a group of time series (10-15 ts with 10000 values each), on every group I do some calculation, graphs etc. I wonder if there is a faster method than what presented below to get an appropriate timeseries object. Making a query with RODBC for every group I get a data frame like this: > X ID DATE VALUE 14 3 2000-01-01 00:00:03 0.5726334
2009 Nov 25
1
help writing for loop
Hi, I?d like to ask for some help in writing a loop. My situation is the following: I have a matrix (matrix.A) containing 3 columns and 100 rows. The columns represent parameter estimates a, b, and c. The rows contain different values for these parameter estimates. Each row is unique. I want to insert these parameter estimates into a model (say, y = a + bx + cx^2) and solve for y given a
2002 Jun 13
3
Bug in rnorm. (PR#1664)
There appears to be a mild bug, or at least a deficiency, in rnorm. The bug becomes apparent when one looks at extremes of the squares of the values generated by rnorm; rnorm is not generating quite enough extreme values. The R version that I am using is 1.4.1; I never got around to installing 1.5.0, and now since 1.5.1 is about to come out .... However, checking the 1.5.0 release notes
2005 Jun 08
6
Random seed problem in MCMC coupling of chains
Hello! I am performing coupling of chains in MCMC and I need the same value of seed for two chains. I will show demo of what I want: R code, which might show my example is: niter <- 3 nchain <- 2 tmpSeed <- 123 for (i in 1:niter) { # iterations for (j in 1:nchain) { # chains set.seed(tmpSeed) a <- runif(1) cat("iter:", i, "chain:", j,
2002 Mar 25
2
Extreme value distributions (Long.)
This may not actually be an R/Splus problem, but it started off that way ..... ===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+===+=== Executive summary: ================== Simulations involving extreme value distributions seem to ``work'' when the underlying distribution is exponential(1) or exponential(2) == chi-squared_2, but NOT when the underlying distribution is
2020 Nov 04
2
sprintf, check number of parameters
Dear Tomas,Thank you.Regarding the "unnumbered" arguments, i.e. sprintf('%f %f', 1, 2, 3). This was the case I wanted to report, here a warning can be very useful.Regarding the "numbered" arguments, that is, sprintf('%$1f %$3f', 1, 2, 3). Here, omission of an argument might be intended, for example, in an application with support for multiple languages.
2017 Sep 02
2
Strange lazy evaluation of default arguments
Another way to avoid the problem is to not redefine variables that are arguments. E.g., > Su3 <- function(u=100, l=u, mu=0.53, sigma2=4.3^2, verbose) { if (verbose) { print(c(u, l, mu)) } uNormalized <- u/sqrt(sigma2) lNormalized <- l/sqrt(sigma2) muNormalized <- mu/sqrt(sigma2) c(uNormalized, lNormalized, muNormalized) } > Su3(verbose=TRUE)
2017 Sep 02
6
Strange lazy evaluation of default arguments
Dear R developers, sessionInfo() below Please have a look at the following two versions of the same function: 1. Intended behavior: > Su1 = function(u=100, l=u, mu=0.53, sigma2=4.3^2) + { + print(c(u, l, mu)) # here, l is set to u?s value + u = u/sqrt(sigma2) + l = l/sqrt(sigma2) + mu = mu/sqrt(sigma2) + print(c(u, l, mu)) + } > > Su1() [1] 100.00 100.00 0.53 [1]
2020 Sep 20
2
sprintf, check number of parameters
Dear R developers, I am wondering if this should raise an error or a warning. > sprintf('%.f, %.f', 1, 2, 3) [1] "1, 2" I am aware that R has ?numbered? sprintf arguments (sprintf('%1$.f', ?), and in that case, omissing of specific arguments may be intended. But in the usual syntax, omission of an argument is probably a mistake. Thank you for your consideration.
2017 Sep 02
0
Strange lazy evaluation of default arguments
Dear Bill, All makes perfect sense (including the late evaluation). I actually discovered the problem by looking at old code which used your proposed solution. Still I find it strange (and, hnestly, I don?t like R?s behavior in this respect), and I am wondering why u is not being copied to L just before u is assigned a new value. Of course, this would require the R interpreter to track all these
2012 Feb 22
1
line width in legend of interaction.plot
Dear R developers, The following command produces an interaction plot with lwd=2. interaction.plot(c(1, 2, 1, 2), c(1, 1, 2, 2), 1:4, lwd=2) In the legend, however, lwd seems to be 1, which does not seem to be intended behavior. Probably the lwd is not correctly forwarded to legend: from the interaction.plot source: legend(xleg, yleg, legend = ylabs, col = col, pch = if (type %in%
2009 Sep 30
3
programming to calculate variance
Dear R-user Suppose I have the following data y=c(2,1,5,8,11,3,1,7,50,21,33,7,60) x=data.frame(y) for(i in 4:nrow(x)) x[i,] =var(x[i-3:i-1,]) I'm trying to get a new variable with the variance of the 3 previous values (just an example) and with NA in the three first positions. I know that my for() is wrong but I'm not able to find my error. Any idea? Thanks, Marlene.
2012 Oct 09
1
ylim with only one value specified
Dear R developers, I would like to have R choose the limits of the y-axis semi-automatically, e.g., zero should be included, but the maximum should be chosen depending on the data. Examples: plot(1:10, 1:10) # selects min and max automatically plot(1:10, 1:10, ylim=c(1, 10)) # manual definition plot(1:10, 1:10, ylim=c(0, Inf)) # this would be a nice feature, i.e. lower y limit = 0 defined
2011 Mar 10
1
ANOVA for stratified cox regression
This is a follow-up to a query that was posted regarding some problems that emerge when running anova analyses for cox models, posted by Mathias Gondan: Matthias Gondan wrote: >* Dear List,*>**>* I have tried a stratified Cox Regression, it is working fine, except for*>* the "Anova"-Tests:*>**>* Here the commands (should work out of the box):*>**>*
2010 Aug 10
1
[Fwd: Re: optimization subject to constraints]
-------------- next part -------------- An embedded message was scrubbed... From: Gildas Mazo <gildas.mazo at curie.fr> Subject: Re: [R] optimization subject to constraints Date: Tue, 10 Aug 2010 15:49:19 +0200 Size: 4924 URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100810/78862894/attachment.eml>
2017 Sep 02
0
Strange lazy evaluation of default arguments
Hello, One way of preventing that is to use ?force. Just put force(l) right after the commented out print and before you change 'u'. Hope this helps, Rui Barradas Citando Matthias Gondan <matthias-gondan at gmx.de>: > Dear R developers, > > sessionInfo() below > > Please have a look at the following two versions of the same function: > > 1. Intended
2010 Mar 05
4
Nonparametric generalization of ANOVA
My interpretation of the relation between 1-way ANOVA and Wilcoxon's test (wilcox.test() in R) is the following. 1-way ANOVA is to test if two or multiple distributions are the same, assuming all the distributions are normal and have equal variances. Wilcoxon's test is to test two distributions are the same without assuming what their distributions are. In this sense, I'm wondering
2008 Feb 13
1
Package for sample size calculation
Dear list, Is anyone aware of a library for sample size calculation in R, similar to NQuery? I have to give a course in this area, and I would like to enable the students playing around with this. Best wishes, Matthias
2009 May 08
1
sscanf
Dear list, Apparently, there is no function like sscanf in R. I have a string, "Condition: 311", and I would like to read out the number and store it to a numeric variable. Is there an easy way to do this? Best wishes, Matthias --
2009 Aug 31
1
Test for stochastic dominance, non-inferiority test for distributions
Dear R-Users, Is anyone aware of a significance test which allows demonstrating that one distribution dominates another? Let F(t) and G(t) be two distribution functions, the alternative hypothesis would be something like: F(t) >= G(t), for all t null hypothesis: F(t) < G(t), for some t. Best wishes, Matthias PS. This one would be ok, as well: F(t) > G(t), for all t null