similar to: rexp question

Displaying 20 results from an estimated 9000 matches similar to: "rexp question"

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
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
2005 Aug 16
2
specify seed for Random Number Generator
I need to generate 100 I.I.D samples from an exponential distribution. I use rexp(100,parameter). Is there anyway to specify a seed to determine the first input for the uniform random number generator used to generate these exponentials? -Dhiren
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
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
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){
2004 Oct 27
1
Warning messages in function fitdistr (library:MASS)
Why the warning messages (2:4)? > x <- rexp(1000,0.2) > fitdistr(x,"exponential",list(rate=1)) rate 0.219824219 (0.006951308) Warning messages: 1: one-diml optimization by Nelder-Mead is unreliable: use optimize in: optim(start, mylogfn, x = x, hessian = TRUE, ...) 2: NaNs produced in: dexp(x, 1/rate, log) 3: NaNs produced in: dexp(x, 1/rate, log) 4: NaNs
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) ;
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
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:
2017 Dec 07
1
Seeking help with code
Assuming the days of raining during half a year of all states(provinces) of a country is normally distributed (mean=?, standard deviation=?) with sigma (?) equals to 2. We now have 10 data points here: 26.64, 30.65, 31.27, 33.04, 32.56, 29.10, 28.96, 26.44, 27.76, 32.27. Try to get the 95% level of CI for ?, using parametric Bootstrap method with bootstrap size B=8000. my code - what am i doing
2018 Apr 04
1
parfm unable to fit models when hazard rate is small
Hello, I would like to use the parfm package: https://cran.r-project.org/web/packages/parfm/parfm.pdfhttps://cran.r-project.org/web/packages/parfm/parfm.pdf in my work. This package fits parametric frailty models to survival data. To ensure I was using it properly, I started by running some small simulations to generate some survival data (without any random effects), and analyse the data using
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
2017 May 27
2
Latin Hypercube Sampling when parameters are defined according to specific probability distributions
>May 26, 2017; 11:41am Nelly Reduan Latin Hypercube Sampling when parameters are >defined according to specific probability distributions >Hello, > I would like to perform a sensitivity analysis using a Latin Hypercube Sampling (LHS). >Among the input parameters in the model, I have a parameter dispersal distance which is defined according to an exponential probability
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