It's tempting to follow the herd but it could prove very costly. One day the US sharemarket experiences its worst drop since the horrors of 2008 the next it records its biggest jump in two years. Midnight strikes and it's on its way down again. As usual, the Australian market goes along for the roller-coaster ride.Even the most hardened institutional investors have found the recent volatility extremely challenging. Some sold into the downturn, while others stood on the other side of the transaction and bought.So what's the ordinary investor to do when all about them are losing their heads? Keep yours, financial advisers and observers of investor behaviour say.In the midst of the turmoil, banks reported a jump in inquiries about cash and term deposit products, and the president of the Association of Financial Advisers, Brad Fox reported financial planners' phones "ringing off the hook"."This is when we make sure clients stick to their game plan, despite an understandable tendency for them to want to drop the ball and run," he says.It's times such as these when investors need to ensure they're making rational, rather than emotional, decisions - whether that's to sell, buy or hold - advisers say.Yet it's at times such as this that investors tend to lose perspective, says deputy dean of the faculty of business and economics at the University of Melbourne, Paul Kofman."People tend to overestimate the truly unlikely events - events that happen only once every 10 years all of a sudden take on a greater likelihood," he says. When markets fall, people expect things will get much worse, an expectation not really in line with longer-term experience."They tend to think they're trapped in a bear market ... [and] that's when people start to become reckless," he says. "They hear nothing but the bad news and they overestimate the likelihood that things will only get worse from now on."Then they start selling at a poor time, after their assets have fallen in value.This negative frame of mind means they tend to be slow to start buying again. "People tend to be way behind the turning point before they start readjusting their portfolios," Kofman says. "It really is a mistake to think you can time the market."The same applies in reverse, with people over-optimistic in a bull market and slow to sell when perhaps they should, he says.Greed defies logic in a bull market, just as fear overwhelms it in a bear market.An owner of In Your Interest Financial Planning, Christoph Schnelle, says there's no one correct decision during times such as these. Whether you sell, buy or hold depends on individual circumstances.It's OK to do any of those things as long as your decision is based on honest reflection, rather than being a kneejerk reaction. Schnelle says he finds a client's gut reaction to a falling market can be particularly telling."If people have a strong emotional reaction, there's a strong likelihood that there was a serious error in the decision to invest in the first place," he says. "It's a strong alarm signal that something is wrong and you need to find out what's going on."People will always feel bad if the market falls but if they're able to respond rationally rather than just reacting - if they're able to make a considered decision - then that's a good sign."Kofman says a key consideration is your investment horizon: if you're 20 years away from retirement, you can probably afford to ride the roller-coaster. Yet US-based financial industry researcher Dalbar Inc says investors generally abandon investments at inopportune times, often in response to bad news.According to its study of 20 years of US mutual funds data, "one of the most startling and ongoing facts is that at no point in time have average investors remained invested for sufficiently long enough periods to derive the benefits of a long-term investment strategy"."The key to curbing undesirable reactions is to introduce a pause ... to assess the facts" and to consider whether you're succumbing to emotion, it says.Costly behaviour includes:Loss aversion. Not taking action when necessary to buy or sell shares.Narrow framing. Making decisions without considering implications.Mental accounting. Developing an emotional attachment to individual investments.Anchoring. Placing too much credence in recent price movements.Misusing diversification. Simply using different sources without thought to how they interact.Herding. Copying the behaviour of others even in the face of unfavourable outcomes.Regret.Treating errors of commission more seriously than errors of omission.Media response. Reacting to news without reasonable examination.Optimism. Believing that good things happen to me and bad things happen to others.Source: Dalbar Inc.Weighing up the risk rationallyFrances*, a musician, had built up a portfolio of shares but had never owned her own home.With her daughter now a young adult, they started to talk about buying a property together, taking advantage of the first-home buyer's grant. "I've never owned a place just a lot of shares bought over many years," Frances says.The plan was for those shares to help fund the purchase once they found a place but she was unsettled by talk about the US possibly defaulting on its debt and by the continuing troubles in Europe and sought advice.The market was still buoyant at the time but, told she needed to weigh up the risk of missing out on further gains against the risk of her shares falling in value, she decided to sell.A week later, the market plummeted. While the market recovered some ground, Frances says she's glad to have the certainty of money in the bank now that her home purchase is a short-term prospect.*Not her real name.