Displaying 20 results from an estimated 7000 matches similar to: "normal cdf over an interval"
2003 Sep 23
4
searching R-help within a function
Hi,
I am working on a package which requires separate documentation
(tutorial documentation, really, with a lot of beautifully
latexed equations), and does not use R-help. I am trying to
make it so that my help function will automatically search
R-help if the help topic isn't found in my documentation.
The function looks something like this:
help.pkg <- function(topic) { #
2003 Sep 23
4
searching R-help within a function
Hi,
I am working on a package which requires separate documentation
(tutorial documentation, really, with a lot of beautifully
latexed equations), and does not use R-help. I am trying to
make it so that my help function will automatically search
R-help if the help topic isn't found in my documentation.
The function looks something like this:
help.pkg <- function(topic) { #
2005 Jan 21
6
dim vs length for vectors
Hi all,
I'm not sure if this is a feature or a bug (and I did read the
FAQ and the posting guide, but am still not sure). Some of my
students have been complaining and I thought I just might ask:
Let K be a vector of length k. If one types dim(K), you get
NULL rather than [1] k. Is this logical?
Here's the way I explain it (and maybe someone can provide a
more accurate
2002 Sep 11
1
rational approximations to the normal cdf
In the R source, nmath/pnorm.c contains the
code for a rational function approximation
for the normal cdf. These constants are listed:
const double a[5] = {
2.2352520354606839287,
161.02823106855587881,
1067.6894854603709582,
18154.981253343561249,
0.065682337918207449113
};
The source file cites a paper by Cody (1969)
and states that these
2004 Apr 16
1
install.packages
install.packages works for Linux because the directory structure is not
version dependent, as it is for the Windows download. That should be
fixed as soon as my sys admin consents to install R 1.9.0 so we
can do the cross compile.
Of course, you are right, Martin and Peter, that Zelig should be on CRAN
proper. We just need to write a few .Rd files to be compliant with R
check, and change our
2003 Oct 26
1
commenting demos
Hi,
Is there a way to make demo() print comments along with the code
and output?
For example, if I use something like readline("..."), demo
prints both readline("...") and ...; as far as I can tell, this
is also true of print() and cat(). I just want students to stop
and think about every command in my demo scripts.
Thanks,
Olivia.
2012 Feb 02
1
Calculate the natural log of cdf between 2 intervals
Hello all,
I was wondering if there is an R function to do the following:
[*] log(pnorm(x)-pnorm(y)), where x>y.
I don't want all the area under the natural log of the normal pdf less than
x, I only want the area between y and x.
I am aware of the ability to specify log.p=TRUE, which gives me the log of
the probability that X<=x. This does not help me, because the following
code:
2012 Sep 03
0
Skew-Normal CDF using psn
Dear R-users,
I have been using the code below in order to verify how the CDF of a
skew-normal distribution was calculated:
library(sn)
s=seq(-30,30,by=0.1)
a<-matrix(nrow=length(s),ncol=5)
lambda=1
for(i in 1:length(s)){
a[i,1]=pnorm(s[i],mean=0,sd=1);
a[i,2]=T.Owen(s[i],lambda);
a[i,3]=a[i,5]-2*a[i,6];
a[i,4]=pnorm(s[i])-2*T.Owen(s[i],lambda);
2003 Aug 06
1
demo() function returns alphabetical matches, not unique matches?
Hi,
I'm working on a set of demo files for a package, and I'm having a problem because I have two demo files (one called "logit", the other called "blogit") and when I type demo(logit), it gives me demo(blogit) instead. (And calls it the the demo for logit.)
I've figured out that this is because the demo() function searches through all the demo directories (in
2002 Feb 19
2
cdf of the standard normal distribution
Dear Experts,
I need to calculate the cdf of the standard normal distribution, i.e.
H(x) = 1/sqrt(2*pi) integral(exp(-z^2/2) dz), where z is b/w -infi to
infi.
I know there should be a way to do it in R, but did not know to do it.
I'd appreciate any help you could offer.
Charlie Liu
Graduate student intern at EPA/ECO
2003 Oct 11
1
boot statictic fn for dual estimation of 2 stats?
Hi,
I am trying to use boot() to refit an ordinal logit (polr in MASS) model.
(A very basic bootstrap which samples from the data frame without
replacement and updates the model.)
I need to extract two statistics per run (the coefficients and zeta) and I
tried concatenating them into a single vector after fitting, but I get the
following error:
Error in "[<-"(*tmp*, r, ,
2007 Jul 10
3
ECDF, distribution of Pareto, distribution of Normal
Hello all,
I would like to plot the emperical CDF, normal CDF and pareto CDF in the
same graph and I amusing the following codes. "z" is a vector and I just
need the part when z between 1.6 and 3.
plot(ecdf(z), do.points=FALSE, verticals=TRUE,
xlim=c(1.6,3),ylim=c(1-sum(z>1.6)/length(z), 1))
x <- seq(1.6, 3, 0.1)
lines(x,pgpd(x, 1.544,0.4373,-0.2398), col="red")
y
2003 Jan 08
1
Lattice: Plotting two densities on the same plot(s)?
I am trying to plot two density lines on the same graph. Using the
functions on the base package, I would go:
plot(density(x), col = 1)
lines(density(y), col = 2)
And I get two distinct (one-bump) density lines. When I try to do it
using lattice, I get two two-humped lines. (In other words, I think the
smoothing function is taking the next set of data points and smoothing them
in the same
2011 Apr 26
2
Wish R Core had a standard format (or generic function) for "newdata" objects
Is anybody working on a way to standardize the creation of "newdata"
objects for predict methods?
When using predict, I find it difficult/tedious to create newdata data
frames when there are many variables. It is necessary to set all
variables at the mean/mode/median, and then for some variables of
interest, one has to insert values for which predictions are desired.
I was at a
2006 Apr 26
1
cdf of weibull distribution
Hi,
I have a data set which is assumed to follow weibull distr'. How can I find of cdf for this data. For example, for normal data I used (package - lmomco)
>cdfnor(15,parnor(lmom.ub(c(df$V1))))
Also, lmomco package does not have functions for finding cdf for some of the distributions like lognormal. Is there any other package, which can handle these distributions?
2013 Apr 21
1
Using copulas with user-defined marginal functions
I am trying to make a loglikelihood function using copulas. I am trying to
use mvdc to find the density function. When I run this I got the error that
the pdf and cdf of my function tobit doesn't exist. Can somebody guide me
where my mistake is?
dtobit <- function(beta,sigma, x, y) {ifelse(y>0, dnorm(y,x%*%beta,
sigma),(1-pnorm((x%*%beta)/sigma)))}
ptobit <- function(beta,sigma, x,
2013 Jan 30
2
Integration of mixed normal distribution
Hi,
I already found a conversation on the integration of a normal
distribution and two
suggested solutions
(https://stat.ethz.ch/pipermail/r-help/2007-January/124008.html):
1) integrate(dnorm, 0,1, mean = 0, sd = 1.2)
and
2) pnorm(1, mean = 0, sd = 1.2) - pnorm(0, mean = 0, sd = 1.2)
where the pnorm-approach is supposed to be faster and with higher precision.
I want to integrate a mixed
2001 Jan 09
3
log(0) problem in max likelihood estimation
This practical problem in maximum likelihood estimation must be
encountered quite a bit. What do you do when a data point has a
probability that comes out in numerical evaluation to zero? In calculating
the log likelihood you then have a log(0) problem.
Here is a simple example (probit) which illustrates the problem:
x<-c(1,2,3,4,100)
ntrials<-100
yes<-round(ntrials*pnorm((x-3)/1))
2006 Apr 23
2
distribution of the product of two correlated normal
Hi,
Does anyone know what the distribution for the product of two correlated
normal? Say I have X~N(a, \sigma1^2) and Y~N(b, \sigma2^2), and the
\rou(X,Y) is not equal to 0, I want to know the pdf or cdf of XY. Thanks
a lot in advance.
yu
[[alternative HTML version deleted]]
2007 Sep 13
2
Reciprocal Mill's Ratio
I believe that this may be more appropriate here in r-devel than in r-help.
The normal hazard function, or reciprocal Mill's Ratio, may be obtained
in R as dnorm(z)/(1 - pnorm(z)) or, better, as dnorm(z)/pnorm(-z) for
small values of z. The latter formula breaks dowm numerically for me
(running R 2.4.1 under Windows XP 5.1 SP 2) for values of z near 37.4
or greater.
Looking at the pnorm