[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*Subject*: regression with poisson models*From*: matzke(at)geog.ucsb.edu (Nick Matzke)*Date*: 17 Jun 2001 17:59:31 -0700*Newsgroups*: comp.lang.idl-pvwave*Organization*: http://groups.google.com/*Xref*: news.doit.wisc.edu comp.lang.idl-pvwave:25363

Hi, ...hope that you smart astronomy types can take a minute to answer a question from a humble geographer. I have been using the function REGRESS (IDL 5.4) to test correlations between images derived from two different sensors (simply using each pixel-pixel comparison as an observation). This works fine, but both datasets appear to have poisson distributions rather than gaussian distributions. In S-plus 2000, it is a fairly simple matter to use the 'Statistics --> Regression --> Generalized Linear Model' menu option, and change the model for the data from Gaussian to Poisson. But there appears to be no similar easy option for IDL REGRESS or similar functions. The only relevant line that I could find in the IDL help files was this (in the help entry for REGRESS): =================== MEASURE_ERRORS Set this keyword to a vector containing standard measurement errors for each point Y[i]. This vector must be the same length as X and Y. Note - For Gaussian errors (e.g., instrumental uncertainties), MEASURE_ERRORS should be set to the standard deviations of each point in Y. For Poisson or statistical weighting, MEASURE_ERRORS should be set to SQRT(Y). =================== ...but if I just set the keyword MEASURE_ERRORS to SQRT(Y), I get errors because of zeros in the array Y -- even once I got the dimensions etc right. Here's my workaround: errorarray1[0:points2-1]=sqrt(abs(y[0:points2-1,0])) errorarray1=errorarray1+0.0000001 ...and then I use MEASURE_ERRORS=errorarray1. This code doesn't crash (it does if the 0.0000001 isn't added), but this seems like a pretty half-baked solution; plus I don't really have any idea if this is the equivalent of assuming a poisson distribution rather than a normal one. Is there a simpler way to do a regression in IDL assuming poisson-distributed data rather than normal distributions? Is what I've got right now even doing this? To Craig, who is I think the resident IDL genius: I found the newsgroup from your webpage, & downloaded the programs for image regression...I'll see if I can get them to work. Is there perhaps a solution to my problem within one of the functions you've created? Back to the group: Anyway, I hope this isn't too silly a question. Both my stats & IDL skills are limited. I suppose I could learn the s-plus scripting language, but I've spent the last few months learning IDL, & love it for image analysis (along with ENVI), & would hate to have to learn a whole 'nuther language just to solve this problem. I have a zillion variations on these images to compare, so doing things manually in S-plus doesn't seem like a likely option. Thanks, Nick PS: Why am I doing this? See my webpage: http://www.geog.ucsb.edu/~matzke/mad/home.html ...And if you want to st-borrow some (perhaps primitive, but functional) IDL 5.4 scripts, check out the discussion page at my dept: http://pinon.geog.ucsb.edu/cgi-bin/forumdisplay.cgi?action=topics&forum=IDL,+ENVI,+other+RS+software&number=5&DaysPrune=45&LastLogin= (Do 'show all topics' to see some of the older stuff) Thanks, Nick

**Follow-Ups**:**Re: regression with poisson models***From:*David Fanning

**Re: regression with poisson models***From:*Craig Markwardt

- Prev by Date:
**Re: changing contrast and brightness on the fly** - Next by Date:
**Re: regression with poisson models** - Prev by thread:
**Re: changing contrast and brightness on the fly** - Next by thread:
**Re: regression with poisson models** - Index(es):