viva_emotion/pad
PAD Model - Pleasure, Arousal, Dominance
The “blood type” of emotional state.
Theory
Three-dimensional affective space (Mehrabian & Russell, 1974; Mehrabian, 1996):
- Pleasure (P): hedonic valence, sad ↔ happy
- Arousal (A): physiological activation, calm ↔ excited
- Dominance (D): sense of control, submissive ↔ dominant
Note on P-D Correlation
Bakker et al. (2014) found P-D correlation ≈ 0.85 in some studies. This implementation treats dimensions as independent (standard approach), but be aware they may not be perfectly orthogonal empirically.
References
- Mehrabian & Russell (1974). An Approach to Environmental Psychology. MIT Press.
- Mehrabian (1996). Current Psychology, 14, 261-292.
- Bakker et al. (2014). PLOS ONE, 9(1), e84618.
Types
Values
pub fn add(a: Pad, b: Pad) -> Pad
Add two PAD states (for applying deltas).
Examples
add(new(0.5, 0.0, 0.0), new(0.3, 0.2, -0.1))
// -> Pad(pleasure: 0.8, arousal: 0.2, dominance: -0.1)
pub fn distance(a: Pad, b: Pad) -> Float
Euclidean distance between two PAD states.
Examples
distance(neutral(), new(1.0, 0.0, 0.0))
// -> 1.0
distance(neutral(), neutral())
// -> 0.0
pub fn is_suspicious_uniform(noise: Pad) -> Bool
Check if noise is suspiciously uniform (all in [-1,1]). Returns True if noise looks like it might be uniform, not Gaussian.
N(0,1) has ~68% in [-1,1], so all 3 in range is only ~31%.
Examples
is_suspicious_uniform(Pad(pleasure: 0.5, arousal: -0.3, dominance: 0.8))
// -> True
is_suspicious_uniform(Pad(pleasure: 2.1, arousal: -0.3, dominance: 0.8))
// -> False
pub fn is_valid_noise(noise: Pad) -> Bool
Validate that noise looks like N(0,1) samples. Returns True if all components are within plausible range. This is a sanity check, not a statistical test.
Examples
is_valid_noise(Pad(pleasure: 0.5, arousal: -0.3, dominance: 1.2))
// -> True
is_valid_noise(Pad(pleasure: 10.0, arousal: 0.0, dominance: 0.0))
// -> False
pub fn lerp(from: Pad, to: Pad, t: Float) -> Pad
Linear interpolation between two PAD states.
Examples
lerp(neutral(), new(1.0, 1.0, 1.0), 0.5)
// -> Pad(pleasure: 0.5, arousal: 0.5, dominance: 0.5)
lerp(new(-1.0, 0.0, 0.0), new(1.0, 0.0, 0.0), 0.25)
// -> Pad(pleasure: -0.5, arousal: 0.0, dominance: 0.0)
pub fn neutral() -> Pad
Neutral state - emotional equilibrium.
Examples
neutral()
// -> Pad(pleasure: 0.0, arousal: 0.0, dominance: 0.0)
pub fn new(
pleasure: Float,
arousal: Float,
dominance: Float,
) -> Pad
Create a new PAD state (automatically clamped to [-1, 1]).
Examples
new(0.5, 0.3, -0.2)
// -> Pad(pleasure: 0.5, arousal: 0.3, dominance: -0.2)
new(2.0, -3.0, 0.5)
// -> Pad(pleasure: 1.0, arousal: -1.0, dominance: 0.5)