Optocoupler - input resistance in parallel with the LED
The purpose can be seen in the question:
Resistor parallel to optocoupler LED in Zener-stabilized circuit

As to the value, it's really not that critical.  If it's too low, it can divert enough current from the opto so that it does not turn on (hard).  If it's too high, then it defeats the purpose for it being there - the noise or charge buildup you're trying to guard against.

The schematic snippet in that question is from a real-life design.  The value of that resistor is 4.99 kohms.