NEW YORK — The numbers are unavoidable. Paul Thomas Anderson has made seven feature films and he has made seven films set in California.

"It's just there, isn't it?" sighs Anderson. "If there was ever any kind of intention to have a wide variety of work, all of it's gone out the window."

Such a fate is ironic to the 44-year-old director, who grew up in the San Fernando Valley preferring Westerns that were shot in Arizona or Texas, as opposed to those (he could tell) in the soft rolling hills of California. "And there I am making 'There Will Be Blood' on these soft rolling hills in California," he says. "In other words, there was zero master plan."

Having already chronicled the Valley's colorful pornography industry in "Boogie Nights" and dramatized the early days of Scientology in "The Master," Anderson has yet again been lured back to his native state. "It's cinematic, I suppose, and it's dirty," he says. "It's got a long, sad history, but it's also got a long, beautiful history."

Anderson's latest, "Inherent Vice," is an absurdist romp about a stoned, hippie detective (Joaquin Phoenix) mumbling his way through the darkening haze of post-'60s Los Angeles, after the Manson murders. It's the first big-screen adaptation of a Thomas Pynchon novel (the author's third California-set book), so Anderson notes he's really "piggybacking" on Pynchon's obsessions.

If anything, Anderson considered avoiding "Inherent Vice," since it would mean another California movie: "All these reasons not to do it, they don't matter at a certain point and you just find yourself doing something that you can't help," he says.

In an interview earlier this fall shortly before "Inherent Vice" debuted at the New York Film Festival, Anderson — a little shaggy, like his protagonist, but a lot more lucid — exhibited serenity, if a little surprise, at the directions his curiosity pulls him. But he acknowledged the night before the film's unveiling was sleepless, "like a bad montage."

Pre-premiere nerves would be understandable: "Inherent Vice" is Anderson's most audaciously out-on-a-limb film yet, which is saying something for a filmmaker who's made it rain frogs ("Magnolia") and concluded a movie with a brutally wielded bowling pin ("There Will Be Blood"). "Inherent Vice" is a looney "The Big Sleep," a far-out detective story that embraces a helter-skelter, anything-goes farce. The slapstick of "Police Squad" was an influence.

"They make you feel like there're no rules in a movie. If it's going to work, it's OK. It's very encouraging to the mischievous side of making a film," says Anderson. "When you read Pynchon's work, he does make you feel that way, too. This is a book, but it can go anywhere, as long as it seems right and it's from a genuine place. Go for it."

Such improvising has regularly been Anderson's way. Phoenix, who also starred as the drifting World War II veteran Freddie in "The Master," says with Anderson there's "genuine exploration."

"He has the knowledge and the technical know-how to achieve anything. He can design a scene with a series of shots, but he doesn't do that," says Phoenix. "He likes to paint himself into a corner. He wants to think of something fresh and he wants it to be organic. You start working on something and you think it's going one direction, and then he'll just scrap an hour's work and reset the shot to find it."

Anderson began "There Will Be Blood" as an adaption of Upton Sinclair's "Oil!" only to veer away, wildly. In "The Master," he started with John Steinbeck's memoirs, only to rope in L. Ron Hubbard's "Dianetics." But "Inherent Vice" is Anderson's first steadfast adaptation.

"Within his 400 pages, there's so much freewheeling and so much material that you're just holding on tight trying to collect the best material and apply it in the best way possible," says Anderson. "It's a little bit more like working in a crowded office where there's piles of stuff and you just have to remember: Where's that bit about Japonica?"

Particularly challenging was capturing Pynchon's tone: antic but laced with menace. "Inherent Vice" is the landscape of a defeated '60s culture, "outgunned, outmanned and outmaneuvered," Anderson says, by stronger forces. But wading through the novelist's notoriously dense prose, Anderson often felt lost.

"And sometimes genuinely getting lost, like: I don't understand what he's talking about. I don't know what he means," Anderson says, chuckling. "I've never been there as a director. Sometimes you're just like: I don't really know what this means, man, but we should film it."

"I was out to sea," he says.

But out to sea is exactly where Anderson is most at home, especially if it's somewhere along the California coastline.