Displaying 20 results from an estimated 1000 matches similar to: "integrate and quadratic forms"
2006 Nov 14
1
??: Re: Need help in waveslim package: imodwt and universal.thresh.modwt
Airon,
I used R2.4.0 on a Windows XP (SP2) (not Chinese :-))
and it still works:
> data = read.csv("u:/airon.csv")
> xdata = data$Adj..Close
> modwt.la8 = modwt(xdata, "la8", n.level=6)
> summary(modwt.la8)
Length Class Mode
d1 1467 -none- numeric
d2 1467 -none- numeric
d3 1467 -none- numeric
d4 1467 -none- numeric
d5 1467 -none- numeric
d6 1467
2006 Nov 15
2
??: Re:??: Re: Need help in waveslim package: imodwt and universal.thresh.modwt
Airon,
I don't think you have to find an English computer 'cause the
following must work in your Chinese one :-)
Let me explain. First of all, change your lines to
xdata <- ckhdat$Adj..Close[1:1447]
#names(ckhdwt.la8) <- c("w1", "w2", "w3", "w4", "w5","w6", "v6")
note the # sign, i.e., DO NOT change the names
2006 Nov 12
2
Need help in waveslim package: imodwt and universal.thresh.modwt
Hi:
I have encountered problems with imodwt and universal.thresh.modwt and cannot find any reference in R Search. Hope someone can give me some ideas:
Starting with
modwt.la8 <- modwt(xdata, "la8", n.level=6) <-- this seems to work fine
(1) ydata <- imodwt(modwt.la8)
will always give ydata as numeric(0) (no values) instead of being a time series data with
2009 Sep 23
1
Numerical integration problem
Hi there
I'm trying to construct a model of mortality risk in 2D space that
requires numerical integration of a hazard function, for which I'm using
the integrate function. I'm occasionally encountering parameter
combinations that cause integrate to terminate with error "Error in
integrate... the integral is probably divergent", which I'm not sure how
to interpret. The
2024 Sep 05
3
BUG: atan(1i) / 5 = NaN+Infi ?
On 2024-09-05 4:23 p.m., Leo Mada via R-help wrote:
> Dear R Users,
>
> Is this desired behaviour?
> I presume it's a bug.
>
> atan(1i)
> # 0+Infi
>
> tan(atan(1i))
> # 0+1i
>
> atan(1i) / 5
> # NaN+Infi
There's no need to involve atan() and tan() in this:
> (0+Inf*1i)/5
[1] NaN+Infi
Why do you think this is a bug?
Duncan Murdoch
2024 Sep 05
2
BUG: atan(1i) / 5 = NaN+Infi ?
Perhaps
> Inf*1i
[1] NaN+Infi
clarifies why it is *not* a bug.
(Boy, did that jog some long dusty math memories :-) )
-- Bert
On Thu, Sep 5, 2024 at 2:48?PM Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:
> On 2024-09-05 4:23 p.m., Leo Mada via R-help wrote:
> > Dear R Users,
> >
> > Is this desired behaviour?
> > I presume it's a bug.
> >
2004 Dec 16
3
Qyery on bark equation in floor0 code
Hi All,
I need some clarifications regarding the mismatch I found in the code
and the specification.
(a) In the specification, the bark(x) equation is given as:
bark(x) = 13.1 atan(.00074x) + 2.24 atan(.0000000158(x^2)) + .0001x
whereas in the code it is given as:
#define toBARK(n)
(13.1f*atan(.00074f*(n))+2.24f*atan((n)*(n)*1.85e-8f)+1e-4f*(n))
Which one of these is the proper one ?
(b)
2024 Sep 05
2
BUG: atan(1i) / 5 = NaN+Infi ?
Dear R Users,
Is this desired behaviour?
I presume it's a bug.
atan(1i)
# 0+Infi
tan(atan(1i))
# 0+1i
atan(1i) / 5
# NaN+Infi
There were some changes in handling of complex numbers. But it looks like a bug.
Sincerely,
Leonard
[[alternative HTML version deleted]]
2006 Nov 16
0
??: Re:??: Re:??: Re: Need help in waveslim package: imodwt and universal.thresh.modwt
Airon,
I'm not sure I have understood your question. Anyway, it
seems to me that you'll have to code a little. Take a look
at ?modwt. I think you'll have to put zeros each scale a time
except the one you want to reconstruct. Then do imodwt.
After some small loop, I think you'll get the desired result.
HTH,
Rogerio.
---------- Cabe?alho original -----------
De: "Airon
2024 Sep 06
1
BUG: atan(1i) / 5 = NaN+Infi ?
I expect that atan(1i) = (0 + infinity i) and that atan(1i)/5 = (0 +
infinity i)/5 = (0 + infinity i).
Here's what I get in C:
(0,1) = (0, 1)
atan((0,1)) = (0, inf)
atan((0,1))/5 = (0, inf)
Note the difference between I*infinity = (0,1)*infinity =
(0*infinity,1*infinity) = (NaN,infinity)
and (0,infinity)/5 = (0/5,infinity/5) = (0,infinity).
The former involves multiplying 0 by infinity, which
2024 Sep 05
2
BUG: atan(1i) / 5 = NaN+Infi ?
atan(1i) -> 0 + Inf i
complex(1/5) -> 0.2 + 0i
atan(1i) -> (0 + Inf i) * (0.2 + 0i)
-> 0*0.2 + 0*0i + Inf i * 0.2 + Inf i * 0i
infinity times zero is undefined
-> 0 + 0i + Inf i + NaN * i^2
-> 0 + 0i + Inf i - NaN
-> NaN + Inf i
I am not sure how complex arithmetic could arrive at another answer.
I advise against messing with infinities... use atan2() if you don't
2005 May 16
1
branch cuts of atan()
Hi
the following gave me a shock:
> atan(2)
[1] 1.107149
> atan(2+0i)
[1] -0.4636476+0i
>
or, perhaps more of a gotcha:
> atan(1.0001+0i)
[1] -0.7853482+0i
> atan(0.9999+0i)
[1] 0.7853482+0i
>
evidently atan()'s branch cuts aren't where I thought they were.
Where do I look for documentation on this?
--
Robin Hankin
Uncertainty Analyst
National
2024 Sep 05
1
BUG: atan(1i) / 5 = NaN+Infi ?
> complex(real = 0, imaginary = Inf)
[1] 0+Infi
> Inf*1i
[1] NaN+Infi
>> complex(real = 0, imaginary = Inf)/5
[1] NaN+Infi
See the Note in ?complex for the explanation, I think. Duncan can correct
if I'm wrong.
-- Bert
On Thu, Sep 5, 2024 at 3:20?PM Leo Mada <leo.mada at syonic.eu> wrote:
> Dear Bert,
>
> These behave like real divisions/multiplications:
>
2000 Nov 26
2
References for the BARK/MEL stuff
Could someone point me to the BARK/MEL tables that these macros (from vorbis/scales.h) are trying to approximate?
#define toBARK(f) (13.1*atan(.00074*(f))+2.24*atan((f)*(f)*1.85e-8)+1e-4*(f))
#define fromBARK(z) (102.*(z)-2.*pow(z,2.)+.4*pow(z,3)+pow(1.46,z)-1.)
#define toMEL(f) (log(1.+(f)*.001)*1442.695)
#define fromMEL(m) (1000.*exp((m)/1442.695)-1000.)
I was wondering if I could come
2004 Jan 21
2
derivative of atan(x) and similar functions
Dear R experts.
'D()' function recognizes some of the analitical functions, such as
sin, cos, etc. But I'd like to take analytical derivatives from asin,
atan etc. functions. Are there any R packages providing that features?
Thanks.
--
Timur.
2024 Sep 05
1
BUG: atan(1i) / 5 = NaN+Infi ?
Dear Bert,
These behave like real divisions/multiplications:
complex(re=Inf, im = Inf) * 5
# Inf+Infi
complex(re=-Inf, im = Inf) * 5
# -Inf+Infi
The real division / multiplication should be faster and also is well behaved. I was expecting R to do the real division/multiplication on a complex number. Which R actually does for these very particular cases; but not when only Im(x) is Inf.
2008 May 27
5
Rotated text on a regression line
Dear all,
I stumbled over a problem recently when trying to use srt with text() on a
windows device.
What I intended to do was to plot a simple regression line, and to rotate
a piece of text such that the text has the same angle as the regression
line.
However, the text is always plotted in a slightly wrong angle:
####
x=1:10 #create arbitrary x and y values
y=x*2-rnorm(1:10)
2006 Mar 28
2
atan2(1,1i)
Hi
?atan2 says that atan2(y,x)=atan(y/x) for x and y numeric or complex
vectors.
Well, I would expect atan2(1,1i) to be equal to atan(-1i), but
> atan2(1,1i)
Error in atan2(y, x) : Non-numeric argument to mathematical function
> R.version
_
platform powerpc-apple-darwin8.5.0
arch powerpc
os darwin8.5.0
system powerpc, darwin8.5.0
2006 Mar 28
2
atan2(1,1i)
Hi
?atan2 says that atan2(y,x)=atan(y/x) for x and y numeric or complex
vectors.
Well, I would expect atan2(1,1i) to be equal to atan(-1i), but
> atan2(1,1i)
Error in atan2(y, x) : Non-numeric argument to mathematical function
> R.version
_
platform powerpc-apple-darwin8.5.0
arch powerpc
os darwin8.5.0
system powerpc, darwin8.5.0
2024 Sep 06
1
BUG: atan(1i) / 5 = NaN+Infi ?
On 2024-09-06 12:44 a.m., Richard O'Keefe wrote:
> I expect that atan(1i) = (0 + infinity i) and that atan(1i)/5 = (0 +
> infinity i)/5 = (0 + infinity i).
> Here's what I get in C:
> (0,1) = (0, 1)
> atan((0,1)) = (0, inf)
> atan((0,1))/5 = (0, inf)
>
> Note the difference between I*infinity = (0,1)*infinity =
> (0*infinity,1*infinity) = (NaN,infinity)
> and