Displaying 20 results from an estimated 25 matches for "distn".
Did you mean:
dist
2008 Apr 13
0
R project
...sition in an array so the output is the power of each combination of test, distribution, sample size and mu1, however my code is not working and i keep getting an error message returned. My code is:
proj1.sim<-function(){
tests<-c("t","Wilcoxon","bootstrap")
distns<-c("Normal","Uniform","Beta")
sample.sizes<-c("5","10","25","50","100")
mu1s<-c("0","0.5","1","1.5","2")
res<-array(0,c(length(tests),length(distns),l...
2017 Jan 03
1
.Internal for functions in distn.R
Hi,
the functions in distn.R were converted from .Internal to .External ([1], in 2012), and to .Call ([2], in 2014).
They are still listed as .Internal in names.c, although they are not used in that way.
Shouldn?t they be removed?
There?s quite some simplification to be had, e.g., do_math3 could go away and do_math2 would b...
2023 Aug 27
1
Issue with gc() on Ubuntu 20.04
...Does the Windows box have the same version of R on it?
> The only thing I can think of is that there are quite a lot of cases
> where a function is generated on the fly as in:
>
> eval(parse(t=paste("dprob <-
> function(x,l,s){",dist.functions[2,][dist.functions[1,]==distn],"(x,l,s)}",sep="")))
This isn't very idiomatic. If you need dprob to call the function named
in dist.functions[2,][dist.functions[1,]==distn], wouldn't it be easier
for R to assign that function straight to dprob?
dprob <- get(dist.functions[2,][dist.functions[1,]=...
2010 Nov 09
2
simulation from pareto distn
Dear all,
I am trying to simulate from truncated Pareto distribution. I know there is
a package called PtProcess for Pareto distribution...but it is not for
truncated one. Can anyone please help me with this?
Thanks in advance.
Cassie
[[alternative HTML version deleted]]
2008 Oct 22
0
ad.test exponential distribution
Hi,
I'm trying to use ad.test or ad2.test to test whether a given data set is
exponential. I see that one of the function inputs is "distn", but I try
"exponential" and 5 other variants, but I still get the error message:
ad.test(test2, distn="exponential", fit=list(estimate = 0.167685), H=NA,
sim=100)
Error in ad.test(test2, distn = "exponential", fit = list(estimate =
0.167685), :
'distn...
2023 Aug 27
1
Issue with gc() on Ubuntu 20.04
...tried it on my lowly windows box that is years
old and got it down to 88.07%.
The only thing I can think of is that there are quite a lot of cases
where a function is generated on the fly as in:
eval(parse(t=paste("dprob <-
function(x,l,s){",dist.functions[2,][dist.functions[1,]==distn],"(x,l,s)}",sep="")))
I haven't added the options to any of these.
The highest time used by any of my functions is 0.05% - the rest is
dominated by gc().
There may not be much point in parallising the code until I can reduce
the garbage collection.
I am not short of me...
2009 Jul 09
2
Improvement of [dpq]wilcox functions
...05
RAM: < 1MB
> system.time( pwilcox( 21000, 211, 211) )
user system elapsed
0.020 0.000 0.025
> system.time( a <- qwilcox( 0.43, 200, 400) )
user system elapsed
0.040 0.000 0.07
RAM: < 1MB
There is no more need for
wilcox_free at [dpq]wilcox in src/library/stats/distn.R
(every other call after the first one with the same m,n
will just read the results from the array so it will be
really fast) and for
#define WILCOX_MAX 50 in src/nmath/nmath.h
p.s. modified files are in the attachment
have fun,
--
Ivo Ugrina << http://web.math.hr/~iugrina >>
Teachi...
2006 Apr 13
2
contribution offer: df() for non-centrality != 0
...rn leads to the
function dnbeta() already available in the
stats package for some time.
You may find this code in
http://www.uni-bayreuth.de/departments/math/org/mathe7/R-devel/dnf.tar.gz
This archive includes the C-File dnf.c
as well as some adapted versions Fdist_new.Rd
and distn_new.R;
in the latter two files I indicated all modifications
w.r.t. Fdist.Rd and distn.R by
a corresponding %%-tag.
You may modify these files as you like in order to
conform your design principles
--- and hopefully we will soon have df() for ncp, too...
Best,
Peter
2011 Aug 26
2
How to generate a random variate that is correlated with a given right-censored random variate?
...red time. Let us assume that C_i is independent of T_i. Now, I would like to generate another random variable U_i, I = 1, 2, ..., N, which is correlated with T. In other words, I would like to generate U from the conditional distribution [U | T=t].
One approach might be to assume that the joint distn [T, U] is bivariate lognormal. So, the marginals [T] and [U], as well as the conditional [U | T] are also lognormal. I can estimate the marginal [T] using the right-censored data Y (assuming independent censoring). For example, I might use survival::survreg to do this. Then, I assume that U is...
2006 Feb 06
3
power and sample size for a GLM with poisson response variable
Hi all,
I would like to estimate power and necessary sample size for a GLM with
a response variable that has a poisson distribution. Do you have any
suggestions for how I can do this in R? Thank you for your help.
Sincerely,
Craig
--
Craig A. Faulhaber
Department of Forest, Range, and Wildlife Sciences
Utah State University
5230 Old Main Hill
Logan, UT 84322
(435)797-3892
2008 May 23
1
maximizing the gamma likelihood
for learning purposes and also to help someone, i used roger peng's
document to get the mle's of the gamma where the gamma is defined as
f(y_i) = (1/gammafunction(shape)) * (scale^shape) * (y_i^(shape-1)) *
exp(-scale*y_i)
( i'm defining the scale as lambda rather than 1/lambda. various books
define it differently ).
i found the likelihood to be n*shape*log(scale) +
2003 Jul 16
2
Density function for non-central t distribution
Hi,
I've written some C code for density evaluation of the non-central t distribution. It works
with the R-1.7.1 source code if placed in the src/nmath directory and after appropriate
changes are made to Makefiles, to the dt function in src/library/base/R/distn.R etc.
I haven't read a lot of R source code so it may need some R-ification, but I've tried to use the
dt.c file as a standard.
Use and abuse.
Claus
===> File dnt.c <===
/*
* AUTHOR
* Claus Ekstr?m, ekstrom@dina.kvl.dk
* July 15, 2003.
*
* This program is free sof...
2010 Jun 23
1
A question about R2Winbugs
...ata into matrix
## parameter setting
N=nrow(X) # # of servers
T=ncol(X) # Time
m=sum(X)/(N*T) # mean of the training set
M=matrix(m,nrow=N,ncol=T)
s=sum((X-M)^2)/(N*T) # std of the training set
K=3 # # of clusters
alpha=0.5 # parameter for Dirichlet distn
sigmae=0.5 # var of cluster mean mu
q1=rep(1/K,K) # prior for Z(n,1)
## MCMC sampling
data=list("X","m","s","N","T","K","alpha","sigmae","q1")
inits=function(){list(a0=rbeta(1,1,1),
qx=matr...
2015 Oct 24
0
Building R for AIX in 32-bit mode - as preparation for building in 64-bit mode (changed subject!) - INFO/FEEDBACK - do not read as a bug report!
...ed.o d
blcen.o distance.o hclust-utils.o nls.o rWishart.o HoltWinters.o
PPsum.o arima.o burg.o filter.o mAR.o pacf.o starma.o port.o fa
mily.o sbart.o approx.o loglin.o lowess.o massdist.o splines.o lm.o
complete_cases.o cov.o deriv.o fft.o fourier.o model.o optim
.o optimize.o integrate.o random.o distn.o zeroin.o rcont.o
influence.o bsplvd.o bvalue.o bvalus.o loessf.o ppr.o qsbart.o sgram
.o sinerp.o sslvrg.o stxwx.o hclust.o kmns.o eureka.o stl.o portsrc.o
lminfl.o -fopenmp -L../../../../lib -lRlapack -lgfortran -
lm /opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4/libgcc.a -lg -lm
/opt/lib/libintl.a /...
2015 Oct 18
2
Building R for AIX in 32-bit mode - as preparation for building in 64-bit mode (changed subject!) - INFO/FEEDBACK - do not read as a bug report!
On 2015-10-15 15:02, Prof Brian Ripley wrote:
> On 15/10/2015 13:32, Michael Felt wrote:
>> Hi.
>>
>> Just wanted to let you know I am getting close to packaging R for AIX in
rephrase - would like to be active in keeping R binaries current for
AIX. My interest in not in R per se (rather a colleague who has a
project that uses R, so I hope to assist him, and others like him).
2006 Mar 08
1
power and sample size for a GLM with Poisson response variable
.... wrote:
> Craig, I found the package asypow difficult to use and it did not
> yield results in the ballpark of other approaches. (could not figure
> out the "constraints" vector).
>
> I wrote some simple functions, one asy.pwr uses the non-central
> chi-square distn.
>
> asy.pwr<-function(counts=c(7,1),py=c(1081,3180))
> { # a two group Poisson regression power computation # py is
> person-years or person-time however measured
> group<-gl(2,1)
> ncp<-summary(glm(counts~group+offset(log(py)),family=poisson))$null.de
> viance
>...
1997 Jul 09
1
R-beta: Problem with `rpois'
There is a problem with `rpois'. It does seem to take care about the
order of the arguments. This is an example:
> rpois(n=1,lambda=2)
[1] 3
> rpois(lambda=2,n=1)
[1] 2 0
It obviously uses the first argument as the number of samples to be
drawn, which is wrong.
I used Version 0.49 Beta (April 23, 1997).
Fredrik
1997 Jul 09
1
R-beta: Problem with `rpois'
There is a problem with `rpois'. It does seem to take care about the
order of the arguments. This is an example:
> rpois(n=1,lambda=2)
[1] 3
> rpois(lambda=2,n=1)
[1] 2 0
It obviously uses the first argument as the number of samples to be
drawn, which is wrong.
I used Version 0.49 Beta (April 23, 1997).
Fredrik
2010 Aug 09
1
R Base Code
Hello all,
I need to imitate the 'q' function (qnorm, qweibull, etc) for Clark's 2Dt
distribution model. I'm not skilled enough in R to code it myself, so I
thought I could find the base code for one of the existing 'q' functions and
just modify it. However, I'm having trouble navigating through the R Source
Code on the CRAN website. I've searched some forum and
2010 Oct 18
1
Data contamination
Dear experts,
Helps are badly needed.
I'm trying to generate a panel data with error term from N(0,1) and alpha
from U(0,20).Explanatory variables are from multivariate std normal distn.
Problem arised when I tried to contaminate the data in Y by adding
additional term from N(50,1). I ask the computer to choose 5 random data
from Y by using the command runif(5,1,50) since we have 50 data altogether.
i worry the computer will choose the same data twice. will that happen? i
attach...