The National Broadcasting Co. television network, firmly mired in third place in the ratings race, is expected to show more than $30 million in losses for last year.

Analysts said the television losses represent housecleaning by new management, which decided to write off the costs of shows that were purchased but either will never run or will never be shown again. Before the writeoffs are figured in, said John Reidy of the brokerage firm Drexel Burnham Lambert, NBC would show a small profit of about $25 million.

But that is nothing compared with the $175 million to $200 million in profits rivals ABC and CBS will produce, he said.

Analysts said that NBC's new chief, Grant Tinker, wrote off against profits as much as $60 million in so-called inventory--shows that NBC owned and had paid for--that will never be run. "That's the cost of correcting past mistakes," one analyst said.

NBC is owned by RCA Corp., a big conglomerate that owns Hertz Corp. and C.I.T. Financial Corp. in addition to its long-standing investments in broadcasting and electronics.

More than four years ago, RCA hired programming wizard Fred Silverman to rework NBC's offerings to return the network to the prominence it once had. But Silverman, who promised much when he arrived, never could turn the network around.

When RCA's new chairman, Thornton Bradshaw, refused to support Silverman, Silverman tendered his resignation as head of NBC last June. Bradshaw is RCA's fourth chief executive in the past decade. Although NBC, once the mainstay of RCA, may be the conglomerate's biggest problem, neither C.I.T. nor Hertz has been doing well, although both are profitable.

In 1980, RCA had almost the same profits as in 1977, even though the company's sales had increased by more than 35 percent during that span. RCA is expected to report lower earnings for 1981. In 1980, RCA earned $251.6 million on sales of $8 billion.

NBC's consistent third-place finish in prime time has been the focus of much attention for years. But analysts say that NBC's daytime performance has been even more disastrous. Daytime television, heavily dominated by soap operas, is the most lucrative area for network profits. Reidy said that NBC's share of the day-time market is half that of the leader, ABC, and said that NBC probably is losing money on its daytime offerings.

In prime time, the network has had difficulty coming up with a hit series, one that returns audiences week after week, although it often scores well in the ratings with movies and special offerings.

Even though the television network will post a big loss, the total broadcast operations of NBC, including the radio and television stations it owns and its radio network, will show a profit of about $40 million to $50 million, analysts said.

The stations should show a profit of about $65 million, while the radio network likely will post a small profit, one analyst said.