Displaying 20 results from an estimated 100 matches similar to: "numerical integration"
2012 May 23
0
numerical integrals
Greetings,
I encounter a strange problem computing some numerical integrals on [0,oo).
Define
$$
M_j(x)=exp(-jax)
$$
where $a=0.08$. We want to compute the $L^2([0,\infty))$-inner products
$$
A_{ij}:=(M_i,M_j)=\int_0^\infty M_i(x)M_j(x)dx
$$
Analytically we have
$$
A_{ij}=1/(a(i+j)).
$$
In the code below we compute the matrix $A_{i,j}$, $1\leq i,j\leq 5$, numerically
and check against the known
2012 Feb 17
2
(subscript) logical subscript too long in using apply
Dear ALL
I have this function in R:
func_LN <- function(data){
med_ge <- matrix(c(rep(NA,nrow(data)*ncol(data))), nrow = nrow(data),
ncol=ncol(data), byrow=TRUE)
T <- matrix(c(rep(NA,length(n)*ncol(data))), nrow = length(n),
ncol=ncol(data), byrow=TRUE)
Tdiff<- matrix(c(rep(NA,length(n)*ncol(data))), nrow = length(n),
ncol=ncol(data), byrow=TRUE)
T1<- c(rep(NA,ncol(data)))
2023 May 12
2
Newbie: Controlling legends in graphs
Hello, I'm trying to create a line graph with a legend, but have no
success controlling the legend. Since nothing I've tried seems to work,
I must be doing something systematically wrong. Can anyone point this
out to me?
Here's my data:
> weights
# A tibble: 1,246 ? 3
Date J K
<date> <dbl> <dbl>
1 2000-02-13 133 188
2
2012 Mar 20
1
How to write and analyze data with 3 dimensions
Suppose I have data organized in the following way:
(P_i, M_j, S_k)
where i, j and k and indexes for sets.
I would like to analyze the data to get for example the following
information:
what is the average over k for
(P_i, M_j)
or what is the average over j and k for P_i.
My question is what would be the way of doing this in R.
Specifically how should I write the data in a csv file
and how do I
2004 Jul 21
5
RAID affecting X100P performance...
I have a P3-800 with two IDE drives in a software RAID1 configuration.
Each drive is on a separate IDE channel. Now anytime there is HD
activity, I hear "beeps" and "cutting out" on a call using the X100P
card.
I ran the zttest program, and discovered HD activity would drop the
accuracy down to between 2% and 50%.
However I noticed if I disabled one drive in the RAID1
2008 Dec 05
2
Help with wavCWTPeaks
I cannot understand the following error printed out when I try to get the extrema of my time series.
I would appreciate some suggestion as I really cannot interpret the error. I might not be using a proper
set of parameters in calling such functions. I am learning by doing ...
> aa.peak <- wavCWTPeaks (aa.tree)
Error in `row.names<-.data.frame`(`*tmp*`, value = c("1",
2023 May 16
0
Newbie: Controlling legends in graphs
Rui, thanks so much for your help. Your explanation and example were
clear and concise. Thanks for taking the time and effort to help me.
-Kevin
On 5/12/23 16:06, Rui Barradas wrote:
> ?s 14:24 de 12/05/2023, Kevin Zembower via R-help escreveu:
>> Hello, I'm trying to create a line graph with a legend, but have no
>> success controlling the legend. Since nothing I've
2007 Oct 17
1
How to save association rules generated by arules package
Hi,
I have been able to generate association rules for Market Basket Analysis
using the following codes:
****************************************************************************
*******************************************
library("arules")
rules <- read.csv("write1.csv",na.strings=c(".", "NA", "", "?"),header=TRUE)
2012 Jul 22
5
Reorder in decreasing order
reorder() is probably the best way to order the levels in a vector
without manually specifying the order. But reorder() orders by default
in an increasing order: "The levels are ordered such that the values
returned by ?FUN? are in increasing order."
Is there a way to do what reorder() does, but order the levels
according to a _decreasing_ order of the values?
Sverre
2011 Feb 20
2
Same color key for multiple lattice contour plots
Hi all,
I'm trying to make multiple lattice contour plots which have the same color
key, to allow good comparisons. However, I run into some problems when
fitting the plots to the color key. Basically my strategy to tackle this
problem was:
1) define a color key for all plots;
2) calculate the variable range for each plot;
3) calculate the range of colors from the color key that correspond
2023 May 16
0
[External Email] Newbie: Controlling legends in graphs
See below.
On 5/16/23 10:52, Christopher Ryan wrote:
> I"m more of a lattice guy than a ggplot guy, but perhaps this is part of
> the problem:
>
> .....
> ? ? ?geom_point(aes(y = m_K, color = "red")) +? ##### >> you've
> associated "K" with the color red
> ? ? ?geom_smooth(aes(y = m_K, color = "red")) +
>
2013 Apr 18
3
Using different function (parameters) with apply
Hi All,
I have the following problem (read the commented bit below):
a<-matrix(1:9,nrow=3)
a
[,1] [,2] [,3]
[1,] 1 4 7
[2,] 2 5 8
[3,] 3 6 9
div<-1:3
apply(a,2,function(x)x/div) ##want to divide each column by div-
instead each row is divided##
[,1] [,2] [,3]
[1,] 1 4.0 7
[2,] 1 2.5 4
[3,] 1 2.0 3
2005 Mar 03
2
reading row vectors from file
Hi,
New to R, using version 2.0.1 (2004-11-15) on debian Linux (sid), kernel
2.6.8-2-686.
I have data in files with separate vectors on each row of the file,
e.g.,
$ cat /tmp/stats
freq,0,1,2,3,4,5,6,7,8,9,16,17,18,19,20,...
noise,49,47,48,48,50,47,48,47,46,50,48,54,49,47,49,...
signal,99,0,100,0,0,100,0,100,100,0,100,101,100,0,0,...
pctrcv,5,0,5,0,0,5,0,5,11,0,5,5,5,0,0,...
2004 Apr 07
4
Problems with rlm
Dear all,
When calling rlm with the following data, I get an error. (R v.1.8.1,
WinXP Pro 2002 with service pack 1.)
> d <- na.omit(data.frame(CPRATIO, HEIGHTZ, FAMILYID))
> c <- tapply(d$CPRATIO, d$FAMILYID, mean)
> h <- tapply(d$HEIGHTZ, d$FAMILYID, mean)
> c
1 2 3 6 7 9 10
11
6.000000 2.500000 3.250000
2012 Aug 15
3
per-vertex statistics of edge weights
I have a graph with edge and vertex weights, stored in two data frames:
--8<---------------cut here---------------start------------->8---
vertices <- data.frame(vertex=c("a","b","c","d"),weight=c(1,2,1,3))
edges <-
2007 Jul 14
3
Strange C programming problem
I've got this little program I wrote to test something, and it keeps
giving the wrong result. I'm not inexperienced in C, but I can't believe
strtof (et al) are broken, so I must be doing something wrong. However,
I've spent hours looking at this and comparing it to the man pages and
don't see what I'm doing wrong. strtod() and strtold() also give equally
wrong results.
2009 Jan 22
1
subset exact values
Hi-
I need to subset the following data by the column 'dal' for values that
equal the regular interval seq(0, 150, by=0.5) exactly....
....excluding rows with irregular 'dal' values such as c(2.888958,
2.891620), etc.
data<-data.frame(id=id, dal=dal, date=date, mu.x=mu.x)
$dal
[1] 0.000000 0.500000 1.000000 1.500000 2.000000 2.500000 2.888958 2.891620
3.000000 3.245405
2007 Jul 19
2
linear interpolation of multiple random time series
Hi all,
Looking for tips on how I might more optimally solve this. I have
time series data (samples from a force sensor) that are not
guaranteed to be sampled at the same time values across trials. ex.
trial time x
1 1 1
1 5 4
1 7 9
1 12 20
2 1 0
2 3 5
2 9 10
2 13 14
2 19 22
2 24 32
Within each trial I'd like to use linear interpolation between each
successive time sample to fill in
2004 Dec 29
1
Discrepancy between intervals.lme and coef.lme
I'm using R on Windows v2.0.1 with the nlme package (v3.1-53) and am finding some unexpected discrepancies in the output of intervals.lme and coef.lme. I've included a toy dataset at the end, but briefly, the data are longitudinal data from couples in marital therapy. Each spouse's relationship satisfaction is measured 4 times; I've fit both linear and quadratic models to the
2012 Sep 26
2
averageif and looping
?haiii
i want to know, is there?any script in R to measure looping averageif (like in the excel) .......
for example:
i have a vector
row????value
1????????0
2????????2
3????????-3
4????????-2
5????????1
6????????-2
i want to measure the average of the vector for negative value with window estimation 5
so first mean is (-3+-2)/2
???? second mean is (-3+-2+-2)/3??