search for: stepfun

Displaying 20 results from an estimated 159 matches for "stepfun".

2009 May 26
1
stricter use of xlim in plot.stepfun
Dear R developer, I am not quite sure, if I should post my concern as a wish to r-bugs at r-project.org. Thus, as recommended, I first send an email to you. My request is the following: I would appreciate, if it was possible to obtain a plot of a 'stepfun' with a strict interpretation of xlim. What I mean: sf <- stepfun(1:4, 1:5) plot(sf, xlim=c(0,10)) does not bound the function to the horizontal area from 0 to 10, but continues drawing outside this interval. Another situation: I want to add a stepfun to an existing plot: plot(c(0, 50), c...
2008 Dec 31
1
plot.stepfun xlim
i've noticed a strange problem when plotting a stepfun. according to the documentation, the xlim parameter should bound the range of the function being plotted, and is returned as the extreme two values (i.e. first and last) in the vector t from the plot.stepfun call. instead, it plots beyond the desired range (although the limits are preserved for t...
2008 Jun 21
2
using the stepfun to plot histogram outline.
...I have lots of values which I would like to get a histogram outline out of. An example of what I am talking about: testdata = runif(100) bbb = seq(0,1, by = 0.01) hist(testdata, breaks = bbb) I would like to get the outline of the resulting histogram. Now, I think that I can do this using the stepfun function. However, I am uncertain of how to get to the data the stepfun function require. >From ?stepfun Arguments: x: numeric vector giving the knots or jump locations of the step function for 'stepfun()'. For the other functions, 'x' is as 'ob...
2002 Jul 25
1
Calling the correct one of 2 conflicting functions
...platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 1 minor 5.1 year 2002 month 06 day 17 language R Each of the hmisc and stepfun packages has a function named ecdf(), and I have my own package which requires both of these packages. Is there a way to ensure that the correct ecdf function is called by one of my own functions, that is, if both packages are in the search path? For example, > library(stepfun);library(hmisc)...
2011 Feb 08
1
help on stepfunction
Dear members, I would like a help for extracting the values from a step function (stepfun). >From help(stepfun) we have the following example: Y0<-c(1.,2.,4.,3.) y0<-c(1.,2.,3.,4.) sfun<-stepfun(1:3,y0,f=0) plot(sfun) Now, suppose instead I was given the object (*sfun*, say) from which I wanted to extract the values generated by the function *stepfun*. More precisely, I w...
2003 Nov 17
4
cumulative distribution functions
hi y'all, I am wondering if there is any special command, function, package, etc to help me doing a cumulative distribution function, with y-scale - probability scale. I tried the help in R and i got the following answers: cumsum(base) Cumulative Sums, Products, and Extremes ecdf(stepfun) Empirical Cumulative Distribution Function cpgram(ts) Plot Cumulative Periodogram But i could not find either (stepfun) nor (ts) packages to read the specific help. Are they discarded? The "cumsum" seems not to do what i really was after. Any help as usual very...
2012 May 04
1
Absolute cumulative curve with ecdf/stepfun?
...in one plot (using ggplot2). So far I used ecdf() (from an example I found with google) to get values for the cumulatice distribution function which gives a relative curve. I also want to do the same plot but using absolute cumulative values instead of relative. Can that be done with ecdf or with stepfun() to get values I can use to plot the curves? Here a small example that shows the result with ecdf: library(ggplot2) library(reshape) dftest1 <- data.frame(value=runif(1000,0,1),variable=rep(c("a","b"),c(500,500))) dftest2 <- ddply(dftest1,.(variable),transform, ecd = e...
2003 May 02
1
stepfuns: R^2 -> R
Does anyone have any suggestions on perspective plotting of piecewise constant functions? Ideally, I would like something like plot.stepfun for functions that are piecewise constant on polygons. Even pointers to non-R strategies would be welcome at this stage. url: www.econ.uiuc.edu Roger Koenker Dept. of Economics UCL, email rkoenker at uiuc.edu Department of Economics Drayton House, vox: 217-333-4558 University of Illinois 30 G...
2004 Sep 16
1
Newbie q. need some help understanding this code.
...R? ( that is if one has enough time and inclination) It implements gillepsie's stochastic algorithm for Lotka Volterra model. What would help me tremendously is to see the breakdown of the line by line code into plain english. thanks for any insights or other comments. sean library(stepfun) lv <- function(N=1000,cvec=c(1,0.005,0.6),x=c(50,100)) { m<-length(cvec) n<-length(x) xmat<-matrix(nrow=N+1,ncol=n) tvec<-vector("numeric",N) h<-vector("numeric",m) t<-0 xmat[1,]<-x for (i...
2005 Jul 07
1
CDF plot
Dear all, I have define a discrete distribution P(y_i=x_i)=p_i, which I want to plot a CDF plot. However, I can not find a function in R to draw it for me after searching R and R-archive. I only find the one for the sample CDF instead my theoretical one. I find stepfun can do it for me, however, I want to plot some different CDF with same support x in one plot. I can not manage how to do it with stepfun. Is there any existing function in R to draw the theoretical CDF plot? Or how to abline other step functions in stepfun? Thanks.
2006 Aug 25
2
plot question
Hi everyone, I have what may appear to be a newbie question, but I have looked everywhere I can think to look and I cannot find an answer. On page 35 of "An Introduction to R" the following command appears: plot(ecdf(eruptions), do.points=FALSE, verticals=TRUE). What is the do.points argument? I know what it does (suppresses printing of the points) but where can I find help on it?
2008 Jan 22
2
R object as a function
...owing (senseless) example of a double integration: test<-function(sf,lo,up,rest) { innerFkn<-function(sf,lo) { inte=integrate(f=sf,lower=lo,upper=4) return( inte$value ) } integral=integrate(f=innerFkn,lower=1,upper=2,sf=sf,lo=lo,up=up) return( integral$vlaue+rest ) } test(sf=stepfun(c(0,1),c(2,-1,3)),lo=0,up=2,rest=12) Why isn't it possible to define the "innerFkn" inside "test"? "sf" is a stepfun, but it should possibly be any function. How can I define some R object like a stepfun (depending on variables) which can be evaluated like a funct...
2003 Jul 21
3
Confidence Band for empirical distribution function
Hi, I was trying to draw an empirical distribution function with uniform confidence bands. So I tried to find a way to calculate values of the Kolmogorov-Smirnov Distribution but failed. I guess it must be hidden somewhere (since the ks-test is implemented), but I was unable to find it. Is there any way to do this? Thanks Leif Boysen
2003 Aug 26
3
plot empirical pdf
Hi, are there any function to plot the empirical probability distribution function? I just don't want to reinvent the wheel... Best wishes, Ott -- Ott Toomet PhD Student Dept. of Economics ?rhus University Building 322 Universitetsparken 8000 ?rhus C Denmark otoomet (a) econ au dk ph: (+45) 89 42 20 27 ------------------------------------------- (o_ (*_ (O_
2003 May 12
2
I can not load MASS at starting R
...rpm package available for RedHat 9.0. My machine is a pentium4. This is my .Rprofile file ( placed in my home directory ): w <- function ( x, y ) write.table ( t ( x ), file = y, quote = F, col.names = F, row.names = F, sep = ',' ) q <- function () q ( save = 'no' ) library( stepfun ) library ( MASS ) The MASS library is not loaded when R is started. These are the error messages I got: Error in get(x, envir, mode, inherits) : variable "biplot" was not found Error in library(MASS) : package/namespace load failed
1998 Jul 06
0
R-beta: Printing documentation for R and all packages installed
...d Immunology, Bonn context diff against R/doc/manual/Makefile: *** Makefile 1998/07/05 16:14:11 1.1 --- Makefile 1998/07/06 06:40:22 *************** *** 10,23 **** RsrcLIB = $(rRHOME)/src/library BUILDlatex = $(RETC)/Rdconv --type latex ! Packages = pkg-base.tex pkg-eda.tex pkg-mva.tex pkg-stepfun.tex #- Man.tex also must have an \input{..} for each of these ^^^^ Manparts = Man-1.ps Man-2.ps Man-3.ps Man-4.ps\ Man-5.ps Man-6.ps Man-7.ps Man-8.ps Manbooks = $(Manparts:.ps=.bps) ! all: Man.dvi $(RLIB)/base/latex/%.tex: $(RsrcLIB)/base/man/%.Rd $(BUILDlatex) $< &g...
2003 Apr 03
5
cdf function: inverse to quantile?
Is there a function in R for calculating empirical cumulative distribution functions, i.e. the inverse of the quantile function? Perhaps in some library? I''d hate to have to re-invent the wheel. David Edwards, Biostatistics, Novo Nordisk A/S, Bagsværd, Denmark. DEd@novonordisk.com <mailto:DEd@novonordisk.com> Tlf: +45 44 42 62 35. Fax: +45 44 42 14 80 [[alternate HTML version
2009 Jul 03
3
Color of ecdf plots
Hi. I have the following two ecdf plots in one graph: plot( ecdf(....), do.points=FALSE, verticals=TRUE, main=paste("Ecdf of distances ",DIM,sep=""), col="red" ); lines( ecdf(....), do.points=FALSE, verticals=TRUE ); How do I change the color of the resulting graph? Adding col="red" to either plot or lines results in an error
1999 Jan 13
4
make docs
I'm having trouble with make at the documentation. (R 0.63.2 on Solaris) Paul Gilbert ______ g77 -O2 -fPIC -c kmns.f -o kmns.o ld -G -o mva.so dblcen.o hclust.o kmns.o mkdir ../../../../library/mva/libs mkdir ../../../library/stepfun mkdir ../../../library/stepfun/R Building system startup profile You should `make docs' now ... make: Fatal error: Don't know how to make target `*/man/*.Rd' Current working directory /home/res4/gilp/R-versions/R-0.63.2/src/library [17] /home/res/gilp/R-versions/R-0.63.2 : which perl /u...
2002 Nov 25
1
Plotting continuous line types w/large datasets
...th plot(ecdf(x1...),...) plot(ecdf(x2...),add=TRUE,...) plot(ecdf(x3...),add=TRUE,...) The datasets are very similar, so it is difficult to get visual separation among them. I tried many different line types without success -- the lines all came out solid. Checking further, plot.ecdf() calls plot.stepfun(), which calls segments() between each pair of points to plot. Since the points are so close together the lty parameter becomes meaningless, which is why the lines come out solid. I modified plot.stepfun() to call lines() for the whole vector of points, but this didn't seem to help. So my quest...