similar to: upper bound in the integrate function depends on a parameter

Displaying 20 results from an estimated 10000 matches similar to: "upper bound in the integrate function depends on a parameter"

2013 Apr 03
1
Problem with integrate function
Hello, The following code of mine is giving the error: Error in integrate(fx[[2]], 0.056, 1) : maximum number of subdivisions reached Can anyone help? Thanks and Regards. Swagato -------------------------- fv<-vector("list") fx<-vector("list") v<-0 c<-0 n<-0 NOV<-0 i<-0 while(n<200){ fv[[1]]<-function(x)1 #prior function
2009 Dec 18
1
Numerical Integration
Dear @ll. I have to calculate numerical integrals for triangular and trapezoidal figures. I know you can calculate the exactly, but I want to do it this way to learn how to proceed with more complicated shapes. The code I'm using is the following: integrand<-function(x) { print(x) if(x<fx[1]) return(0) if(x>=fx[1] && x<fx[2]) return((x-fx[1])/(fx[2]-fx[1]))
2004 Mar 11
4
Summary: do.call and environments
To use the modify the solution from Tony and I so that you can pass the name of the function, rather than the function itself, like this: x <- 7 fx <- function(y) print(x*y) f <- function(fun, x) { fun <- get(fun) environment(fun) <- environment() do.call("fun",list(3)) } f("fx",2) --- Date: Thu, 11 Mar 2004 08:22:45 +0100 From:
2016 Mar 29
1
documentation / warning when passing a vector as lower/upper bound in stats::integrate()
Dear R-dev list, I wonder if stats::integrate shouldn't warn the user when a numeric vector of length > 1 is passed as lower or upper bounds. If a vector is passed, only the first value is used and the others are silently ignored: integrate(sin, lower=0, upper=pi) integrate(sin, lower=0:10, upper=pi) ?integrate doesn't appear to mention explicitly that the function is not vectorised
2006 May 24
3
How to make attributes persist after indexing?
Dear All! For descriptive purposes I would like to add attributes to objects. These attributes should be kept, even if by indexing only part of the object is used. I noted that some attributes like levels and class of a factor exist also after indexing, while others, like comment or label vanish. Is there a way to make an arbitrary attribute to be kept after indexing? This would be especially
2006 Oct 14
4
Build error: Debian testing, libfox1.4, FXRuby-1.4.7
I''m getting compile errors when attempting to build FXRuby 1.4.7. This happens when installing using gems, or when installing from source: g++ -I. -I. -I/usr/lib/ruby/1.8/i486-linux -I/home/wayne/lab/fox/FXRuby-1.4.7/ext/fox14 -DHAVE_SYS_TIME_H -DHAVE_SIGNAL_H -I/usr/local/include/fxscintilla -I/usr/local/include/fox-1.4 -I/usr/include/fox-1.4 -fPIC -Wall -g -fno-strict-aliasing -O2
2010 Jan 27
1
term.formula error when updating an nls object
Hi, I'm getting an error that I don't understand when updating an nls object. Here is a toy example. dd <- structure(list(Contrast = c(0.00376, 0.03759, 0.12782, 0.25564, 0.50376, 1), Response = c(0.29915, 6.13248, 29.01709, 30.0641, 29.46581, 27.67094)), .Names = c("Contrast", "Response"), class = "data.frame", row.names = c(NA, -6L)) m1 <-
2004 Mar 10
5
do.call and environments
Hello, I want to call a function "fx" given by name, where some "global" variables (in the environment of fx) are passed to the function. For compatibility reasons I cannot modify the parameter list of fx and I want to avoid setting variables in the global environment (e.g. via <<-) Is there a way, how to do this? Thomas P. The example: fx <- function(y)
2009 Feb 04
3
factor
I am looking into change the numeric order in the level of the factor > x<-c("A","B","C") > fx<-factor(x) > fx [1] A B C Levels: A B C > factor(x) [1] A B C Levels: A B C > as.numeric(fx) [1] 1 2 3 I want to change the order of the numeric into 3 corresponds to ?A? level, 2 corresponds to ?B? level and 1 corresponds to ?C? level So when I
2011 Apr 09
1
How do I make this faster?
I was on vacation the last week and wrote some code to run a 500-day correlation between the Nasdaq tracking stock (QQQ) and 191 currency pairs for 500 days. The initial run took 9 hours(!) and I'd like to make it faster. So, I'm including my code below, in hopes that somebody will be able to figure out how to make it faster, either through parallelisation, or by making changes. I've
2005 Sep 29
2
solution of convolution equation
Hello, May be somebody can help me... I am trying to find a solution of a convolution equation using fft (and unfortunately I do not have a good background for this). So I am just trying to figure out how it can be implemented in R. I have two multidimensional independent variables X and Z and I know their densities fx and fz, which are multidimensional arrays. So I have to find the density of
2010 Jun 02
1
lattice, xyplot, using "panel.segments" by just addressing one panel
Hi R experts, I'm using the xyplot function in lattice to draw a multipanel plot consiting of 5x6 scatterplots. Now I need to link single points in each of those scatterplots (=panel),but the points, that need linking are different for each panel. I tried to use the panel.segments function for that, but I can't address each panel separately. Links right for panel 1, show up in all other
2004 Nov 26
2
T1 and FX CPE
Hey guys, Looking for some suggestions here on hardware to use. We have several business customers wanting to start using our VoIP service. We will be replacing their 10 year old Panisonic system with Cisco 7940 phones and a T1. Problem is, they have to keep 1 POTS line for directory listing and 911 emergency failover. I would like suggestions on how to accomplish this. Our asterisk cluster
2013 Jul 23
1
Help with using unpenalised te smooth in negative binomial mgcv gam
Hi, I have been trying to fit an un-penalised gam in mgcv (in order to get more reliable p-values for hypothesis testing), but I am struggling to get the model to fit sucessfully when I add in a te() interaction. The model I am trying to fit is: gam(count~ s(x1, bs = "ts", k = 4, fx = TRUE) + s(x2, bs = "ts", k = 4, fx = TRUE) + te(x2, x3, bs =
2009 Feb 12
1
Latex or html output for freq() in prettyR
Hi Everybody I need to create a lot of frequency tables with frequencies and percentages (and cumilative freq and % as well) for a report. freq() in prettyR give more or less what I need. I am trying to export the result of freq() to html but the html doesn't look look the console output. See the following example library(prettyR) library(Hmisc) x <- matrix(sample(1:3, 12,
1999 Oct 08
1
floor(NaN) problem fixed in massdist.c (PR#291)
Full_Name: Naoki Takebayashi Version: 0.65.0+R-release.diff (Oct 6, 1999) OS: Linux/Alpha Submission from: (NULL) (129.79.224.171) This will fix the "problem 2 (crash in fft)" in Bug ID #277 On Linux/Alpha, make check failed because R could not handle the following example in base-Ex.R ##___ Examples ___: # The Old Faithful geyser data data(faithful) : : ## Missing values: x <-
2011 May 01
2
Marginal a partir de la densidad conjunta
Cordial saludo. Estoy trabajando con una densidad conjunta algo elaborada (suma y cociente de dos variables aleatorias positivas usando la cópula Frank) y requiero encontrar la distribución marginal de cada una de las variables. A manera de ejemplo (no es el caso específico, que tiene mucho más código), si partimos de la distribución exponencial bivariada #----- theta<-0.5
2011 Dec 22
1
RGtk2: How to overlay a gtkDrawingArea with a button or any other widget?
I try to overlay a plot inside a gtkDrawingArea with a button (or any other widget). I tried to put both into a gtkFixed container. But this does not work, no printing occurs. Does someone know a solution? What I tried: w <- gtkWindow() w$setSizeRequest(400,400) fx <- gtkFixed() da <- gtkDrawingArea() fx$put(da, 100, 100) asCairoDevice(da) par(mar=c(0,0,0,0)) plot(1:10) btn.1
2009 May 11
1
Plot bivariate joint pdf
For a homework question. I was wondering if rcmdr has a function to plot a graph of a bivariate function of X and Y. I have a function with joint pdf fX,Y(x,y) = x+y for 0<x<1 , 0<y<1 I've tried > x <- seq(0,1,.001) > y <- seq(0,1,.001) > r = x+y > plot(r) but it seems to just add them together say .2+.2 .3+.3 not other possibilities like .9 + .1 Thanks
2002 Dec 12
1
equation on the object
Hi, I try to put an equation on a object to use in curve for example, but it don't work, it possible to make a object of an equation? ex. fx <- a + b*x for(a in 0){for(b in 1){curve(fx,...)}} Thanks you Ronaldo ps. Exist in R any functions to estimate severals curves parameters (non interactive) for a dataset? Something like table-curve 2d. -- If Karl, instead of writing a lot about