Req: Can this eqn be expressed in Std Nomo Form?

Mathematics about graphical computing
Glen
Posts: 67
Joined: Fri Jan 25, 2008 4:11 am
Location: Australia

Re: Req: Can this eqn be expressed in Std Nomo Form?

Postby Glen » Fri Dec 14, 2012 2:40 pm

[This got posted early accidentally and ended up with some stray lines. I deleted the mangled text and reposted below. If I figure out how to delete this, I will.]
Last edited by Glen on Fri Dec 14, 2012 8:38 pm, edited 3 times in total.
Glen
Posts: 67
Joined: Fri Jan 25, 2008 4:11 am
Location: Australia

Re: Req: Can this eqn be expressed in Std Nomo Form?

Postby Glen » Fri Dec 14, 2012 2:43 pm

> Is it possible to use PyNomo to draft compound curved nomograms of this type?

If you take a look at this document: http://www.myreckonings.com/pynomo/Crea ... Pynomo.pdf

and check out p56, 63, 66, 72, it definitely looks like single-curved-scale nomograms and compound nomograpms can both be done; I believe they can both be done together, but I haven't done one in it.

> I haven't tried to get into curved scale nomograms yet, but this sounds a really elegant solution to my problem; and would look way cooler than grids or contours...

There are advantages and disadvantages to both approaches. The advantage of a grid is that you only have to draw a single line when using it. The prime disadvantage is perhaps that they're usually a bit harder to use with accuracy than ordinary three-scale nomograms.

> How on earth did you work that out ?!

[Edited for additional detail]

It was just a bit of fiddling with the algebra, trying a few things (and having a sense of what can be done with curved scales).

It looked to me like it might be possible.

I pulled off t and v to one side, since they separated easily:

t/v = (u/w) * (1 - (w - u)/2)

