Half wave rectifier connected to a npn transistor - how to compute its output
So long as the voltage at Va averages less than zero current is flowing through D1 

Wait, what?

Q1 forms a common emitter amplifier, with sensible choices of R1.R2.R3 an inverted an amplified image of the input will be present at the collector

the voltasge swings here are coupled through the capacitor to node V1
were it just R4 connected to this node the signal here would be centred on 0V 
but D1 steals capacitor current when the voltage here it is sufficiently above the charge level in C3, 

as a result the signal here is centred slightly below zero and a net DC current flows up through R4 and is pushed in pulses through D1 by the action of Q1 and C2

The only escape from C3 is via R5 and then Q2 so current flows through Q2 base turinig Q2 on and lighting the LED.