similar to: Exponential distribution

Displaying 20 results from an estimated 400 matches similar to: "Exponential distribution"

2010 Sep 29
1
sample exponential r.v. by MCMC
Dear R users, I am leaning MCMC sampling, and have a problem while trying to sample exponential r.v.'s via the following code: samp <- MCMCmetrop1R(dexp, theta.init=1, rate=2, mcmc=5000, burnin=500, thin=10, verbose=500, logfun=FALSE) I tried other distribtions such as Normal, Gamma with shape>1, it works perfectly fine. Can someon
2007 Mar 11
1
fitting a mixed exponential distribution
Hi all, I am attempting to fit, and test the goodness of fit of, a mixed exponential distribution to my dataset which consists of 15minute rainfall intensity data. FYI, the dataset spanning approx.2 years and 7 rainfall stations consists of some three hundred thousand 15min data records, of which some 30 thousand are non-zero rainfall amounts. Could anyone please tell me how i could do
2011 Aug 19
2
R and Sweave
Hi everybody. I'm trying to use R with Sweave but I have a problem perhaps with the directory path of sweave in R. The windows path is this: C:\Program Files (x86)\R\R-2.9.2\share\texmf\Sweave When I run the latex file with R, the program works well, without any errors, but when I create the pdf file, the Scode doesn't work. I think the problem is about the path. Can anybody suggest to
2011 Aug 21
3
Sweave doesn't work
Hi R users. I've got a problem in producing the pdf file from Latex with R code. When I run the code Sweave("example.Rtex") in R it seems working, but when I run the Latex file it doesn't. The code error shown to me is below: *Runaway argument? {echo=FALSE} data<- read.csv("C:\\Users\\Daniele\\Desktop\\dati\\dati_england ! File ended while scanning use of \FV at
2004 May 13
5
code for functions in base package
Is there any way that I can see the step by step code for functions in the base package? For instance the dexp function. I am a student working on writing my own function for something that is similar to this dexp function and I would like to see the step by step code. Brittany Laine GTA WVU Statistics Department 331 Hodges
2011 Mar 22
1
Problem with plot histogram
Hi R-users, I'm trying to built a plot of two series of data, but thees series result "superimposed". The R-code is like this: goal <- c(125, 143, 81, 26, 2, 3) numgoal <- 0:5 lambda <- sum(goal*numgoal)/sum(goal) plot(numgoal, goal, type="h") x <- 0:5 y<-dpois(x, lambda) att<-y*380 lines(x,att, type="h", col="red")
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
2008 Mar 21
1
(no subject)
Hi, I am fairly new to R, and am stuck. I want to write an R function with argument n that returns a vector of length n with n simulated observations from the double exponential distribution with density: ??g(y) = 1/2e^-y ? For the double exponential, I want to generate y~Exp(1) and then take ?y with probability 0.5 ? Does anyone know how I can do this in R? Thanks! Fran [[alternative
2011 Sep 06
2
Generalizing call to function
Hello guys, I would like to ask for help to understand what is going on in "func2". My plan is to generalize "func1", so that are expected same results in "func2" as in "func1". Executing "func1" returns... 0.25 with absolute error < 8.4e-05 But for "func2" I get... Error in dpois(1, 0.1, 23.3065168689948, 0.000429064542600244,
2003 Oct 04
3
a bug of function plot (PR#4405)
Full_Name: Ximing Zhao Version: R 1.7.1 OS: MacOs X Submission from: (NULL) (64.136.27.51) When I used function plot in R 1.7.1, I found two bugs. My whole function is this: ***************** drawexp<-function(X,x,c,b){ exp<-function28(X,x,c,b) if(max(exp)>=max(dexp(x,rate=1))){ plot(x,exp, type="l",main= paste("Exponential ,n=",length(X),"
2006 Jun 02
2
Problem with mle
R 2.3.0 Linux, SuSE 10.0 Hi I have two problems with mle - probably I am using it the wrong way so please let me know. I want to fit different distributions to an observed count of seeds and in the next step use AIC or BIC to identify the best distribution. But when I run the script below (which is part of my original script), I get one error message for the first call of mle: Error in
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
2008 Oct 16
1
Suppressing error messages in a for loop
Hi, Is there any way that I can supress error messages so that they don't stop for loops running? I'm using the gstat package and have created a variogram model for the double exponential model: "dexp <- vgm( .5, "Exp", 10,.1, add.to = vgm(.5, "Exp", 100))" and fitted it using "dexp.fit <- fit.variogram(temp2, dexp, fit.method=6,
2011 Aug 29
1
maximum number of subdivisions reached
Why I am getting Error in integrate(f, x1, x1 + dx) : maximum number of subdivisions reached and can I avoid this? func <- function(y, a, rate, sad){ f3 <- function(z){ f1 <- function(y,a,n){ dpois(y,a*n) } f2 <- function(n,rate){ dexp(n,rate) } f <- function(n){ f1(y,a,n)*f2(n,rate) } r <- 0 r1 <- 1 x1 <- 0 dx <- 20 while(r1 >
2005 Sep 06
2
fitting distributions with R
Dear all I've got the dataset data:2743;4678;21427;6194;10286;1505;12811;2161;6853;2625;14542;694;11491; ?? ?? ?? ?? ?? 14924;28640;17097;2136;5308;3477;91301;11488;3860;64114;14334 I know from other testing that it should be possible to fit the data with the exponentialdistribution. I tried to get parameterestimates for the exponentialdistribution with R, but as the values of the parameter
2009 Mar 04
1
how to estimate distribution?
Dear R-Experts, I have an empirical dataset with 150 subjects for 24 observations. In each observation, each subject can have a score in the range 0:3. I made then a simple index making the sum of the values in each row, so each subject have a score between 0 and 72. I was thinking about what kind of theoretical distribution such an index should have, so I try to make things random like:
2011 Nov 14
2
how to include integrate in a function that can be solved with uniroot?
Hallo, I am trying to define expectation as an integral and use uniroot to find the distribution parameter for a given expectation. However I fail to understand how to define properly the functions involved and pass the parameters correctly. Can anyone help me out? Thanks, Gerrit Draisma. This what I tried: ======= > # exponential density > g <- function(x,lambda){ lambda
2008 Aug 21
1
pnmath compilation failure; dylib issue?
(1) ...need to speed up a monte-carlo sampling...any suggestions about how I can get R to use all 8 cores of a mac pro would be most useful and very appreciated... (2) spent the last few hours trying to get pnmath to compile under os- x 10.5.4... using gcc version 4.2.1 (Apple Inc. build 5553) as downloaded from CRAN, xcode 3.0... ...xcode 3.1 installed over top of above after
2011 Feb 18
4
Matrix in R
Hi everyone, I'm building a matrix in R with a cycle for like this: pp_ris2=matrix(NA,6,6) for(i in 0:6){ for(j in 0:6){ if(i>j){ pp_ris2[i,j]=myfunction} else if(i==j){ print(c(i,j)) pp_ris2[i,j]=myfunction} }} but the result is: [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.062 NaN NaN NaN NaN NaN [2,] 0.083 0.022 NaN NaN NaN NaN [3,]
2011 Oct 12
1
CVbinary - Help
Hey, I need some help. I want to obtain a cross validation for a regression model (binary response) but I got an error with CVbinary. Well I did this: fit <- lm(resp ~ PC1 + PC2 + PC3 + PC4 + PC5 + PC6 + PC7 + PC8 + PC9+PC10+PC11+PC12+PC13+PC14+PC15+PC16+PC17+PC18+PC19+PC20+PC21+PC22+PC23+PC24+PC25+PC26+PC27+PC28, data = dexp.cp, family=binomial()) CVbinary(fit) Error in sample(nfolds, m,