Displaying 20 results from an estimated 283 matches for "rexps".
Did you mean:
reps
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)
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
1999 Aug 30
1
rexp and rweibull
In splus rexp() and rweibull() are related:
> set.seed(153)
> rexp(1)
[1] 0.0493267
> set.seed(153)
> rweibull(1, shape=1)
[1] 0.0493267
(you can also try shape =2, then rweibull = sqrt(rexp) )
However, in rw0.64.1 (on Win NT) they are different
> .Random.seed <- 1:4
> rexp(1)
[1] 1.412030
> .Random.seed <- 1:4
> rweibull(1, shape=1)
[1] 2.054032
May be 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
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
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
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 =
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
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
##
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
2009 Mar 19
4
Import R-output into Java
Hello,
I want to import R-output via Rserve to Java, especially for the function
ctree from the package party.
Rserve is working properly.
Yet, I only get the predictions with the Java code
try{
RConnection c = new RConnection();
...
c.voidEval("modell <- ctree(...)");
REXP y = c.eval("nodes(modell,1)[[1]]$prediction");
...
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
2012 Jun 30
2
incorrect number of subscripts on matrix
Hi,
Wondering if anyone could help me out with this error.Im trying to fill a matrix with random numbers taken from an exponential distribution using a loop:
x.3<-matrix(rep(0,3000),nrow=1000,byrow=T)for(i in 1:1000){x[i,]<-rexp(3,rate=2/3)}
I get the error message:
Error in x[i, ] <- rexp(3, rate = 2/3) : incorrect number of subscripts on matrix
Any ideas??? Appreciate any thoughts.
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
2007 May 17
2
controling the size of vectors in a matrix
hie R users
l have the following matrix
n=20
m<-matrix(nrow=n,ncol=4)
colnames(m)=c("treatmentgrp","strata","survivalTime")
for(i in 1:n) m[i,]<-c(sample(c(1,2),1,replace=TRUE),sample(c(1:2),1,replace=TRUE),rexp(1,0.07),rexp(1,0.02))
2011 Jun 14
1
About 'hazard ratio', urgent~~~
Hi,
I am new to R.
My question is: how to get the 'hazard ratio' using the 'coxph' function in
'survival' package?
thanks,
karena
--
View this message in context: http://r.789695.n4.nabble.com/About-hazard-ratio-urgent-tp3595527p3595527.html
Sent from the R help mailing list archive at Nabble.com.
2017 Oct 27
4
Cannot Compute Box's M (Three Days Trying...)
...= ((REXPVector) ((RList) tableRead).get(3)).asDoubles();
String[] d5 = ((REXPVector) ((RList) tableRead).get(4)).asStrings();
// create data frame with data.REXP myDf = REXP.createDataFrame(new RList(
new REXP[]
{
new REXPDouble(d1),
new REXPDouble(d2),
new REXPDouble(d3),
new REXPDouble(d4),
new REXPString(d5)
}));
// assign the data to a variable as was suggested.rConnection.assign("boxMVariable", myDf);
// create a string command with that variable name.String boxVariable = "boxM(boxMVariable [,-5], boxMVariable[,5]";
// try to execute the command...
// FAILS with org.ro...
2007 Apr 26
3
adding a column to a matrix
i would like to add a variable to an existing matrix by manipulating 2 previous variables eg for the data
m
treat strata censti survTime
[1,] 1 2 284.684074 690.4961005
[2,] 1 1 172.764515 32.3990335
[3,] 1 1 2393.195400 24.6145279
[4,] 2 1 30.364771 8.0272267
[5,] 1 1 523.182282 554.7659501
l
2007 Apr 25
2
creating random numbers
l want to create a column of 1 and 2 randomly what command should l use
eg
treatment strata
1 1
2 0
1 1
2 1
2 0
2 1
2 0
1 0
these should be created randomly
secondly if l have