Serving the Quantitative Finance Community

  • 1
  • 2
  • 3
  • 4
  • 5
  • 8
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Silly questions

March 25th, 2018, 8:12 pm

Can [$](1-x)(1+x)log((1+x)/(1-x)) [$] ever become unbounded? (not including the infinities).
 
User avatar
Alan
Posts: 2958
Joined: December 19th, 2001, 4:01 am
Location: California
Contact:

Re: Silly questions

March 25th, 2018, 9:36 pm

Can [$](1-x)(1+x)log((1+x)/(1-x)) [$] ever become unbounded? (not including the infinities).
I'd say it's a  bounded function for any real |x| <= 1 or indeed on any bounded domain for x.

But, it becomes an unbounded complex function on the real line or half-line
 
User avatar
Traden4Alpha
Posts: 3300
Joined: September 20th, 2002, 8:30 pm

Re: Silly questions

March 25th, 2018, 11:42 pm

for |x|>1, f is complex;
for |x|<1, f is real; and 
for |x|=1, f converges to 0 from both sides

Obviously, a sequential computation for x approaching either +1 or -1 might have unbounded intermediate terms but the full expression remains bounded.
 
User avatar
ppauper
Posts: 11729
Joined: November 15th, 2001, 1:29 pm

Re: Silly questions

March 26th, 2018, 8:21 am

it's bounded except at what you term the infinities at [$]|x|=\infty[$]

[$](1-x)(1+x)\ln\frac{1+x}{1-x}=(1-x)(1+x)\ln(1+x)-(1-x)(1+x)\ln(1-x)[$]

the only potential problem values would have been [$]x=\pm 1[$] and if you look at those 2 points, you see that  they are not in fact problems because the factors (1+x) and (1-x) out front kill any bad behavior from the logarithm

as [$]x\to 1[$] it tends to [$]-2(1-x)\ln(1-x)\to 0[$] 
as [$]x\to -1[$] it tends to [$]2(1+x)\ln(1+x)\to 0[$] 
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Silly questions

March 26th, 2018, 12:04 pm

it's bounded except at what you term the infinities at [$]|x|=\infty[$]

[$](1-x)(1+x)\ln\frac{1+x}{1-x}=(1-x)(1+x)\ln(1+x)-(1-x)(1+x)\ln(1-x)[$]

the only potential problem values would have been [$]x=\pm 1[$] and if you look at those 2 points, you see that  they are not in fact problems because the factors (1+x) and (1-x) out front kill any bad behavior from the logarithm

as [$]x\to 1[$] it tends to [$]-2(1-x)\ln(1-x)\to 0[$] 
as [$]x\to -1[$] it tends to [$]2(1+x)\ln(1+x)\to 0[$] 
Very good. I think it can in general be boiled down to

[$]\displaystyle\lim_{x\to0} x^k log(x) = 0[$] for [$]k = 1,2,3,..[$].

The background to my problem was transforming the real line to [$](-1,1)[$] by [$]y = tanh(x)[$] for a PDE(x) to PDE(y) and you want the transformed coefficients to be bounded.
//
BTW it seems that [$](1/2)\log\frac{1+x}{1-x}[$] is called the Fisher z-transform.
 
User avatar
Paul
Posts: 6604
Joined: July 20th, 2001, 3:28 pm

Re: Silly questions

March 26th, 2018, 2:47 pm

This is the sort of post that gives a mathsy website a bad reputation, not stories about Donald Trump.
 
User avatar
Traden4Alpha
Posts: 3300
Joined: September 20th, 2002, 8:30 pm

Re: Silly questions

March 26th, 2018, 3:13 pm

We all know Donald Trump is unbounded on both the real and fake number systems.
 
User avatar
Paul
Posts: 6604
Joined: July 20th, 2001, 3:28 pm

Re: Silly questions

March 26th, 2018, 3:32 pm

You’ve saved the thread!
 
User avatar
Traden4Alpha
Posts: 3300
Joined: September 20th, 2002, 8:30 pm

Re: Silly questions

March 26th, 2018, 3:36 pm

Well, I'd hate for this site to be branded as suspicious for having lots of terrorizing al' gebra, al' gorithms, and references to Osama bin Ary
 
User avatar
ppauper
Posts: 11729
Joined: November 15th, 2001, 1:29 pm

Re: Silly questions

March 27th, 2018, 1:30 pm

I think it can in general be boiled down to

[$]\displaystyle\lim_{x\to0} x^k log(x) = 0[$] for [$]k = 1,2,3,..[$].
that's true for all [$]k>0[$], not just for integers, so e.g. [$]\displaystyle\lim_{x\to0} x^{1/2} log(x) = 0[$]
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Silly questions

March 28th, 2018, 9:10 am

This is the sort of post that gives a mathsy website a bad reputation, not stories about Donald Trump.
There's only one thing worse than talking about maths, and that's not talking about it. It will last longer than Donald Trump who will be vote out in 2 years.
 
User avatar
Cuchulainn
Topic Author
Posts: 20254
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Silly questions

April 17th, 2018, 4:07 pm

It's silly question time again and today's silly question is:

Consider the continuous 'hat' function

 [$]f(x) = 2x, 0 \leq x \leq 1/2; [$] [$]f(x) = 2(1-x), 1/2 \leq x \leq 1[$].

I want to approximate [$]f(x)[$] to any accuracy by (ideally) an infinitely differentiable function. An analytical and easily computable solution is desired. Ideally, the approximation should be in continuous space; failing that, a discrete approximation might be OK.

// Some Wilmotters might remember a similar question a while back ..(the one with the Jack Nicholson avatar).
 
User avatar
ppauper
Posts: 11729
Joined: November 15th, 2001, 1:29 pm

Re: Silly questions

April 17th, 2018, 8:25 pm

approximate on what interval?
[0,1] you could use a fourier series 
or stretch it to [-1,1] and use chebyshev
 
User avatar
outrun
Posts: 4573
Joined: January 1st, 1970, 12:00 am

Re: Silly questions

April 17th, 2018, 8:42 pm

(edit ppauper and I cross posted, I was also thinking about Chebyshev)
---
 
I tried a Chebyshev approximation (which is infinitely differentiable since it's a sum of (orthogonal) polynomials), but it doesn't converge very fast. I bet that'll be a general issue with geneneric (popular) polynomial basis because of the discontinuity of the derivative at the peak on one hand and you wanting  infinitely differentiability at the other hand.
import numpy as np
import matplotlib.pyplot as plt


x = np.linspace(-1, 1, 2000)

# hat function
y = 1 - abs(x)

p = np.polynomial.Chebyshev.fit(x, y, 128, domain=(-1,1))

plt.plot(x, y, 'r.')
plt.plot(x, p(x), 'k', lw=2)
plt.title('fit')
plt.show()

plt.plot(x, p(x) - y, 'k', lw=2)
plt.title('error')
plt.show()

plt.semilogy(np.abs(p.coef),'*')
plt.title('maginitude coefficients')
plt.show()
Image
Image
Image


Perhaps cutting off the top -just a tiny bit- and replacing it with a spline that matches derivatives left and right will be a good approximation, and infinitely differentiable?
 
User avatar
ppauper
Posts: 11729
Joined: November 15th, 2001, 1:29 pm

Re: Silly questions

April 17th, 2018, 10:22 pm

the fourier series is
[$]\sum_{m=1}^{\infty}\frac{8}{m^2\pi^2}\sin\frac{m\pi}{2}\sin m\pi x[$]