similar to: rexp and rweibull

Displaying 20 results from an estimated 2000 matches similar to: "rexp and rweibull"

2006 Aug 15
1
rexp question
I am using rexp to generate several exponential distributions. I am passing rexp a vector of rates , r. I am wanting to simulate a sample of size 200 for each rate so the code looks like: rexp(n=200*length(r),rate=r) this gives me a vector of the random exponential variables, but they are all disjointed b/c rexp goes through and simulates an exponential variable for each rate and it does that 200
2012 Jan 27
3
generate a random number with rexp ?
dear list I use runif to generate a ramdom number between min and max runif(n, min=0, max=1) however , the syntaxe of rexp does not allow that rexp(n, rate = 1) and it generate a number with the corresponding rate. The question is: how to generate a number between min and max using rexp(). Regards -- PhD candidate in Computer Science Address 3 avenue lamine, cité ezzahra, Sousse 4000
2014 Jan 17
1
rexp, different results on 32/64 bit
Hi all, I just run into this today. Apparently rexp() sometimes gives different slightly results for the same seed on 32 bit and 64 bit machines. runif() is the same for both, so the problem seems to be in rexp(). 64 bit Linux is the same as 64 bit OSX, and R-devel gives the same results as R-3.0.2. Best, Gabor # --------------------------------------------- > options(digits=22) ;
2008 May 23
1
Evaluation "conflict" in combination of replicate() and rexp()as variable inside a function
Dear userRs, "playing around" with combinations of replicate() and random number generating functions inside a self-defined "wrapper" function I encounterd a puzzling behaviour. The following are intentionally simple (and rather nonsense-) examples to isolate the relevant aspects. Please, note the seemingly "inconsistent" behaviour for the second call of
2002 May 03
6
problems with rexp ?
Does anyone know if R have any problems with the exponential random number generation (function rexp)? I comment it because I executed data<-sort(rexp(100)) plot(data,dexp(data)/(1-pexp(data)),type="l") and the graphic isn't constant. (Note: exponential distribution have a constant hazard failure rate). Thank you, Juan
2009 Mar 17
3
R does not compile any more on FreeBSD 8.0-CURRENT
On a recent FreeBSD 8.0-CURRENT (i386) building R (any version) breaks with the following messages: ---------------------------------------------------------------------- [...snip...] gcc -std=gnu99 -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c wilcox.c -o wilcox.o gcc -std=gnu99 -I. -I../../src/include -I../../src/include -I/usr/local/include
2006 Jul 19
1
ASCII dump from an REXP (JRI)
Hi Simon, Thanks so much for your help. Your advice has been taken to heart. I now pass in blocks of 100,000 records, and it does 100,000 predictions in seconds and returns a logical vector with the predictions to an int array. It works like a charm! I want to reference what we were talking about earlier. Let?s say we evaluate an R expression. Is there a way to just print, verbatim, what R
2012 May 30
5
problem with ifelse
Dear all, ?The code below is used to generate interval censored data but unfortunately there is an error with the ifelse which i am not able to rectify. ?Can somebody help correct it for me. Thank you t<-rexp(20,0.2)? v<-c(0,m,999)? y<-function(t,v){ ? z<-numeric(length(t (( ? ? s<-numeric(length(t (( ? ? ? for(i in 1:length(t)){ ? ? ? ? for(j in 1:length(v-1))? ? ? ? ? { ifelse
2007 Oct 18
1
programming question
hie i'm tryimg to generate two survival data using the following code (I know its ugly ) but it seems to repeat two of the variables can any one tell me whats the porblem. n=20 n1=n/2 n2=n/4 a11=1 ;a12=1.4 ;a21=16 ;a22=a12 * a21 t1<-array(1,c(n1)) t2<-array(2,c(n1)) treatgrp=matrix(c(t1,t2))
2007 Oct 29
3
using survfit
hie when i use plot.survfit to plot more than one graph why I only see the last graph how do i see the other graphs.for example n=20 n1=n/2 n2=n/4 a11=4;a12=4 ;a21=4 ;a22=4 t1<-array(1,c(n1)) t2<-array(2,c(n1)) treatgrp=matrix(c(t1,t2))
2012 Nov 10
3
sample mean, variance and SD
hi could you help me to solve this issue Question: Using command rweibull(100,8,15), simulate n = 100 realizations from Weibull(8; 15) distribution. Using the simulated sample, compute the sample mean, variance and standard deviation of these observations. I am trying like this sim<-rweibull(100,8,15) # simulated sample SM<-mean(sim) # simulated sample mean var(sim) # variance
2006 Feb 03
2
Problems with ks.test
Hi everybody, while performing ks.test for a standard exponential distribution on samples of dimension 2500, generated everytime as new, i had this strange behaviour: >data<-rexp(2500,0.4) >ks.test(data,"pexp",0.4) One-sample Kolmogorov-Smirnov test data: data D = 0.0147, p-value = 0.6549 alternative hypothesis: two.sided >data<-rexp(2500,0.4)
2017 Oct 27
2
How to do a "Box's M" Test with
Trying to get past a frustrating error to do a "simple" Box's M test using Java. The Box's M test says it will work with a data.frame. Here's the setup code: REXP myDf = REXP.createDataFrame(new RList( new REXP[] { new REXPDouble(d1), new REXPDouble(d2), new REXPDouble(d3), new REXPDouble(d4), new REXPInteger(d5) })); Here's the call: REXP boxMResult =
2011 Apr 27
3
MASS fitdistr with plyr or data.table?
I am trying to extract the shape and scale parameters of a wind speed distribution for different sites. I can do this in a clunky way, but I was hoping to find a way using data.table or plyr. However, when I try I am met with the following: set.seed(144) weib.dist<-rweibull(10000,shape=3,scale=8) weib.test<-data.table(cbind(1:10,weib.dist))
2009 Sep 20
1
Return a list from a .Call but segfaults
Hello, I call a function via .Call passing to it a raw vector(D) and an integer(I) The vector is a series K1,KData1, V1,VData1, K2, KData2, ... where the integer K1 is the length of Data1 and similarly for Ki (wrt Datai)(similarly for V*) There 2*I such pairs( (Ki,KDatai), (Vi,VDatai)) The numbers Ki(and Vi) are written in network order. I am returning a list of I elements each element a
2012 Apr 11
1
R-help; generating censored data
Hello, ?can i implement this as 10% censored data where t gives me failure and x censored. Thank you p=2;b=120 n=50 set.seed(132); r<-sample(1:50,45) t<-rweibull(r,shape=p,scale=b) t set.seed(123);? cens <- sample(1:50, 5)? x<-runif(cens,shape=p,scale=b)? x Chris Guure Researcher, Institute for Mathematical Research UPM
2012 Mar 06
1
Scale parameter in Weibull distribution
Hi all, I'm trying to generate a Weibull distribution including four covariates in the model. Here is the code I used: T = rweibull(200, shape=1.3, scale=0.004*exp(-(-2.5*b1+2.5*b2+0.9*x1-1.3*x2)/1.3)) C = rweibull(n, shape=1.5, scale=0.008) #censoring time time = pmin(T,C) #observed time is min of censored and true event = time==T # set to 1 if event is observed
2008 Feb 29
1
patch for random.c
Dear all, while looking for some inspiration of how to organise some code, I studied the code of random.c and noticed that for distributions with 2 or 3 parameters the user is not warned if NAs are created while such a warning is issued for distributions with 1 parameter. E.g: R version 2.7.0 Under development (unstable) (2008-02-29 r44639) [...] > rexp(2, rate=Inf) [1] NaN NaN Warning
2011 Aug 17
3
How to apply a function to subsets of a data frame *and* obtain a data frame again?
Dear all, First, let's create some data to play around: set.seed(1) (df <- data.frame(Group=rep(c("Group1","Group2","Group3"), each=10), Value=c(rexp(10, 1), rexp(10, 4), rexp(10, 10)))[sample(1:30,30),]) ## Now we need the empirical distribution function: edf <- function(x) ecdf(x)(x) # empirical distribution function evaluated at x ##
2015 Apr 09
2
[LLVMdev] BNF for IL/IR interpreter
This might be a very beginner question, but I'm looking for an example for something that I have never done. Suppose that I wanted to express actions with respect to lifted semantics of CPU instructions to an intermediate representation, BAP IL or LLVM IR. How might I go about providing a Backus Naur Form specification and then dynamically interpreting those lifted instructions by also