If this is homework, then r-help has a no homework policy. I'm assuming that if
it is homework then the focus is on statistical concepts, not on R programming.
It looks like your gen_p_vals function should be defined as
gen_p_vals <- function(reps = n)
instead of n = reps.
Why not just use
I built my function to simulate two gamma distributions X and Y based on the
sum of i.i.d exponential distributions. Assume my code is correct about this
simulation, I am interested in finding an equal sample size n for X and Y
such that n can be determined given 90% power and 5% significance level
Pick the mean (mu) and variance (sig2) you want. Then, shape = mu^2/sig2 and
scale = sig2/mu. This should work fine if your mean is large enough so that
p(x = 0 or 1) is small.
--
View this message in context:
http://r.789695.n4.nabble.com/Gamma-count-tp4711845p4711853.html
Sent from the R help
I intend to simulate data from gamma distribution. I plan rounding the
observations into counts. What I want to know is how I will manipulate the
parameters of gamma to have both over and under dispersed count scenarios.
[[alternative HTML version deleted]]
_
Dear Sir,
Thanks a lot for your help and guidance.
Regards
Amelia
--`--
On Wed, 11/3/15, Ben Bolker wrote:
Subject: Re: [R] Gamma Distribution - is there any problem with "pgamma"?
To: r-h...@stat.math.ethz.ch
Date: Wednesday, 11 March, 2
Dear Mr Byng,
Thanks a lot for your great help. Appreciate.
Regards
Amelia
On Wed, 11/3/15, Martyn Byng wrote:
Subject: RE: [R] Gamma Distribution - is there any problem with "pgamma"?
e...@r-project.org>
Date: Wednesday, 11 March
Amelia Marsh yahoo.com> writes:
>
> Dear R forum
>
> I have following data
>
> amounts = c(928906.144,156091.0576,433798.3404,993425.7224,
> 1323976.364,649106.9339, 369967.2612,2528872.35,1226093.655,
> 1145446.149,1809624.453,599329.0394,2200955.213,2583318.064,
> 745625.8069,961828.8828,174
Sent: 11 March 2015 09:42
To: r-help@r-project.org
Subject: [R] Gamma Distribution - is there any problem with "pgamma"?
Dear R forum
I have following data
amounts =
c(928906.144,156091.0576,433798.3404,993425.7224,1323976.364,6
Dear R forum
I have following data
amounts =
c(928906.144,156091.0576,433798.3404,993425.7224,1323976.364,649106.9339,
369967.2612,2528872.35,1226093.655,1145446.149,1809624.453,599329.0394,2200955.213,2583318.064,745625.8069,961828.8828,1744841.313,1939390.005,1077873.654,729924.2713,803584.26
Hi Riu,
Very helpful. Thanks a million!
Andrew
-Original Message-
From: Rui Barradas [mailto:ruipbarra...@sapo.pt]
Sent: 20 May 2013 23:49
To: Lorentz, Andrew
Cc: r-help@r-project.org
Subject: Re: [R] Gamma curve fit to data with specific bins
Hello,
You are fitting a vector other
Hello,
You are fitting a vector other than the vector 'x'.
And you are mistaking the parameter scale for rate.
est <- fitdistr(x,"gamma")$estimate
#plot the gamma curve with the found parameters
hist(x, breaks=Size, freq=FALSE, xlab="Drop Size", ylab="No. of Drops")
curve(dgamma(x, rate=est["r
Good afternoon,
I have some rainfall drop size data (frequency count within drop size) that is
already arranged into specific bins (Size). I am looking to fit a gamma curve
onto a histogram of the data.
At the moment I have been able to create estimate the gamma parameters from the
PDF of the
Sören Prehn iamo.de> writes:
> Dear all, I have a problem with gamma regression (glm - family =
> Gamma) and zeros in R. The problem is the following when I try to
> estimate a dataset without zeros (endogenous variable) there is no
> problem. However, if I try to do the same with zeros I always
Dear all,
I have a problem with gamma regression (glm - family = Gamma) and zeros in R.
The problem is the following when I try to estimate a dataset without zeros
(endogenous variable) there is no problem. However, if I try to do the same
with zeros I always get an error message. In STATA and M
I don't think it is provided and gamma is neither a special case of ghyp
nor ged.
Is there a reason for you to use the gamma distribution? The gamma
distribution only has support for positive number and thus impossible
for stock return.
Cheers,
M
On 26/07/12 09:52, saraberta wrote:
Hi guys
Hi guys,
does anyone know if there is the possibility to fit a gamma distribution
using ugarch?honestly i don't know if maybe is possible to fix some
parameters that reduce ghyp or ged in a gamma distribution..
thanks a lot
sara
--
View this message in context:
http://r.789695.n4.nabble.com/ga
As a short disclaimer - I have read the previous posts on Fitting the Gamma
Distribution, but have two questions going beyond that:
1. Does anybody have a reference for the theory of fitting a gamma
distribution (i.e. whether to apply Kolmogorov-Smirnov, or similar)
2. Has anybody toyed around with
On 08/08/11 13:20, Peter Ehlers wrote:
On 2011-08-07 16:57, Rolf Turner wrote:
Neither Ted Harding's post, nor Prof. Ripley's, really appear to
address the OP's follow-up question which was
*why* did he get the ``weird error'' (non-finite finite difference, NaNs
produced) when he applied fitd
On 2011-08-07 16:57, Rolf Turner wrote:
Neither Ted Harding's post, nor Prof. Ripley's, really appear to
address the OP's follow-up question which was
*why* did he get the ``weird error'' (non-finite finite difference, NaNs
produced) when he applied fitdistr(),
as he was advised to do by Jorge
Neither Ted Harding's post, nor Prof. Ripley's, really appear to
address the OP's follow-up question which was
*why* did he get the ``weird error'' (non-finite finite difference, NaNs
produced) when he applied fitdistr(),
as he was advised to do by Jorge Ivan Velez. The ``weird error'' did
On 2011-08-06 15:14, Alexander Engelhardt wrote:
Hey,
I have a set of income data which I'd like to fit to a gamma
distribution. How can I estimate the two parameters of the gamma
distribution for a vector, e.g.
c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L,
3363L, 3567L, 4798L
Well, 'Alexander Engelhardt' failed to follow the posting guide, and
so did not get a reply from some knowledgeable people.
(1) When using fitdistr you need to roughly scale your data: e.g.
divide by 1000 here.
(2) fitdistr does 'go down the maximum likeilhood route' and it does
find reasona
On 06-Aug-11 19:37:49, Alexander Engelhardt wrote:
> On 08/06/2011 09:23 PM, Jorge Ivan Velez wrote:
>> Hi Alex,
>>
>> Try
>>
>>> require(MASS)
>> Loading required package: MASS
>>> b<- c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L,
>> + 3363L, 3567L, 4798L, 2032L, 1699L, 3001L, 2
On 08/06/2011 09:23 PM, Jorge Ivan Velez wrote:
Hi Alex,
Try
require(MASS)
Loading required package: MASS
b<- c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L,
+ 3363L, 3567L, 4798L, 2032L, 1699L, 3001L, 2329L, 3944L, 2568L,
+ 1699L, 4545L)
fitdistr(b, 'gamma')
shape
Hi Alex,
Try
> require(MASS)
Loading required package: MASS
> b <- c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L,
+ 3363L, 3567L, 4798L, 2032L, 1699L, 3001L, 2329L, 3944L, 2568L,
+ 1699L, 4545L)
> fitdistr(b, 'gamma')
shape rate
6.4528939045 0.0021887943
(0.
Hey,
I have a set of income data which I'd like to fit to a gamma
distribution. How can I estimate the two parameters of the gamma
distribution for a vector, e.g.
c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L,
3363L, 3567L, 4798L, 2032L, 1699L, 3001L, 2329L, 3944L, 2568L,
169
I've been trying with no success to model mixtures of Gamma distributions using
the package flexmix (see examples below). Can anyone help me get it to model
better? Thanks very much.
-Ben
##
## Please help me get flexmix to correctly model mixtures of
## Gamma distributions. See examples below.
Thank you Michael!
--
View this message in context:
http://r.789695.n4.nabble.com/Gamma-Lognormal-Model-tp3165408p3166318.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/l
At 20:08 27/12/2010, Louisa wrote:
Dear,
I'm very new to R Gui and I have to make an assignment on Gamma Regressions.
Surfing on the web doesn't help me very much so i hope this forum may be a
step forward.
Well since you are so honest about it being homework try Googling for
lognormal gamma
On 10-12-27 3:08 PM, Louisa wrote:
Dear,
I'm very new to R Gui and I have to make an assignment on Gamma Regressions.
Surfing on the web doesn't help me very much so i hope this forum may be a
step forward.
This forum isn't for homework. You should ask your instructor for help.
Duncan Murdo
Dear,
I'm very new to R Gui and I have to make an assignment on Gamma Regressions.
Surfing on the web doesn't help me very much so i hope this forum may be a
step forward.
The question sounds as follows:
The data set is in the library MASS
first install library(MASS)
then type data(mammals)
Dear R-users,
i try to use the following code to do a gamma regression
glm(x1 / x2 ~ x3 + x4 + x5 + x6 + x7 + x8, family=Gamma(link="log"),
weights=x2)
but here i get the error
Error: NA/NaN/Inf in foreign function call (arg 1)
In addition: Warning message:
step size truncated due to diverge
Hello R-Team,
I am trying to construct a Copula from a multivariate Gamma distribution with
its marginals gamma-distributed.
The multivariate Gamma should be able to contain a correlation coeficient or
matrix.
I have studied the book "Continuous Multivariate Distributions vol.I Models and
app
On Sun, May 30, 2010 at 12:16 PM, Sherrie Jin wrote:
> When I ran a Gamma regression in SAS, the algorithm converged. When I ran it
> in R, it keeps uncoverged even if I used 1 iterations. What was wrong?
> I used the following code in R:
> glm(y ~ x1 x2 x3, control=glm.control(maxit=1), d
When I ran a Gamma regression in SAS, the algorithm converged. When I ran it
in R, it keeps uncoverged even if I used 1 iterations. What was wrong?
I used the following code in R:
glm(y ~ x1 x2 x3, control=glm.control(maxit=1), data,
family=Gamma(link="log"))
[[alternative HTML ver
Thank you very much Jay.
2010/3/19 G. Jay Kerns
> Dear Randall,
>
> On Fri, Mar 19, 2010 at 10:24 AM, Randall Wrong
> wrote:
> > Dear R users,
> >
> > ?rgamma gives me :
> >
> > rgamma(n, shape, rate = 1, scale = 1/rate)
> >
> > rate: an alternative way to specify th
Dear Randall,
On Fri, Mar 19, 2010 at 10:24 AM, Randall Wrong wrote:
> Dear R users,
>
> ?rgamma gives me :
>
> rgamma(n, shape, rate = 1, scale = 1/rate)
>
> rate: an alternative way to specify the scale.
>
> The Gamma distribution with parameters ‘shape
Dear R users,
?rgamma gives me :
rgamma(n, shape, rate = 1, scale = 1/rate)
rate: an alternative way to specify the scale.
The Gamma distribution with parameters shape = a and
scale = s has density
f(x)= 1/(s^a Gamma
Dear all,
does anybody know if it is possible, and how, to compute the Gamma correlation
in R?
Thank you very much in advance!
Manuel
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http
What exactly is the R code you wrote for your function f? Without
that, it will be hard to help you.
-s
On Sat, May 16, 2009 at 2:48 AM, Kon Knafelman wrote:
>
> Hi Guy,
>
> I am having trouble graphing the following function
>
> √2Γ(n/2)/[√n - 1Γ((n - 1)/2 for the values of n betw
Kon Knafelman [Sat, May 16, 2009 at 08:49:44AM CEST]:
>
> Hey,
>
> I am having trouble graphing the following function
>
> ???2??(n/2)/[???n ??? 1??((n ??? 1)/2 for the values of n between 2 and 50.
>
> i know that ??(n) = (n-1)!, which in R is factorial(n-1)
>
> When i type that into R, usin
Hi Guy,
I am having trouble graphing the following function
â2Î(n/2)/[ân â 1Î((n â 1)/2 for the values of n between 2 and 50.
i know that Î(n) = (n-1)!, which in R is factorial(n-1)
When i type that into R, using y <- function(n).
and then plot(y,2,50), it doesnt give me anythin
Hey,
I am having trouble graphing the following function
â2Î(n/2)/[ân â 1Î((n â 1)/2 for the values of n between 2 and 50.
i know that Î(n) = (n-1)!, which in R is factorial(n-1)
When i type that into R, using y <- function(n).
and
then plot(y,2,50), it doesnt give me anything m
Hey,
I want to estimate to regressions. First I want to estimate simple OLS.
Since my dependent variable looks like a gamma distribution I want to
estimate a gamme regression with the "zelig" package.
But, I have some problems with the interpretation of the estimated
coefficient.
In the OLS the
Hi R-users,
I'm fitting gamma parameters (shape and rate ) by two methods (by direct
and and fitdistr of MASS library). I have realized the following code
which gives me two results. However, I find that those two outcomes are
significantly different. Is there any explanation to this case? Many
45 matches
Mail list logo