search for: trapz

Displaying 10 results from an estimated 10 matches for "trapz".

Did you mean: traps
2012 Sep 08
0
Help on calculating AUC with caTools trapz(a,b) command
Dear All,   I have the following example:   a <-matrix(c(1:100),ncol=10) b <-matrix(c(2,4,6,8,10,12,14,16,18,20))   trapz(b,a)   will give me a result of 99, which it seems to me is the AUC of the 1st column only. Is it possible to get the AUC results by columns of "a" using the same "b" values in the calculations as opposed to just generating the result for the 1st column? It would be important th...
2011 Jan 25
3
Integration of two lines
...x - Integral(f_y)dx |.) Computing this integral looks non trivial. I guess I should interpolate the points of f_y over x and integrate both lines on these intervals. Even then I would miss points where the lines cross. There are functions to integrate below *one* line (I'm thinking about the trapz function in caTools). Do you know if there is a function to do this integration properly with two lines (and especially their absolute difference)? Regards, Xavier
2013 Jul 17
2
Using RasterBricks
...* 1:3 Each cell of the rasterfinal will have the AREA UNDER CURVE formed by the values in each cell of the three original rasters. For example: s[4] has the values: 4,8,12 y<-s[4]; x<-0:2; You can see the AUC in this graph: plot(x,y, type='l') And calculate it using the function trapz (package:pracma) library(pracma) trapz(x,y) ################################################################################# My idea was to use 'stackApply': FINAL<-stackApply(s,1,myFUN) with: myFUN=function(y) { x<-1:length(y) trapz(x,y) } It doesn´t work. What I am doing wrong?...
2012 Mar 19
2
by output into data frame
I could do this in various hacky ways, but what's the right way? I have a nice application of the by function, which does what I want. The output looks like this: > auc_stress lab.samples.stress$subid: 2 cortisol amylase 1 919.05 6834.8 ---------------------------------------------------------------------------------------------------------------------------
2023 Nov 09
1
Dependency errors for package pracma
...` require integer inputs now (these functions are not used in the packages below). I received a dependency report saying that *** Changes to worse in reverse dependencies *** celltrackR, geostatsp, gmvjoint, hypr, randnet Example: geostatsp suggests pracma, but uses only the function 'trapz' that has not changed for years and years. I cannot check this package, as probably other packages (from Bioconductor ?) are needed to install it. Example: gmvjoint imports pracma and uses 'grad', 'hessian', and 'nearest_spd'; these functions have not changed for years....
2013 Jul 17
0
Using RasterBricks
...y idea was to use 'stackApply': Para esto que necesitas es más sencillo usar calc. Si quieres usar stackApply, debes indicar rep(1, 3) como índices en lugar de sólo 1. Así, la función será (los ... son necesarios en stackApply): myFUN <- function(y, ...) { x <- seq_along(y) trapz(x, y) } Y aplicada con calc: FINAL <- calc(s, myFUN) o con stackApply: FINAL <- stackApply(s, rep(1, 3), myFUN) Saludos. Oscar. -- Oscar Perpiñán Lamigueiro Grupo de Sistemas Fotovoltaicos (IES-UPM) Dpto. Ingeniería Eléctrica (EUITI-UPM) URL: http://procomun.wordpress.com Twitter: @o...
2007 Sep 17
4
Must be easy, but haven't found the function (numerical integration)
Hi, I have a data frame of 2 columns with the following types : data$day char data$value num And I plot my data with : plot(strptime(donnees$day,format="%Y-%m-%d %H:%M:%S"),donnees$value, type="l") And I'd just like to get the numerical value of the integration of this graph. I looked at ?integrate but, as far as I understood (that is, not very much, due to my poor
2005 Aug 02
5
question on graphs and finding area under a curve
Question on graphs: The default case for drawing a graph in R, is where a little space is left on the x and y axis before the first tick i.e. even if I say xlim=c(0,1) -- there will be some space between the edge of the x-axis and where 0 is placed. If I want 0 on the edge, how do I do it in R? Area under the curve: I have a 45 degree line and a curve above or below it. Is there a way in R
2007 Apr 09
1
How to solve differential and integral equation using R?
Hello, I want to know if there are some functions or packages to solve differential and integral equation using R. Thanks. Shao chunxuan. [[alternative HTML version deleted]]
2013 Jul 19
0
Resumen de R-help-es, Vol 53, Envío 26
...y idea was to use 'stackApply': Para esto que necesitas es más sencillo usar calc. Si quieres usar stackApply, debes indicar rep(1, 3) como índices en lugar de sólo 1. Así, la función será (los ... son necesarios en stackApply): myFUN <- function(y, ...) { x <- seq_along(y) trapz(x, y) } Y aplicada con calc: FINAL <- calc(s, myFUN) o con stackApply: FINAL <- stackApply(s, rep(1, 3), myFUN) Saludos. Oscar. -- Oscar Perpiñán Lamigueiro Grupo de Sistemas Fotovoltaicos (IES-UPM) Dpto. Ingeniería Eléctrica (EUITI-UPM) URL: http://procomun.wordpress.com Twitter: @o...