Displaying 20 results from an estimated 7000 matches similar to: "specify seed for Random Number Generator"
2005 Aug 17
2
plotting issue with timestamps
I have a dataset with transactions and a timestamp at which they occoured
during a day. The time stamp is in the format YYYY/MM/DD hh:mm:ss. I would
like to plot a timeseries of the transactions to see if there is a
particular time in the day when there is a spike in transactions. Ofcourse
the YYYY/MM/DD can be dropped since I am monitoring activity for the day and
the actual date is
2005 Oct 14
2
subset selection for glm
Hello:
Are there any libraries that will do a subset selection for glm's? I looked
through leaps, but seems like it is specifically for linear regressions.
Thank you.
-Dhiren
2005 Oct 07
2
matrix operation
Hello:
I have a matrix 'dat' with 2 columns.
I have the following code:
for (i in 1:nrows(dat))
{
if (dat[i,1] < dat[i,2])
{
dat[i,2]<-0
}
else
{
dat[i,2]<-1
}
Is there a way to accomplish this without the for loop?
Thank you.
-Dhiren
2005 Aug 05
1
SJava linux installation problems
Hi:
I am extremely new to linux so bare with the questions. I am trying to
install the SJava package for R on linux (debian).
I issue the R CMD INSTALL SJava_0.68-0.tar.gz and get the following error
Cannot find Java.
Please set your path to include the directory in which the java executable
resides,
or set the environment variable JAVA_HOME before this configure script is
run.
I have
2010 Feb 17
2
Trouble with optim function
Hi all,
I'm trying to make a little script to determine an "unknown" rate for a
number of known exponential trials.
My Code:
#Set Trials and generate number
trials=100
rand<-runif(1,0,1)
vector=0
#Generate vector of 100 random exponentials and sum them
for (i in 1:100) {
vector<-rexp(trials,rate=rand)
}
sumvect=sum(vector)
#Create the log likelihood function
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 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
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 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.
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
2003 Jul 22
4
greek in main title
Hello,
I have written a function that demonstrates the CLT by
generating samples following the exponential distribution,
calculating the means, plotting the histogram, and drawing
the limiting normal curve as an overlay. I have the title
of each histogram state the sample size and rate (1/theta)
for the exponential (the output is actually 4 histograms),
but I can't get the greek letter theta
2008 Nov 20
4
Dequantizing
I have some data measured with a coarsely-quantized clock. Let's say
the real data are
q<- sort(rexp(100,.5))
The quantized form is floor(q), so a simple quantile plot of one
against the other can be calculated using:
plot(q,type="l"); points(floor(q),col="red")
which of course shows the characteristic stair-step. I would like to
smooth the quantized
2010 Jun 16
2
Question
Dear Mr.
for writing program about Gibbs sampling, i have a question.
if i want to generate data from Exponential distribution but range of X is restricted, how can i do?
regards,
A.Rashidi
[[alternative HTML version deleted]]
2011 Jun 14
2
How to generate bivariate exponential distribution?
Any one know is there any package or function to generate bivariate
exponential distribution? I gusee there should be three parameters, two rate
parameters and one correlation parameter. I just did not find any function
available on R. Any suggestion is appreciated.
--
View this message in context:
2007 Apr 19
1
Random number generator in R compared
I am trying to generate survival data using R .Im trying to randomly generate a column of 1s and 0 and another column randomly generated using an exponential distribution but l cant seem to get the random function. how do l go about it
thanks in advance
rt chiruka
---------------------------------
[[alternative HTML version deleted]]
2011 Nov 16
2
Error in random walk Metroplis-hasting
Hi R community,
I have some data set and construct the likelihood as follows
likelihood <- function(alpha,beta){
lh<-1
d<-0
p<-0
k<-NULL
data<-read.table("epidemic.txt",header = TRUE)
attach(data, warn.conflicts = F)
k <-which(inftime==1)
d <- (sqrt((x-x[k])^2+(y-y[k])^2))^(-beta)
p<-1 - exp(-alpha*d)
for(i in 1:100){
2005 Jul 29
1
Wild card characters
I have a string '982323.1' and would like to replace everything after the
'.' with a '41'. So the string should look like '982323.41'. The code I
use to do this is
sub('\.$','41',982323.1)
This works fine as long as there is only 1 digit after the decimal. If I
have '982323.10', then the result of the code is '982323.141'
2010 May 11
2
question about R
Hi,
At each iteration in my program,I need to generate tree vectors,X1,X2,X3,
from exponential distribution with parameters a1,a2,a3. Can you help me
please how can I do it such that it take a little time?
thank you
khazaei
2012 Aug 28
1
Optim Problem
Hello,
I want to estimate the exponential parameter by using?optim?with the following input, where t contains 40% of the data and q contains 60% of the data within an interval. In implementing the code command for optim i want it to contain both the t and q data so i can obtain the correct estimate. Is there any suggestion as to how this can be done. I have tried h<-c(t,q) but it is not working