From: <jensaxel@so...>  20030430 18:38:04

Noel Welsh: > Ewwww that code is old. :) > Anyway, here's the straight dope as I remember it: > makediscreterandomvariable creates a random > variable that generates values from a finite set > (maybe it ain't a random variable then  I'm not > sure on the terminology). So > > (makediscreterandomvariable > '((a . 0.1) (b . 0.6) (c . 0.3))) > returns a rv that generates values from the set > {'a, 'b, 'c} with the probabilities given above. > The only export is makediscreterandomvariable Ok, the argument is simply the distribution function represented as an association list. > makegraphrandomvariable makes a discrete random > variable where the output is determined by > following a graph of discrete random variables (so > its really a markov chain). You can either sample > from graph or trace the path through the graph. I > think the concepts are a bit muddled up here. Do you know a reference to a definition? I don't think graphs of random variables was covered in the probality course I had [although I vaguely remember calculating eigenvalues for some Markov matrices]. > constantprocess is a "random" variable that > always returns the same value. Ok. > Dirac delta function I guess. The Dirac delta function is "infinity" in one point and zero elsewhere. Well, actually it's not a function at all, but a so called distributiun [the set of distributions is a extension of the space of functions], but that doesn't bother physists. (I can't blame Dirac, the theory of distributions was initiated by his work, if I remember correctly]. > treeprocess....hmmm....I think this was a hack I > created to test a decision tree algorithm. I > think it generates data from a noisy decision > tree. I don't think its generally useful. Ok. > BTW, info.txt is really nice. Thanks  speak up if you find spelling errors and the like (english is not my native tongue). After writing the documentation, I accidently fell over "SRFI 27: Sources of Random Bits", which is very well written. The basic generator of random bits in SRFI 27 is better (but slower) than the one from Numerical Recipes. I think I'll port it this summer, and then use it to rewrite some of the functions. <http://srfi.schemers.org/srfi27/>;  Jens Axel Søgaard  Jens Axel Søgaard 
From: Noel Welsh <noelwelsh@ya...>  20030501 17:30:00

 Jens_Axel_Søgaard <jensaxel@...> wrote: > Ok, the argument is simply the distribution function > represented as an association list. Yes. > Do you know a reference to a definition? I don't > think graphs of random variables was covered in the > probality course I had [although I vaguely remember > calculating eigenvalues for some Markov matrices]. There is always MathWorld: http://mathworld.wolfram.com/MarkovChain.html http://mathworld.wolfram.com/MarkovProcess.html I think its a Markov Process, not a Chain. Ian can speak up if he thinks I'm telling lies (don't tell anyone but he's actually a trained mathematician ;) > The Dirac delta function is "infinity" in one point > and zero elsewhere. Well, actually it's not a > function > at all, but a so called distributiun [the set of > distributions is a extension of the space of > functions], > but that doesn't bother physists. (I can't blame > Dirac, > the theory of distributions was initiated by his > work, if I remember correctly]. I'll take your word for this. ;) > Thanks  speak up if you find spelling errors and > the like (english is not my native tongue). Will do. > After writing the documentation, I accidently fell > over > "SRFI 27: Sources of Random Bits", ... > I think I'll port it this summer, and then use it to > rewrite > some of the functions. This would be nice as we don't currently have a port. Francisco's the man for this stuff. cya, Noel ===== Email: noelwelsh <at> yahoo <dot> com Jabber: noelw <at> jabber <dot> org __________________________________ Do you Yahoo!? The New Yahoo! Search  Faster. Easier. Bingo. http://search.yahoo.com 
From: Ian Glover <ian@ma...>  20030501 18:48:31

> I think its a Markov Process, not a Chain. Ian can > speak up if he thinks I'm telling lies Well if I remember rightly a Markov Chain is a set of observations from a= =20 Markov Process, so I guessed you say that the graph is a representation o= f=20 the process and a path is a chain. > (don't tell anyone but he's actually a trained mathematician ;) > Drat, my secret is out. So I'll be doubly embarassed when someone rips th= e=20 above to pieces. :> 
From: <jensaxel@so...>  20030509 02:12:03
Attachments:
27.ss
conftest.scm

Noel Welsh wrote: >Jens Axel Søgaard wrote: >> After writing the documentation, I accidently fell >> over >> "SRFI 27: Sources of Random Bits", ... >> I think I'll port it this summer, and then use it to >> rewrite some of the functions. > > This would be nice as we don't currently have a port. > Francisco's the man for this stuff. I did it today (I needed it for Sebastian's code. It turns out that it was very easy to port the Scheme reference implementation of srfi27. Sebastian has indeed made a very good job of srfi27. Sebastian has also provided a Cimplementation of the generator, and I'm sure it would provide substantial speed improvements if somebody volunteers to port it. The srfi makes room for different sources of random numbers, so I thought I'd allow the user to use the builtin random generator (I couldn't find documentation on the algorithm used), but I couldn't figure out how to retrieve the current state, so I dropped the idea again. I am however planning to turn the Schemathics dev/random support into another random source.  Jens Axel Søgaard 
From: MJ Ray <markj@cl...>  20030502 13:29:00

=?iso88591?Q?Jens_Axel_S=F8gaard?= <jensaxel@...> wrote: > at all, but a so called distributiun [the set of > distributions is a extension of the space of functions], Do you mean distributions? I would have thought that the set of distributions was a restriction of the space of functions, because of the requirements for them to have certain properties. ICBW: it's been far too long.  MJR http://mjr.towers.org.uk/ IM: slef@... This is my home web site. This for Jabber Messaging. How's my writing? Let me know via any of my contact details. 
From: <jensaxel@so...>  20030502 22:15:27

MJ Ray wrote: >Jens_Axel_Søgaard <jensaxel@...> wrote: > > >>at all, but a so called distributiun [the set of >>distributions is a extension of the space of functions], >> >> > >Do you mean distributions? > Yes, but by distributions (also called generalized functions) I do not mean functions given by the distribution of a random variable. The relationship between functions and distribution are somewhat similar to the relationship between the reals R and the complex numbers C. During the process of solving an eqution of degree three, one can use numbers from C as temporary results, and in the end get a solution from R [which historically led to the discovery of C]. Thus some problems concerning real numbers is easier to solve, if one sees R as a subset if the larger space C. In physics Dirac needed a function with the properties 1. f(x) = 0 when x <> 0 2. integral f(x) from oo to oo = 1 The equation 2. is not solvable in the space of real functions of one variable, since the integral of function does not depend on the value of f in any specific point. Nevertheless Dirac made calculations with a function named delta that satisfied equation 2, and got correct results (in the space of real functions of a real variabel). The idea is now to embed the set of functions in a larger space, where thus equation has a solution. The definition of distributions and a lenghty discussion can be found at MathWorld. <http://mathworld.wolfram.com/GeneralizedFunction.html>; The short version is: Generalized functions [a.ka.distributions] are defined as continuous linear functionals <http://mathworld.wolfram.com/Functional.html>; over a space <http://mathworld.wolfram.com/Space.html>; of infinitely differentiable functions such that all continuous functions have derivatives which are themselves generalized functions. One clever thing (if I remember correctly) is that the differential operator can be extended to the entire space of distribution s.t. you (if you calculate in the space of distributions) suddenly can differentiate more functions than you used to. Hmm. This got pretty long, but I couldn't help my self.  Jens Axel Søgaard 
From: MJ Ray <markj@cl...>  20030505 09:47:23

=?ISO88591?Q?Jens_Axel_S=F8gaard?= <jensaxel@...> wrote: > Yes, but by distributions (also called generalized functions) I do not mean > functions given by the distribution of a random variable. Why do physicists insist on corrupting mathematical language? > In physics Dirac needed a function with the properties > 1. f(x) = 0 when x <> 0 > 2. integral f(x) from oo to oo = 1 Why is any function so defined integrable? It seems to be discontinuous. If you go beyond real functions, then playing with the limits of 2 gives the desired result, but is that the same as what is written above? You could assume that such a function exists, but then you're just playing with the axioms, aren't you?  MJR http://mjr.towers.org.uk/ IM: slef@... This is my home web site. This for Jabber Messaging. How's my writing? Let me know via any of my contact details. 
From: <jensaxel@so...>  20030506 17:51:07

MJ Ray wrote: >Jens_Axel_S=F8gaard?= <jensaxel@...> wrote: > > >>Yes, but by distributions (also called generalized functions) I do not mean >>functions given by the distribution of a random variable. >> >> > >Why do physicists insist on corrupting mathematical language? > > > >>In physics Dirac needed a function with the properties >> 1. f(x) = 0 when x <> 0 >> 2. integral f(x) from oo to oo = 1 >> >> > >Why is any function so defined integrable? It seems to be discontinuous. > Suppose g is defined as g(x) = 0, if x<>0 g(x) = 1, if x=0 Then g is a discontionous functions, which is 0 almost every where. As Ian explains in mathematical analysis one extends the Riemann Integral to the Lebegue Integral[1], which is defined even for some discontinous functions. However, the integral of g is still equal to the area between the graph of g and the xaxis no matter what integral you use. This means that 1. integral g(x) from oo to oo = area under graph = 0 is satisfied. If one changes the value g(0) to something other than 1, the value of the integral will not change. Let's try and interpret 2. in terms of the area under the graph. If the area under the graph of g should become 1, but g is only different from 0 at one point, it must mean that the value g(0) *have* to be "infinity". So much infinity that the area becomes 1. Now the above paragraph does not make mathematical sense, but that's how Dirac was thinking. The problem is that g(x) = 0, if x<>0 g(x) = "infinity", if x=1 is not a function from R to R. And what is this "infinity"? >If you go beyond real functions, then playing with the limits of 2 gives >the desired result, but is that the same as what is written above? > >You could assume that such a function exists, but then you're just >playing with the axioms, aren't you? > It's worse, one can prove that no function from R to R can satisfy both 1. and 2. at the same time. Thus if one needs "something" that satisfies both 1. and 2. at the same time, one needs to generalise the notion of functions to a larger space, wherein an element exists, that satisfies the interpretation of 1. and 2. in the new space.  Jens Axel Søgaard 
From: Ian Glover <ian@ma...>  20030505 10:49:08

On Monday 05 May 2003 09:48, MJ Ray wrote: > =3D?ISO88591?Q?Jens_Axel_S=3DF8gaard?=3D <jensaxel@...> wrot= e: > > Yes, but by distributions (also called generalized functions) I do no= t > > mean functions given by the distribution of a random variable. > > Why do physicists insist on corrupting mathematical language? > I don't think you can really blame physicists, my impression is that=20 Mathematicians picked up on Dirac's idea, generalized and needed a name. = (And=20 after all the Dirac delta is a statistical distribution). > > In physics Dirac needed a function with the properties > > 1. f(x) =3D 0 when x <> 0 > > 2. integral f(x) from oo to oo =3D 1 > > Why is any function so defined integrable? It seems to be discontinuou= s. Bad answer: Because it's defined to be integrable! Better: Discontinuity is no bar on integrability [ f(x) =3D 1 for 0 < x <= 1,=20 f(x) =3D 0 otherwise, is integrable and discontinous, rather less obvious= ly=20 g(x) =3D 1 for x where irrational between 0 and 1, g(x) =3D 0 otherwise i= s also=20 integrable] > > If you go beyond real functions, then playing with the limits of 2 give= s > the desired result, but is that the same as what is written above? > > You could assume that such a function exists, but then you're just > playing with the axioms, aren't you? But then that is maths in a nutshell, "assume this and what interesting t= hings=20 drop out." Though for delta (I'm fairly sure that) you can assume more=20 fundamental things and it's existence, integrability etc. drops out. 
From: MJ Ray <markj@cl...>  20030505 22:18:31

Ian Glover <ian@...> wrote: > (And after all the Dirac delta is a statistical distribution). I thought so too, so I'm confused why these functions aren't a subset of all functions. > Better: Discontinuity is no bar on integrability [ f(x) =3D 1 for 0 < x <= Indeed, but for this function to give the desired result, isn't it either continuous in an area around 0 or doesn't exist as a function? > But then that is maths in a nutshell, "assume this and what interesting > things drop out." Only certain classes of pure mathematicians consider axioms toys. MJR 
From: <jensaxel@so...>  20030506 17:57:17

Ian Glover wrote: >On Monday 05 May 2003 09:48, MJ Ray wrote: > > >>=?ISO88591?Q?Jens_Axel_S=F8gaard?= <jensaxel@...> wrote: >> >> >>>Yes, but by distributions (also called generalized functions) I do not >>>mean functions given by the distribution of a random variable. >>> >>> >>Why do physicists insist on corrupting mathematical language? >> >> >> >I don't think you can really blame physicists, my impression is that >Mathematicians picked up on Dirac's idea, generalized and needed a name. > That's my impression too. They saw that the method of calculation gave valied results and wanted to make the mathematics involved riogorous. >(And after all the Dirac delta is a statistical distribution). > > I'm not quite sure that's right  a statistical distribution is still a function (isn't it?). >>If you go beyond real functions, then playing with the limits of 2 gives >>the desired result, but is that the same as what is written above? >> >>You could assume that such a function exists, but then you're just >>playing with the axioms, aren't you? >> >> > >But then that is maths in a nutshell, "assume this and what interesting things >drop out." Though for delta (I'm fairly sure that) you can assume more >fundamental things and it's existence, integrability etc. drops out. > > It's not just playing with axioms. You can make intermediate (ary?) calculations involving delta, and in the end all the deltas cancel out, and you are left with an ordinary function as a result. One can use this to study certain kinds of differential equations.  Jens Axel Søgaard 
From: Ian Glover <ian@ma...>  20030506 18:39:36

On Tuesday 06 May 2003 17:53, Jens Axel S=F8gaard wrote: > >(And after all the Dirac delta is a statistical distribution). > > I'm not quite sure that's right  a statistical distribution is still a > function (isn't it?). Probably not quite expressed correctly, I think I should have said the de= lta=20 measure is statistical distribution. The idea being that continuous=20 probabilities are defined better by measures than functions. The uniform=20 distribution f(x) =3D 1 for 0 < x < 1, the actual value of the function a= t=20 point isn't really statistical meaningful only it's integral over subsets= of=20 R is  just like the values of delta(x) aren't always meaningful but the=20 integrals are. > >But then that is maths in a nutshell, "assume this and what interestin= g > > things drop out." Though for delta (I'm fairly sure that) you can ass= ume > > more fundamental things and it's existence, integrability etc. drops = out. > > It's not just playing with axioms. You can make intermediate (ary?) > calculations involving delta, > and in the end all the deltas cancel out, and you are left with an > ordinary function as a result. > One can use this to study certain kinds of differential equations. Agreed. 
From: Ian Glover <ian@ma...>  20030506 08:31:10

On Monday 05 May 2003 22:19, MJ Ray wrote: > Ian Glover <ian@...> wrote: > > (And after all the Dirac delta is a statistical distribution). > > I thought so too, so I'm confused why these functions aren't a subset > of all functions. [Disclaimer  I haven't come across generalized functions before as such = and=20 my brain melted half way through the Mathworld page, but this I think wha= t's=20 going on.] There are (at least) two types of integration. For most things (like=20 functions) that you meet the simple version, Riemann integrals works and = does=20 everything you'd expect. This is what is you'll find in most books on=20 Calculus (add up lots of distinct rectangles, take the limit). However=20 mathematicians being perverse beasts (no offence intended to watching=20 mathematicians!) there are more general versions.=20 The most common of the nasty integrations is Lebesque integration which i= s=20 based on measure theory and it what's needed to integrate things like del= ta=20 or that horrible example I gave that's 1 on irrational's and 0 on rationa= ls.=20 [This is were I start getting ropey.] The basic idea is a "measure" which= =20 maps subsets of the space being integrated over to values. A measure, P, = is a=20 probability measure if it maps to the reals and that the measure of the=20 entire domain is 1. If you define a probability measure D on the reals such that D(S) =3D 1 i= f 0 is=20 in S, and D(S) =3D 0 otherwise, then this is perfectly well defined. The = dirac=20 delta is what you get if you try to view this as a functions from reals t= o=20 reals rather than from sets of reals to reals. Integration is then defined by combining functions and a measure. (I can'= t=20 immediately come up with a good example.) Since integration can only happ= en=20 over subsets of spaces this all hangs together. Generalized functions consist of functions and measures.=20 After all that: Why isn't delta a function? I suspect because it's value at zero is not=20 defined. However it's properties if it's viewed as a measure are defined = and=20 since functions are integrable delta has to be view as something more=20 general. Hope that makes some sort of sense. > > > Better: Discontinuity is no bar on integrability [ f(x) =3D3D 1 for 0= < x > > <=3D > > Indeed, but for this function to give the desired result, isn't it eith= er > continuous in an area around 0 or doesn't exist as a function? > > > But then that is maths in a nutshell, "assume this and what interesti= ng > > things drop out." > > Only certain classes of pure mathematicians consider axioms toys. > Hmmm, not sure about that. I'd say most mathematicians and physicists are= =20 guilty (though in Physics it's usually viewed as simplification to make t= he=20 problem solvable). 
From: <jensaxel@so...>  20030506 18:11:45

Ian Glover wrote: >On Monday 05 May 2003 22:19, MJ Ray wrote: > > >>Ian Glover <ian@...> wrote: >> >> >>>(And after all the Dirac delta is a statistical distribution). >>> >>> >>I thought so too, so I'm confused why these functions aren't a subset >>of all functions. >> >> > >[Disclaimer  I haven't come across generalized functions before as such and >my brain melted half way through the Mathworld page, but this I think what's >going on.] > I agree that the MathWorld page makes a lot more sense if you know the stuff already. There are no attempt to explain the motivation behind. [good explanation about the existance of severeal methids of integration] >Generalized functions consist of functions and measures. > > I'm not quite sure it's that simple.  Jens Axel Søgaard 
From: Ian Glover <ian@ma...>  20030506 18:39:50

On Tuesday 06 May 2003 18:00, Jens Axel S=F8gaard wrote: > >Generalized functions consist of functions and measures. > > I'm not quite sure it's that simple. It never is! But I don't know any better, so I will bow before your super= ior=20 knowledge. :> 
From: <jensaxel@so...>  20030506 18:53:26

Ian Glover wrote: >On Tuesday 06 May 2003 18:00, Jens Axel Søgaard wrote: > > >>>Generalized functions consist of functions and measures. >>> >>> >>I'm not quite sure it's that simple. >> >> > >It never is! But I don't know any better, so I will bow before your superior >knowledge. :> > Uh. I don't want the ball. I think there's more than one way to generalize functions. How on earth did I end up discussing math this advanced at a Scheme mailing list? I like Schemers :) (and math  obviously).  Jens Axel Søgaard 
From: MJ Ray <markj@cl...>  20030510 00:29:25

=?ISO88591?Q?Jens_Axel_S=F8gaard?= <jensaxel@...> wrote: > How on earth did I end up discussing math this advanced at a Scheme > mailing list? I am currently in hiding. When people starting talking about measures, I assume that the pure mathematicians are coming to get me. MJR, fugitive from his analysis courses 