When Diana Nyad was 64 years old, she swam 110 miles from Cuba to Florida, becoming the first person to do so without a shark cage. It was her fifth attempt over the course of 3½ decades.

“I said when I did that swim, which was 12 years ago, that that was the prime of my life,” Nyad said during a phone interview this month. She felt in better shape physically and mentally than she ever had before. “And honestly, at 76, I’m even better now than I was then.”

Nyad is one of many examples of older people accomplishing things their younger selves could only dream of — but are these people anomalies? Or could many of us get faster, stronger and sharper with age?

This question motivated a study published this month in the journal Geriatrics.

“I started thinking about these examples of people thriving in later life,” said Becca Levy, a professor of epidemiology and psychology at the Yale School of Public Health and lead author of the new research. “How does that fit into this dominant belief that aging is a time of universal and inevitable decline? Are they exceptions, or are they actually kind of showing the potential of later life?”

Levy and a colleague, Martin Slade, looked at data from the Health and Retirement Study, which included several thousand participants who had been asked about their thoughts — positive or negative — about getting older. The researchers examined the participants’ cognitive health and walking speed, which is generally considered a good indicator of physical fitness, and followed participants for up to 12 years to see whether their scores improved — and if there was a link to their views on aging.

Levy and her co-author found that nearly half of the participants over 65 improved — physically, cognitively or both. And people with positive beliefs about aging were more likely to be in that group.

“Will you continue to age? Yes. Will you die? Without a doubt. But you can make it much better,” said Louise Aronson, a leading geriatrician and professor emeritus of medicine at University of California at San Francisco. She said that while aging is inevitable, it’s not a one-way street toward decline. “Maybe you don’t lift as much weight as you did 40 years ago. But maybe you’re lifting twice as much as you did one year ago because you understood that you can influence your aging, and you had enough positivity to get yourself to do the strength training that is so transformative as we age.”