By Matt McGrath
BBC World Service environment reporter
Edinburgh is famous for its comedy festival and impressive castle
The most sparsely populated county in Wales is where you will find Britain's happiest place, hints research.
Powys tops the list of 273 districts, with Edinburgh apparently the most miserable place in Britain.
Eight of the top 10 districts with the highest levels of well-being are in Scotland or the north of England.
However, the research results suggested that the differences between areas were due to personal circumstances rather than physical location.
The study, by a team from the Universities of Sheffield and Manchester, used data from the British Household Panel Survey, which questioned a representative sample from 5,000 households about their sense of well-being.
The researchers were able to draw up a map of happiness down to district level across England, Scotland and Wales.
Although the sample for each district was small, the team believes the findings are of interest from an academic point of view.
Two former coal-mining communities in Wales were found to be less happy than the rest of the UK.
But when factors such as employment, health and educational qualifications were taken into account, there were only very small differences between areas, suggesting that it is these criteria, rather than geography, that determine levels of happiness.
The team found that the area of Brecknock, Montgomery and Radnor in Powys was the happiest place.
Manchester came second, followed by West Lothian. Macclesfield, Nottingham and Falkirk were all in the top 10.
The London borough of Sutton was one of the few places in the south of England to do well.
Edinburgh, despite its cosmopolitan reputation and internationally acclaimed fringe festival, was bottom of the list. Swansea and Doncaster also did poorly.
MOST CHEERFUL PLACES
3. West Lothian
4. Cumbernauld and Kilsyth and Monklands
Source: British Household Panel Survey
Researcher Dr Dimitris Ballas, a senior lecturer in Geography from the University of Sheffield, said factors such as social cohesion seemed to be more important than location.
"One of the advantages of our method is that it takes into account both people and places.
"For instance, with unemployment we can say that people who are unemployed are on average happier in an area of high unemployment compared to being unemployed in an area where everyone else around you has a job.
"This highlights the issue of social justice and cohesion."
Another important factor in determining happiness was the length of time that a person spent living in a place.
LEAST CHEERFUL PLACES
2. Cynon Valley and Rhondda
3. Amber Valley and north east Derbyshire
4. Clydesdale; Cumnock and Doon Valley; Kyle and Carrick
Staying in an area for five years or longer was an important indicator of well being, said the scientists.
According to Dr Ballas, the state of interpersonal relationships was also seen as highly important.
And this was more often the case in areas which were there was less inequality between people.
"From what I've seen so far my view is that if an area is more socially cohesive it increases your chances of having good quality of interpersonal relationships and a good social network.
"If you live in an area which is very unequal and polarised then you are less likely to have good social networks and friends.
HAVE YOUR SAY
It's no coincidence that the happiest area in the survey is the least overcrowded
"To what extent we can talk about happy people or happy places? Is it the place or the people? My guess would be it's a bit of both.
"The variance that is attributed to the place you live in is perhaps higher than our research suggests, your immediate surroundings are very important in terms of happiness.
"But we don't have data on neighbourhoods yet."
The research was presented at the annual conference of the Royal Geographical Society and the Institute of British Geographers.
It was the second study done by Dr Ballas using the British Household Panel Survey. He plans to carry out further research - possibly with a larger sample - to see how the results of the different studies compare.
Amendment 10 November 2008: This story has been changed to emphasise that the research did not suggest that geographical location was a significant factor in determining happiness. The report was the subject of a
ruling by the BBC's Editorial Complaints Unit.