so I could split it up by introducing a variable (I'm not the first to spot that):

t/v = y; y = (u/w) * (1 - (w - u)/2)

It was then a matter of trying to work out whether the equation in u and w could be written as a determinant. I played with the algebra for a while. I did it in notepad (yes, sounds weird I know) and I still have enough of what I did to reconstruct most of the sequence of steps in rough form:

I first simplified it and tried to write it in terms of u/w and w/2 - by writing (w-u)/2 as u/2 (w/u - 1). That yielded a fairly simple form, but writing it with a combined u/w term meant that there wasn't much flexibility to play with it (you need to separate the variables), though it did suggest working with 1/w or something like it.

So I then started playing with 2/w instead of w/2 and then tried writing m = 2/w and n = u/2, so that u/w = mn.

After simplifying the result, that led to a nice looking form in m and n: y = mn - n + mn^2

I then played with a functional form that corresponds to a one-curved-scale nomogram (e.g. it can do h(z) = f1(x) + g(y) f2(x) ... (2) )and (after a bit more fiddling with the function in terms of m and n) I equated the pieces, and then played with the determinantal form for that equation, and identified q from that.

> Please could you recommend a good reference or two to get me started on understanding this technique (I've got a rapidly growing library of old nomography books, but not sure which gives the best introduction to this topic for a beginner).

There are a number of good books that discuss them;

I have a book (Hall, "Construction of Graphs and Charts", IIRC) that was quite useful when I was first learning curved scales; hopefully I'll dig it up, but I can't find it now. [Edit: found it. It has a number of exercises and general discussion relating to curved nomograms, but all of the illustrated examples end up as straight lines. Nevertheless it was a big help to me early on.]

If I recall correctly, Brodetsky's book has some stuff on it too.

Davis' books have a little on them

Otto's book is very good on curved scales.

There are several others that were of help when I was learning curved scales but I don't recall them all.

[Finally, I've just done a lot of playing with algebra using curved scales because of a long-term project I am working on for fairly-automatically going from a large set of (x,y,z) triples (i.e. plain "data", rather than functional relationships) to an approximating nomogram. In figuring out how to do it on problems where I know the relationship, I've had some practice, off and on, at playing with the algebra. The project is a lot of fun; when its at a point where I can break it into simple steps and explain it simply (and when I can hide some of the more technical stuff away so people can get results without spending as much time as I have learning how to do it) I'll write something that shows how to do it for simple problems* to increasingly more general problems; I'm working on the one-curved scale case now, and I believe I can do two and even three curved scales. Ultimately I want to be able to do grid-nomograms this way as well -- but it takes a long time to make progress because I can be a bit dense and there's not really anyone I know who I can to talk to about it. I work on it a while, get a little further, and then put it aside to come back to later. Dealing with all the issues it throws up involves reading papers from a whole bunch of different areas of research, some quite recent, some going back many decades. There are so many things I understand about 90% of what I need to be able to get it working. I wish I was just a tiny bit smarter, it would make it easier.]

* (I have the three-parallel scale case pretty much sorted, several different ways, though I just made some progress on yet another way to do it that looks like it might work more nicely than what I have been doing up to now. I mostly work on it in the package R - that saves effort because a lot of the fitting functionality that I need is already available in packages people have written for it - but in some cases learning how to use them isn't trivial. I'm trying to build up some examples of problems to show how to do it. Finding a bunch of suitable data sets - preferably low-noise - to work on would help.)
Last edited by Glen on Mon Dec 17, 2012 12:08 am, edited 1 time in total.
NomoDave
Posts: 10
Joined: Wed Oct 05, 2011 2:36 pm

Re: Req: Can this eqn be expressed in Std Nomo Form?

Postby NomoDave » Sun Dec 16, 2012 11:12 am

Many thanks for your explanation and references Glen

It sounds like you are a lot further down the road to mastering this nomogram lark than I am!
I'm really impressed by your math skills and ability to visualise the required solution.

I've successfully drafted various types of compound nomograms using PyNomo, but haven't experimented with curved axes before.
I've got a scanned copy of Brodetsky somewhere. Not familiar with Hall, Davis & Otto.
Will also have a look at "R" - sounds as though it is really useful for calculating the curve-fitting equations to make into determinant form for PyNomo...

Will do some reading and have another bash. :wink:

Thanks again

Dave
jasonwalker
Posts: 27
Joined: Sun Sep 11, 2011 3:54 pm

Re: Req: Can this eqn be expressed in Std Nomo Form?

Postby jasonwalker » Sun Dec 16, 2012 10:56 pm

dave, you need to check your e-mails!

:wink:
Glen
Posts: 67
Joined: Fri Jan 25, 2008 4:11 am
Location: Australia

Re: Req: Can this eqn be expressed in Std Nomo Form?

Postby Glen » Mon Dec 17, 2012 12:50 am

Looking at my own explanation for what I did again, I notice that the RHS of y = mn - n + mn^2 can be split up in two ways -

(1) ... (n^2+n) m - n

OR

(2) ... (m-1)n + mn^2

Both can be put into a determinant; both yield a straight scale for m (and hence for w) and a curved scale for n (and hence for u)
(and presumably there's a way to make the second one work with the other N chart)

I assume these are obtainable from each other by simple manipulation of the determinant, but I thought I'd mention it in case the one I used turns out to be less suitable for some reason - maybe the second one might just help

NomoDave: R is basically a full-blown free stats package/programming language (cran.r-project.org). It's very widely used among academic statisticians, so as new statistical work is published there's often a package from R produced around the same time. There has been a bunch of work to try to approximate relationships in various ways that are relevant to nomograms. Two of the packages I play with for R are *acepack* and *assist*. The two main functions in *acepack* (ace and avas) help when looking at data of the form z = F(x,y) + noise - they attempt to produce a monotonic transformation of z that makes the relationship approximately additive h(z) ~= f(x) + g(y) (three parallel scales). Whether the result is suitable for nomographic use depends on whether the resulting noise+lack-of-fit is small enough to tolerate across the range. The *assist* package is useful for fitting functions that correspond to curved-scale nomograms (there are examples in documentation associated with it where it fits functions that correspond to one-curved scale z = f1(x) + g(y). f2(x); I believe it should be possible to do two-curved-scales with it but haven't managed to get that far).

However, it doesn't find transforms for the z (the relevant functions in it are nnr and snr; it's significantly more complicated to use than *acepack*).

Ultimately I'd like to combine the ideas from the papers relating to both to find a transformation of z *simultaneously* with at least the one-curved scale case (there are a lot of problems where h(z) = f(x) + g(y). ϕ(x) gives a darn close approximation). But my feeble brain has to fill in a lot of detail first [step 1 is just having those already existing functions done on a few nice cases that I can write up as examples]. Hastie and Tibshirani (in *Generalized Additive Models*) mention using Generalized Box-Cox as an alternative to ACE in finding transformations of z (I already use ordinary Box-Cox transformation a fair bit since they're ideally suited to playing with a lot of nomograms); I've got the papers relating to that approach that they mention but to my knowledge there aren't R-packages for exactly that (there are some related packages like *cobs* that might do) -- so I might ultimately have to do some work there if I want to get that working; that approach to identifying transformation seems as if it might fit with the assist package. I also wonder whether Mike Smith's approach using MCMC to identify transformations (he did ordinary Box-Cox) combined with additive regression might be easier to scale up to this problem.
jasonwalker
Posts: 27
Joined: Sun Sep 11, 2011 3:54 pm

Re: Req: Can this eqn be expressed in Std Nomo Form?

Postby jasonwalker » Tue Dec 18, 2012 2:13 pm

I've plumbed all this into Pynomo and the result is below. Glen, I've swapped the first two columns of the determinant around to make the axes vertical and I've put in the actual names of the variables. (Bit of an explanation: PaO2 is measured oxygen in your blood, FiO2 is the level of oxygen you breath in. This calculates the change in blood oxygen following a change in inhaled oxygen). Join w to u and mark where it crosses y; join this to v and read off t.

It's a bit untidy - it needs a couple of isopleths and the titles need moving. I'd like to think that I could transform w to come down the page a bit, but I'm afraid that u would then crash the other axes.

u doesn't look very curved after all.

Jason

PS Apols all round. Did this last week (sent it be email to NomoDave, but it may have gotten lost) but hadn't put it up here as I wanted to 'tidy it up'. Haven't tidied. Christmas and work seem to have taken over everything!
J

Code: Select all

"""
   Isoshunt equation, from nomography.org discussion forum
"""
from pynomo.nomographer import *
 
N_params_1={
            'u_min':0.21,
            'u_max':0.99,
            'g':lambda u:0.5*u/(((u/2)**2)+(u/2)-1),
            'f':lambda u:1+1/(((u/2)**2)+(u/2)-1),
            'h':lambda u:1.0,
            'title':r'New FiO2 (u)',
            'scale_type':'linear',
            'tick_levels':3,
            'tick_text_levels':2,
            'grid':False}
 
N_params_2={
            'u_min':0.21,
            'u_max':0.99,
            'g':lambda u:2/u,
            'f':lambda u:1.0,
            'h':lambda u:1.0,
            'title':r'Old FiO2 (w)',
            'scale_type':'linear',
            'tick_levels':3,
            'tick_text_levels':2,
            'grid':False}
 
N_params_3={
            'tag':'y',
            'u_min':0.1,
            'u_max':6.0,
            'g':lambda u:u,
            'f':lambda u:0,
            'h':lambda u:1.0,
            'title':r'y',
            'scale_type':'linear',
            'tick_levels':0,
            'tick_text_levels':0,
            'grid':False
            }
 
block_params={
             'block_type':'type_9',
             'f1_params':N_params_1,
             'f2_params':N_params_2,
             'f3_params':N_params_3,
             'width':5.0,
             'height':10.0,
             'transform_ini':False,
             }

N2_params_1={
        'u_min':4.0,
        'u_max':30.0,
        'function':lambda u:u,
        'title':r'New PaO2 (t)',
        'tick_levels':3,
        'tick_text_levels':2,
        'scale_type':'linear smart',
                }
 
N2_params_2={
        'u_min':4.0,
        'u_max':30.0,
        'function':lambda u:u,
        'title':r'Old PaO2 (v)',
        'tick_levels':3,
        'tick_text_levels':2,
        'scale_type':'linear smart',
                }
 
N2_params_3={
        'tag':'y',
        'u_min':0.1,
        'u_max':6.0,
        'function':lambda u:u,
        'title':r'',
        'tick_levels':0,
        'tick_text_levels':0,
                }
 
 
block_1_params={
             'block_type':'type_2',
             'width':10.0,
             'height':10.0,
             'f1_params':N2_params_1,
             'f2_params':N2_params_2,
             'f3_params':N2_params_3,
             'mirror_x':True,
             }
 
main_params={
              'filename':'isoshunt curved 2.pdf',
              'paper_height':10.0,
              'paper_width':10.0,
              'block_params':[block_params,block_1_params],
              'transformations':[('rotate',0.01),('scale paper',),]
              }
Nomographer(main_params)

Glen
Posts: 67
Joined: Fri Jan 25, 2008 4:11 am
Location: Australia

Re: Req: Can this eqn be expressed in Std Nomo Form?

Postby Glen » Tue Dec 18, 2012 10:45 pm

Yeah, while the functions U1 and U2 define a hyperbola for the curve of u, for a fair bit of the range of u it doesn't curve much, being almost straight.
Glen
Posts: 67
Joined: Fri Jan 25, 2008 4:11 am
Location: Australia

Re: Req: Can this eqn be expressed in Std Nomo Form?

Postby Glen » Wed Dec 19, 2012 3:22 am

[quote="NomoDave"]Hi Glen

Please could you recommend a good reference or two to get me started on understanding this technique (I've got a rapidly growing library of old nomography books, but not sure which gives the best introduction to this topic for a beginner).

Dave[/quote]

Dave, besides the books I mentioned earlier, both Lipka and Brodetsky give some coverage to curved nomograms; I don't know that either are particularly good on it (I much prefer something that is relies more on determinants than graphical arguments that take longer to get to the same place and don't generalize as obviously), but they have the advantage of being out of copyright, and sometimes one way of looking at something thing will click better than another.

Lipka:

http://archive.org/details/graphicalandmec05lipkgoog (Curved nomograms start on p 106 (p124 of the pdf) of chapter 5 of the book and go up to the end of chapter 5. Take care with other versions - most copies of Lipka only start from Part II - i.e. from Chapter 6!)

Brodetsky:

http://archive.org/search.php?query=bro ... nomography (see especially chapters 4,5,6 - he has a bunch of one-curved-scale nomograms)

e.g. http://archive.org/details/firstcourseinnom00brodrich

But if you can find Otto's book, I'd lean that way.

My own understanding is cobbled together from a whole bunch of different things, including web pages that no longer exist (though I have paper copies somewhere). Ron Doerfler's various bits on nomograms are generally really good.

Return to “Mathematics”

Who is online

Users browsing this forum: No registered users and 2 guests