Boost logo

Boost :

From: Deane Yang (deane_yang_at_[hidden])
Date: 2005-10-11 20:28:34


The application is to Brownian motion (which of course originated in
physics!), which, to oversimplify, can be viewed as a time-dependent
Gaussian distribution whose variance grows linearly with time and
therefore its standard deviation grows proportionally to the square root
of time. The proportionality constant in the standard deviation is
called the volatility, and the units for volatility are the units for
the standard deviation (think of that as a spatial dimension) divided by
the square root of time.

To take another tack, Brownian motion is closely related to the heat
equation (again, a physical thing)

u_t = (v^2/2)u_xx,

where v is a constant measuring how well heat conducts in the material
(I'll let the physicists make this more precise). The quantity v is the
volatility.

You could say that we should be working with v^2 and not v itself, and I
won't disagree. But I have to live with common usage and convention.

As for why Brownian motion matters in finance, I'm going to plead
"off-topic" here, but you could try to look for explanations of the
Black-Scholes formula. (Terence Tao at math.ucla.edu has a terrific but
very terse explanation)

So indeed, things like (time_duration)^(-1/2) do arise and are needed.
Sorry. Your hopes were entirely reasonable, but fractional powers of
fundamental units are really needed.

But couldn't this be done rather nicely using the MPL map type, using a
compile-time rational number type? I'm not exactly sure how to contruct
the derived unit type from the unit types of two factors, but I bet it
could be done most easily using this approach.

Matt Calabrese wrote:
> On 10/11/05, Deane Yang <deane_yang_at_[hidden]> wrote:
>
>> What I'm more interested in learning is how you handle "composite
>> quantities", which are obtained by multiplying and dividing existing
>> units (like "meters/second"), as well as raising to a rational power
>> (like the standard unit of volatility in finance, "1/square_root(years)".
>>
>>
> Rational powers are handled with power functions and metafunctions, as I
> showed in later replies. However, I would like much more information
> regarding "volatility in finance." Up until now, I have seen absolutely no
> cases where non-derived unit classifications raised to a non-integer powers
> makes sense and have even talked about such situations with mathematicians.
> Looking back to the archives, I see people talking about fractional-powered
> base units being possible and speak of examples from other threads, but I
> can't seem to find such examples. An exact link would be very helpful. Right
> now I support fractional powers, but not when the operation yields
> fractional-powered base units. For instance, I allow the expression
>
> power< 1, 2 >( your_meters_quantity * your_meters_quantity )
> // where power< 1,2 > denotes a power of 1/2
>
> However, I have chosen to disallow:
>
> power< 1, 2 >( your_meters )
>
> since it does not seem to ever make sense -- for any base classification
> type, not just length. In an attempt to rationalize why this was the case, I
> noticed that a base classification raised to a power could be looked at as a
> hyper-volume in N-dimensional space, where N is the value of the exponent.
> Continuing with "length" as an example, your_meters^2 represents a
> hyper-volume in 2 dimensional space (area), and your_meters^3 represents a
> hyper-volume in 3 dimensional space (volume), and your_meters^-3 could be
> looked at as units per volume, etc. This model makes sense for all integer
> powers, yet not for rational powers for base units, as it would imply a
> concept of fractions of a dimension, which intuitively I do not believe
> exist, though I am admittedly not a mathematician and my model could be too
> specific.
>
> Keep in mind that rational powered derived-classifications are still
> perfectly fine, just so long as the resultant unit type does not have
> fractional powered base units in its make-up. Considering you apparently
> have an example where fractional-powered years is used (years being a base
> unit of time), I suppose my logic could be flawed, though I haven't heard of
> your example and googling around doesn't appear to be helping either. If you
> can, would you link to information regarding such fractional-powered base
> classifications? It's easy to go back and allow them in my library, as my
> restriction is mostly just superficial, but I won't do so until I see a
> place in practice where such operations actually make sense.
>
> Thanks in advance.
>
> --
> -Matt Calabrese
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk