Displaying 20 results from an estimated 20000 matches similar to: "[R ] help in if else in connect the simulation in normal and gamma distribution."
2016 Apr 05
5
R-dvel [robustness Simulation study of 2 sample test on several combination of factors ]
hi, i am new in this field.
do
favorite<http://stackoverflow.com/questions/36404707/simulation-study-of-2-sample-test-on-different-combination-of-factors#>
If I wish to conduct a simulation on the robustness of two sample test by using R language, is that any ways in writing the code?
There are several factors
(sample sizes-(10,10),(10,25),(25,25),(25,50),(25,100),50,25),(50,100),
2016 Apr 06
0
R-dvel [robustness Simulation study of 2 sample test on several combination of factors ]
You have quite a few mistakes in your example. The code below works
for me - you can wrap it in a function if you like. I think you will
need a lot more practice before you can write something like this in R
as you are missing close braces and haven't really worked out the
difference between the number of calculations you are doing for each
replication and the number of replications. It takes
2016 Apr 06
0
R-dvel [robustness Simulation study of 2 sample test on several combination of factors ]
Hi, i think i have figured the purpose of using this index (i-1)*5+j in the previous example that you gave.
It is because that i have to consider the outer loop and inner loop also... so the iterative for i need to minus one because it have ran one times simulation already ,then times the number of sizes of inner loop, then plus the iterative of j....
then for the simulation, i think there will
2007 May 18
1
Goodness-of-fit test for gamma distribution?
Hi all,
I am wondering if anyone has written (or knows of) a function that
will conduct a goodness-of-fit test for a gamma distribution. I am
especially interested in test statistics have some asymptotic
parametric distribution that is independent of sample size or values
of fitted parameters (e.g., a chi-squared distribution with some
fixed df), because I want to fit gamma distributions to
2009 Nov 10
1
Generate Random Draw from Gamma Distribution Re: Monte Carlo Simulation in R...
Exactly! Thanks, Duncan.
Let me re-phrase me question like this:
1) X_i values are independent Gammas, with the shape 0.067 and scale 0.008
2) Min(X)=1 and Max(X)=85
3) SUM(X)=2000
4) Do I also have to define the number of draws? if yes, it could be 250.
Based on these restrictions, I want to generate random draw. I'm wondering
how I can do this in R. Thanks.
Garry
On Tue, Nov 10, 2009
2008 Sep 15
2
help on sampling from the truncated normal/gamma distribution on the far end (probability is very low)
Hi, guys,
I am trying to sample from a truncated normal/gamma distribution.
But only the far end of the distribution (where the probability is very low)
is left. e.g.
mu = - 4;
sigma = 0.1;
The distribution is Normal(mu,sigma^2) truncated on [0,+Inf];
How can I get a sample? I tried to use inverse CDF method, but got Inf as
answers. Please help me out.
Also, pls help me on the similar
2016 Apr 16
1
R [loop statement ]
hi, i am new in this field.
I am now writing a code in robustness simulation study. I have written a brief code "for loop" for the factor (samples sizes d,std deviation ) , i wish to test them in gamma distribution with equal and unequal skewness, with the above for loop in a single code if possible. Can i ask is that any suitable loop statement for this situation.
This is my ideas
2016 Apr 05
0
R-dvel [robustness Simulation study of 2 sample test on several combination of factors ]
Okay, here is a more complete example:
sample_sizes<-
matrix(c(10,10,10,25,25,25,25,50,25,100,50,25,50,100,100,25,100,100),
nrow=2)
# see what it looks like
sample_sizes
ssds<-c(4,4.4,5,6,8)
nssds<-length(ssds)
results<-list()
# first loop steps through the sample
for(ss in 1:dim(sample_sizes)[2]) {
# get the two sample sizes
ss1<-sample_sizes[1,ss]
ss2<-sample_sizes[2,ss]
2012 Jul 22
1
Adding gamma and 3-parameter log normal distributions to L-moments ratio diagram lmrd()
How to adapt this piece of code but for: - gamma distribution - 3 parameter
log normal
More specifically, where can I find the specification of the parameter
(lmom) for pelgam() and pelln3()?
Lmom package info just gives: pelgam(lmom), lelln3(lmom), where lmom is a
numeric vector containing the L-moments of the distribution or of a data
sample.
# Draw an L-moment ratio diagram and add a line for
2007 May 18
0
Fwd: Re: Goodness-of-fit test for gamma distribution?
Thanks Petr. Comments below:
At 03:40 PM 18/05/2007, Petr Klasterecky wrote:
>Sean Connolly napsal(a):
>>Hi all,
>>I am wondering if anyone has written (or knows of) a function that
>>will conduct a goodness-of-fit test for a gamma distribution. I am
>>especially interested in test statistics have some asymptotic
>>parametric distribution that is independent
2016 Apr 18
0
R [coding : do not run for every row ]
Always keep the mailing list in cc.
The code runs for each row in the data. However I get the feeling that
there is a mismatch between what you think that is in the data and the
actual data.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070
2008 Apr 15
2
glht with a glm using a Gamma distribution
Quick question about the usage of glht. I'm working with a data set
from an experiment where the response is bounded at 0 whose variance
increases with the mean, and is continuous. A Gamma error
distribution with a log link seemed like the logical choice, and so
I've modeled it as such.
However, when I use glht to look for differences between groups, I get
significant
2011 Jan 07
0
Fitting an Inverse Gamma Distribution to Survey Data
Hello,
I've been attempting to fit the data below with an inverse gamma
distribution. The reason for this is outside proprietary software (@Risk)
kicked back a Pearson5 (inverse gamma) as the best fitting distribution with
a Chi-Sqr goodness-of-fit roughly 40% better than with a log-normal fit.
Looking up "Inverse gamma" on this forum led me the following post:
2010 Jun 16
2
Fitting Gamma distribution
I'm looking for goodness of fit tests for gamma distributions with large data
sizes and for different data.
I have a matrix with around 4.000 data values in it and i have fitted a
gamma distribution with "fitdistr".
You can see the example:
> fitdistr(corpo,"gamma",lower=0.001)
Errore in optim(x = c(5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000,
5000, :
2012 Feb 15
1
Parameter estimation of gamma distribution
Hi,
I am trying to estiamte parameters for gamma distribution using mle for
below data using fitdist & fitdistr functions which are from "fitdistrplus"
& "MASS"packages . I am getting errors for both functions. Can someone
please let me know how to overcome this issue??
data
y1<-
c(256656, 76376, 6467673, 46446, 3400, 3100, 5760, 4562, 8000, 512, 4545,
4562,
2010 Apr 15
2
using nls for gamma distribution (a,b,d)
Dear all
i want to estimated the parameter of the gamma density(a,b,d)
f(x) = (1/gamma(b)*(a^b)) * ((x-d)^(b-1)) * exp{-(x-d)/a)} for x>d
f(x) = Age specific fertility rate
x = age
when i run this in R by usling nls()
gamma.asfr <- formula(asfr ~ (((age-d)^(b-1))/((gamma(b))*(a^b)))*
exp(-((age-d)/a)))
gamma.asfr1 <- nls(gamma.asfr, data= asfr.aus, start = list(b = 28, a = 1,
d= 0.5),
2005 Jan 27
0
Survreg with gamma distribution
Dear r-help subscribers,
I am working on some survival analysis of some interval censored failure
time data in R. I have done similar analysis before using PROC LIFEREG
in SAS. In that instance, a gamma survival function was the optimum
parametric model for describing the survival and hazard functions. I
would like to be able to use a gamma function in R, but apparently the
survival package does
2008 Jul 01
1
Plotting Bi-Gamma Distribution
Hi all,
I've tried to plot a vector which has two peaks in the density.
This link shows the figure.
http://docs.google.com/View?docid=dcvdrfrh_1dk9r2rc7
The red line is normal curve and green line is gamma curve.
Notice that red line can correctly fit the histogram that has two peaks
(i.e. red curve also has two peaks).
But the gamma curve there only has one curve.
Is there a way I can
2005 May 23
1
transform normally distributed random terms to gamma distributed random terms
Hi,
I have normally distributed random terms u~N(0,1). I want to get gamma distributed random terms g~(scale,shape) with
E(g)=1=shape/scale and var(g)=theta=1/scale=1/shape.
How can I reach my goal? The following way doesn't work: use the distribution function of u to get U(0,1)- distributed random
terms, then take the quantile function of the gamma distribution with shape and scale.
The
2016 Apr 18
0
R [coding : do not run for every row ]
You can make this much more readable with apply functions.
result <- apply(
all_combine1,
1,
function(x){
p.value <- sapply(
seq_len(nSims),
function(sim){
gamma1 <- rgamma(x["m"], x["sp(skewness1.5)"], x["scp1"])
gamma2 <- rgamma(x["n"], x["scp1"], 1)
gamma1 <- gamma1 -