similar to: Zipf random number generation

Displaying 20 results from an estimated 100 matches similar to: "Zipf random number generation"

2008 Dec 27
1
Zipf fitting using R
Dear R-users, I am new to R and would like to use it for fitting the zipf distribution to some numeric data that I have. Here's the snippet that I use: library(VGAM) X <- read.table(file("~\\mydata.txt", encoding="latin1")) w <- as.vector(t((X[2]))) w <- w/sum(w) y <- (1:length(w)) fit = vglm (y ~ 1, zipf, tra=TRUE, weight=w) zipf(N=NULL,
2010 Oct 11
1
plotting Zipf and Zipf-Mandelbrot curves in R
Using R, I plotted a log-log plot of the frequencies in the Brown Corpus using plot(sort(file.tfl$f, decreasing=TRUE), xlab="rank", ylab="frequency", log="x,y") However, I would also like to add lines showing the curves for a Zipfian distribution and for Zipf-Mandelbrot. I have seen these in many articles that used R in creating graphs. Thank you! [[alternative HTML
2005 Jan 25
4
agglomerative coefficient in agnes (cluster)
I haven't read the book, but could anyone explain more about this parameter? help(agnes) says that ac measures the amount of clustering structure found. From the definition given in help(agnes.object), however, it seems that as long as the dissimilarity of the merger in the final step of the algorithm is large enough, the ac value will be close to 1. So what does ac really mean? Thank
2007 Feb 08
1
Zeta and Zipf distribution
Dear R user, I want to estimate the parameter of ZETA or/and ZIPF distributions using R, given a series of integer values. Do you know a package (similar to MASS) or a function (similar to fitdistr) I can use to estimate the parameter of these distributions using MLE method? Otherwise do you know a function (which use MLE method to estimate distribution parameters) that allow me to specify a
2005 Mar 08
2
The null hypothesis in kpss test (kpss.test())
is that 'x' is level or trend stationary. I did this > s<-rnorm(1000) > kpss.test(s) KPSS Test for Level Stationarity data: s KPSS Level = 0.0429, Truncation lag parameter = 7, p-value = 0.1 Warning message: p-value greater than printed p-value in: kpss.test(s) My question is whether p=0.1 is a good number to reject N0? On the other hand, I have a
2005 Mar 09
1
about kpss.test()
Hi All, First of all, could you tell me what the "KPSS Level" in the output of the test means? I have a series, x, of periodic data and tried kpss.test() on it to verify its stationarity. The tests gave me the p-value above 0.1. Since the null hypothesis N0 is that the series _is_ stationary, this means that I cannot reject N0. But the series does look periodic! So does all this
2006 Feb 18
1
truncated negative binomial using rnegbin
Dear R users, I'm wanting to sample from the negative binomial distribution using the rnegbin function from the MASS library to create artificial samples for the purpose of doing some power calculations. However, I would like to work with samples that come from a negative binomial distribution that includes only values greater than or equal to 1 (a truncated negative binomial), and I
2011 May 04
1
hurdle, simulated power
Hi all-- We are planning an intervention study for adolescent alcohol use, and I am planning to use simulations based on a hurdle model (using the hurdle() function in package pscl) for sample size estimation. The simulation code and power code are below -- note that at the moment the "power" code is just returning the coefficients, as something isn't working quite right. The
2004 Feb 10
1
generate random sample from ZINB
I want to generate 1,000 random samples of sample size=1,000 from ZINB. I know there is a rnegbin() to generate random samples from NB, and I know I can use the following process: do i=1 to 1000 n=0 do i=1 to 1000 if runi(1)>0.1 then x(i) = 0; else x(i)=rnegbin(); n=n+1; if n>1000 then stop; end; output; end; Anybody can help me out with the R code? Thanks very much ahead of time.
2012 Mar 31
2
A introductory question about Zips law (Newbie to statistics)
Hi everyone. Newbie to statistics. I have 40 matrices of ~400 values. how may I determine whether the distribution follows zips law? response <-sample (1:20,400*4, replace= TRUE) Thank you vry much. -- View this message in context: http://r.789695.n4.nabble.com/A-introductory-question-about-Zips-law-Newbie-to-statistics-tp4521190p4521190.html Sent from the R help mailing list archive at
2006 Jul 14
2
Negative Binomial: Simulation
Hi R-Users! I fitted a negative binomial distribution to my count data using the function glm.nb() and obtained the calculated parameters theta (dispersion) and mu. I would like to simulate values from this negative binomial distribution. Looking at the function rnbinom() I was looking at the relationship between the two possible parametrizations of the negative binomial and found that for this
2011 Nov 17
1
How to Fit Inflated Negative Binomial
Dear All, I am trying to fit some data both as a negative binomial and a zero inflated binomial. For the first case, I have no particular problems, see the small snippet below library(MASS) #a basic R library set.seed(123) #to have reproducible results x4 <- rnegbin(500, mu = 5, theta = 4) #Now fit and check that we get the right parameters fd <- fitdistr(x4, "Negative
2005 Mar 03
1
Negative binomial regression for count data
Dear list, I would like to fit a negative binomial regression model as described in "Byers AL, Allore H, Gill TM, Peduzzi PN., Application of negative binomial modeling for discrete outcomes: a case study in aging research. J Clin Epidemiol. 2003 Jun;56(6):559-64" to my data in which the response is count data. There are also 10 predictors that are count data, and I have also 3
2008 Aug 05
4
Buggy bios, boot of dos image hangs with syslinux, but not with isolinux
Hi We have a couple of FSC Computers here which seem to have a very strange bios. I am trying to boot a MS-DOS disk to flash an Scsi Raid controller. Since the computer doesn't have a floppy anymore I tried syslinux from an usb stick. The menu loads fine but I cannot boot disc images with memdisk on this computer. It works fine on others, of course. But now comes the weird part, if I use the
2005 Apr 04
1
help with kolmogorov smirnov test
What does 'with ties in' mean? with some identical elements (par ex., au moins une paire ex-equo) HTH ____________________ Ken Knoblauch Inserm U371, Cerveau et Vision Department of Cognitive Neurosciences 18 avenue du Doyen Lepine 69675 Bron cedex France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: 06 84 10 64 10 http://www.lyon.inserm.fr/371/
2012 Oct 19
2
MLE of negative binomial distribution parameters
I need to estimate the parameters for negative binomial distribution (pdf) using maximun likelihood, I also need to estimate the parameter for the Poisson by ML, which can be done by hand, but later I need to conduct a likelihood ratio test between these two distributions and I don't know how to start! I'm not an expert programmer in R. Please help -- View this message in context:
2007 Oct 17
2
power law fit with unknown zero
Dear R-helpers I would like to do a fit of the form: y = a (x+c)**b, where a, b and c are unknown. Does anybody know how to do it? Thanks Thomas
2011 Feb 04
2
vegan and sweave using xtable
Dear all, Using: library(vegan) data(BCI) mod <- radfit(BCI[1,]) mod RAD models, family poisson No. of species 93, total abundance 448 par1 par2 par3 Deviance AIC BIC Null 39.5261 315.4362 315.4362 Preemption 0.042797 21.8939 299.8041 302.3367 Lognormal 1.0687 1.0186 25.1528 305.0629 310.1281
2006 Oct 27
0
VGAM package released on CRAN
Dear useRs, upon request, the VGAM package (currently version 0.7-1) has been officially released on CRAN (the package has been at my website http://www.stat.auckland.ac.nz/~yee/VGAM for a number of years now). VGAM implements a general framework for several classes of regression models using iteratively reweighted least squares (IRLS). The key ideas are Fisher scoring, generalized linear and
2012 Apr 23
2
zipfR help
Hi, I have a question on generating random variables based on zipf-mandelbrot distribution. So when I execute the following lines: ZM = lnre ("zm", alpha = 2/3, B=0.1) zmsample = rlnre (ZM, n =100) zmsample It generates 100 random values based on a zipf-mandelbrot distribution as below. But how do I make sure the generated random number is within the range of 1 - 6000 only? Can I