I'm pretty sure this hasn't changed from D&D 3.5 to Pathfinder. If it has in some way I could not realize, I'm sure someone who's more expert can tell me and I'll change my reply accordingly.
In 3.PF games, you roll for initiative when someone does something aggressive and noticeable*.
Let's say your party meets some guards, who unsheat their swords but do not intend to attack (yet). They just want to be ready if they need to attack or defend.
So they unsheat their weapons and you tell that to your players. You also tell them they are not immediately hostile, so to prevent your party attacking because of your miscommunication only.
Do they see this as an hostile act? They will probably announce they want to attack, or maybe they want to be cautious and ask why the unsheating. You keep playing the game, back and forth, as if they were talking to any other non-hostile NPC. These npcs just have their swords out and won't need to unsheat if combat begins.
Once someone declares its intention to attack, then you roll initiative. It doesn't matter who's starting the fight, whoever wins initiative notices the intention and can react before the actual attack takes place. Remeber that in the fiction all turns happen simultaneously and initiative is just a matter of a few milliseconds. partyman A decides the guards are hostile and wants to charge guard B. Guard C notices and attacks A, preventing him to charge B. A's turn, A is not forced to try and lose the charge, because something happened meanwhile and now he can react to the new situation.
I've had a lot of bickering with players stating that until A acted nobody was aware of the situation so B could only delay (making it so everyone who wanted to act won initiative automatically), but by a close reading of initiative rules (which are not so clear on this very point) and by seeing what other DMs did and how that would ruin the advantage of winning initiative, I've since them used the procedure I've explained earlier. It works and it's not against the rules, despite there being some space to interpret things differently.
*If you activate some spell and nobody notices, and it's not immediately harmful to anyone, well, my compliments, you start your encounter with your spell active.