"Happy the man, and happy he alone," the Roman poet Horace wrote long ago, "The man who can call today his own." And in that sense, these days are Ted Kennedy's own.

As the weeks wind down for Sen. Edward M. Kennedy toward what seems likely to be a crushing defeat at the Democratic National Convention, the candidate appears to be a thoroughly happy man. Beholden to no one and confident that his continued campaigning is good for himself and for his party, Kennedy displays a zestful spirit that friends say they have not seen since his unsuccessful race for the presidency began eight months ago.

As Kennedy continues to campaign against nearly impossible odds, politicians around the country keep asking, "Why doesn't he just give up?" Anyone who watches him closely can provide at least a partial answer: He's having too much fun to quit.

Traversing the country at a leisurely pace to address friendly groups with a stump speech filled with the unalloyed liberalism that has been traditionally associated with his family, Kennedy says "the campaign feels good right now."

He has caught up on his sleep since the end of the primary season; "just the chance in the schedule since June 3 has been therapy," he says. After months of dining on starchy airline food, he has lost about 15 pounds in three weeks.

And he seems satisfied with his current role as an underdog champion of the liberal cause. He delivers his speeches these days with a force and conviction that was often lacking in the primary champaign. No matter what the ostensible topic of his speech may be, he generally manages to throw in a reference to just about every liberal issue that matters to him."

When Kennedy addressed the Day Care and Child Development Council the other day, his text included a digression aimed at one of his oldest targets -- the "three-martini lunch" that businesses can deduct from their income taxes.

When he came to that section of the speech, Kennedy broke into a broad smile, and as he read the operative sentence -- "Let us spare the hungry and act instead to reduce the billion-dollar subsidies for business meals, which are food stamps for the rich" -- he chuckled and nodded at that favorite refrain as if he had just come upon a cherished friend.

Kennedy tells every audience and says in every interview that this traditional liberalism reflects "the most basic Democratic Party ideals." When interviewers point out that Democrats rejected his liberal candidacy as a big margin in the primaries, Kennedy is undaunted. "What I'm saying is what the party has always meant to me, and what I think it ought to mean," he says.

That is why he professes to be unmoved by Democrats who complain that his continued attacks on Jimmy Carter will help Republicans regain the White House this year, as they did in 1968 when the Democratic Party was badly split. Kennedy's answer is that the Democrats must offer a clear contrast to the conservatism of Ronald Reagan in order to win in November.

Another reason for Kennedy's good spirits is that he is one of the few politicians in America who still think he has a chance to win the Democratic nomination.

"We still have time," Kennedy said in an interview last week. "This thing is moving, you look at the polls. Something is happening with Carter . . . he's losing it pretty steadily."

The candidate was referring to two polls released last week. One showed Carter dropping far behind Reagan in a poll of voters nationwide. The other showed Kennedy's support among Democrats to be growing while Carter's falls. s

But a new Associated Press poll of the only Democrats who really count now -- the delegates to the August convention -- showed that Kennedy was unlikely to win support from Carter-pledged delegates. The survey said the delegates are inclined to back the president on rules fights as well as the nomination balloting.

Still, Kennedy has kept much of his campaign staff intact and has personally know if anything will happen, but him through the convention. "Basically, we've realistic about the thing," said one worker at the campaign headquarters last week. "We don't really know if anything will happen, but if a volcano erupts, you know, we want to be ready. We're standing by."

Kennedy and his top advisers also think that his persistence in the face of almost certain defeat has served to counter some of the "character" problem that was probably the main reason for his failure as a presidential candidate.

The bulletin boards at the campaign headquarters are filled with columns and editorials suggesting Kennedy has been an honorable and uncomplaining loser.

Kennedy, though, seems not yet reconciled to the idea that he has lost. His friends and his campaign staff say he is not looking beyond the Democratic convention, and he simply declines to discuss what lies ahead if he loses the nomination.

"I think he's not ready to go back to being just another senator," says a senior aide. "He wants to keep campaigning all the way."

So Kennedy moves through what remains of his campaign week by week, enjoying the moment and refusing to focus either on the long string of defeats he suffered this spring or his bleak chances at the convention this summer.

"Happy the man, and happy he alone," Horace wrote, in John Dryden's translation, "The man who can call today his own. He who, secure within, can say, 'Tomorrow do thy worst, for I have lived today.'"