One week to go to the 10th anniversary of the stock market crash of 1987, and even the chairman of the Federal Reserve seems determined not to let the anniversary pass without reminding us once more - and with justice - of the limits of rationality in the stock market.

Ten months ago Alan Greenspan caused a nasty bout of jitters in the markets by warning investors of the dangers of "irrational exuberance". Whatever his intentions, the warning has done little since to stop the market in its tracks. The Dow Jones index is up 25.5 per cent so far this year, after 26 per cent last year.

For much of this year the world's most powerful central banker has seemed on occasions to be flirting instead with the market bulls, debating out loud whether there is any evidence to support the view that something new and profound - a "paradigm shift", in the current market parlance - has taken place in the US economy to justify keeping share prices so high.

Has the rapid spread of microchip technology over the last few years made the business cycle redundant? After six years of expansion in the US economy, some would like to think so. Has there been an unprecedented step change in the productivity of American business? There is not much evidence of it in the standard numbers, but something must explain why unemployment continues to fall so sharply without yet rekindling inflation. Or is it simply that the great inflation bogey of the post-war years has been slain once and for all?

That would certainly help to explain why long-term interest rates, which ultimately drive share price values, continue to fall, and why markets continue to take such a benign view of the future.

Look, for example at the prices of the index-linked bonds which the US government has started to sell to investors for the first time this year. According to BZW, the break-even inflation rate on the latest issue is a little over 3 per cent: in other words, the inflation guarantee that the bonds provide relative to conventional bonds will prove redundant only if average inflation remains below that figure over the next five years. Such calculations would have seemed outlandish even five years ago, so rapidly have inflation expectations changed.

Yet, testifying this week to the House of Representatives Budget Committee, Mr Greenspan wisely reverted to his previous stance, observing that: "Financial markets seem to have priced in an optimistic outlook, characterised by a significant reduction in risk and an increasingly benevolent inflation process."

He added that it was "unrealistic" for investors to expect a repeat performance of the dramatic surge in Wall Street which has been seen over the past two years. His argument was that demand for labour is growing so fast at a time when unemployment is already so low that the point when either economic growth or inflation has to give cannot be far away.

Either way it must eventually rebound into lower share price valuations. That does not mean there has to be another crash to allow the markets' rosy view of the world to come back into line with underlying economic reality. A sudden 20-25 per cent fall in share prices, like 10 years ago, is just one option: it could be, and with any luck will be, a far more gradual process. But it may do no harm to prepare yourself for such an event. The prudent, I would suggest, should already be mentally knocking around 20 per cent of the value of their shareholdings to get a fairer feeling for their worth.

It may be no accident that Goldman Sachs, probably the most powerful of all the American investment banks, has been circulating a graph which shows how uncannily the market's performance over the last three years has tracked that of the market in both 1926-29 (the three years which preceded the 1929 market crash) and 1984-87 (the three years running up to the crash of 10 years ago). The Financial Times carried a similar graph earlier this week, and neatly summarised the main economic reasons why the bull market has now run ahead of all realistic expectations of what the economy, on which the stock market's value ultimately depends, can deliver.

The main question investors face is what they can, or need to, do about it all. Sell all your shares in the hope of buying them back later more cheaply? No, that would be a quite exaggerated response. As I have said before, the markets may well go higher before they do eventually correct: irrationality by definition is unbounded, and history suggests that smart investors make their money by riding the bull waves when they happen, and not trying to second-guess the turning points. The corollary is: don't panic when the setbacks happen.

Better is to keep a sense of proportion. In retrospect, the 1987 crash, unlike its counterpart in 1929, was something of a red herring. The market, having over-reached itself, simply resumed its long upward trend from a new and more realistic base. There was no underlying change in economic circumstances to justify a permanent change in market valuations, as there was in both 1929 and 1974.

With luck we are in the same boat now as we were in 1984, rather than in the other cases. What we do understand now a lot better than we did before is how market crashes occur. Reflecting on the lessons of the South Sea Bubble in the early 18th century, Sir Isaac Newton said: "I can calculate the motions of the heavenly bodies, but not the madness of people."

Modern social science has allowed us a greater insight into the irrationality of collective behaviour. We now understand what is called the fallacy of composition: how a collection of individuals, each acting rationally by their own lights, can nevertheless, collectively, produce an outcome that none of them desires. The standard example is a fire in a cinema: if everyone tries to be first to reach the exit at the same time the result can be catastrophic. This is very much what seemed to happen in 1987, when computer-driven portfolio insurance programmes encouraged an ordinary market downturn to develop into a self-feeding downward spiral.

Mr Greenspan knows well that the world's stock markets are large and dynamic networks driven each day by millions of independent individual decisions. No computer system can begin to model what the collective effect of these individual decisions is likely to be: the process is iterative rather than linear.

The truth is that financial markets are inherently volatile and unstable. That is why we will go on having market booms and crashes - and why reason can only ever take you part of the way towards formulating a coherent investment strategy. The final paradox may be that the more people accept that cycles of overvaluation and crash are inevitable (as in 1987), the less likely they in fact become.