Feed on Posts or Comments

Monthly ArchiveOctober 2007



Matlab & Tips and tools Andrew Kun on 15 Oct 2007

Matlab “not equal” function - be careful how you use it!

When using the Matlab “not equal” function (~= or ne) with vectors and matrices, one has to be careful. I found this out the hard way, playing with some m-code for a homework in my Introduction to Neural Networks course. The issue is that the ~= function evaluates matching pairs of vector/matrix elements one at a time and produces a vector/matrix output. For example, you can do this in the Matlab command window:

>> a = [1 1];
>> b = [1 2];
>> a~=b

ans =

0 1

What’s to be careful about? Well, I wanted to use ~= in an if statement. To do this, type the following in the Matlab command window:

>> if max(a~=b) > 0; c = 1; else c = 0; end
>> c

c =

1

What if you just evaluate a~=b? For the example above:

>> if a~=b; c = 1; else c = 0; end
>> c

c =

0

Not what you expected, right? It took me a while to catch this. Of course, I could have read Bruce Driver’s Matlab primer (scroll down to the end of Section 6). From his page I also learned that the following will work (note that each corresponding element of a and b is different):

>> a = [1 1];
>> b = [2 2];
>> if a~=b; c = 1; else c = 0; end
>> c

c =

1

Bruce also suggests using the “any” Matlab function in the above evaluation as well as just simplifying the whole thing by looking for vectors/matrices that are equal:

>> a = [1 1];
>> b = [1 2];
>> if a==b; c = 0; else c = 1; end
>> c

c =

1

So, be careful, the Matlab ~= function returns a vector/matrix when you compare vectors/matrices.

Andrew Kun

Software & Technology & Web Jonathan Oppelaar on 12 Oct 2007

Jim Miller Talk

On Tuesday October 9th, Jim Miller from Microsft came to speak at UNH. Jim joined Microsoft in 1998, leading the program management team for the kernel of the .NET Common Language Runtime (CLR). His responsibility included garbage collection, metadata definition and file formats, intermediate language (IL) definition, IL-to-native code compilation, and remote objects.

The talk was a great success. Over 60 people showed up and asked a lot of really got questions about microsofts .NET technology.

Here are some pictures from the talk.

img_0664.jpg

jimmiller1.jpg

Jon Oppelaar

Climate change Andrew Kun on 10 Oct 2007

What a joke: Global warming petition project

Yesterday I received a petition in the mail from the so-called Petition Project. The petition actually says this:

“… there is substantial scientific evidence that increases in atmospheric carbon dioxide produce many beneficial effects upon the natural plant and animal environments of the Earth.”

Seriously… Stop the nonsense!

The petition came with a reprint of a paper that looks like it would be from a respectable scientific publication. However, it is from the Journal of American Physicians and Surgeons. Now, you may ask yourself, wouldn’t this be a publication that discusses new approaches to surgery, or something like that? Why would they have a paper on CO2 in the atmosphere? And who of their reviewers (presumably physicians and surgeons) is qualified to provide a peer review of such a paper? Then you look at the content of the Fall 2007 issue of the publication and you see that they discuss the connection between breast cancer and abortion (regardless of your ethical views on abortion, the National Cancer Institute says there’s no connection), liberalism as a mental disorder (perhaps an entertaining read, but unlikely to be scientific) and government spending vs. private health care (is this an economics journal?). This choice of topics of course gives you the distinct impression that you’re not looking at a scientific publication but one that’s intended to provide cover for political purposes (e.g. for people who would like to make money selling fosil fuels without taking responsibility for the environmental effects of burning those fuels).

Btw, around 2000 this same petition was circulated with a paper written in the style of a paper to appear in the Proceedings of the National Academy of Sciences, even though it was not accepted for publication in the proceedings (of course).

What a joke! Anyway, read more here. Perhaps the only good thing: even ideologues feel that they need to use science to win arguments. Now they just need to start practicing the real thing.

Andrew Kun

Science Andrew Kun on 05 Oct 2007

Dr. Ignaz Semmelweis

Following up on Nate Purmort’s post on how congitive bias can lead to problems in research, I wanted to introduce the story of Ignaz Semmelweis, a Hungarian doctor who discovered the importance of hygiene in preventing disease, specifically puerperal fever. You can read the story of Dr. Semmelweis’ life and work (where else?) in this Wikipedia article.

Dr. Semmelweis realized that doctors and their students who performed autopsies and did not wash their hands before coming into contact with pregnant women, caused many of these women to come down with puerperal fever and die (amazingly mortality was as high as 30% in some hospitals). However, his ideas were dismissed by the medical establishment. This was party due to the fact that doctors didn’t want to contemplate that they could in fact be causing death as opposed to healing people. And apparently Dr. Semmelweis didn’t play politics very well so he wasn’t able to convince his colleagues.

However, his story is primarily a story of the failure of the medical establishment at the time to recognize that his applied research had resulted in procedures that could save lives. One complaint about this research was that it didn’t provide an explanation of the result. This was certainly a problem, but it didn’t refute the results (also explanations based on the “four humours” sound less than impressive).

Finally, I wanted to make another point, not related to research: as the above Wikipedia article points out, Dr. Semmelweis died from injuries suffered when he was beaten as a patient in an insane asylum. Thankfully, beatings are not considered an appropriate medical technique any more!

Andrew Kun

R&D & Tips and tools Nathan Purmort on 01 Oct 2007

Cognitive Biases & Scientific Research

One of the most important qualities of a good researcher is his/her ability to remain impartial in the work conducted. Unfortunately, basic human nature doesn’t always make this possible. Such intrinsic biases are called “cognitive biases” and affect decisions we all make daily.

I am no expert in the subject and actually just learned of it recently. Wikipedia has a thorough list of cognitive biases and should make good reading material for anyone who is involved in the scientific research community (among other applications). Being familiar with these can prevent you from falling victim to them in your own work. Additionally, it will make you able to ask more critical questions of other’s work.

The subject of logical fallacies also ties in closely with cognitive biases. Logical fallacies define (false) reasoning which doesn’t lie within firm (or correct) logical roots. Wikipedia also has a list of these. Being familiar with these, like the cognitive biases, will help you avoid such mistakes in your own work and more able to spot flaws in the reasoning of others.

Let me know what you think!

« Previous Page