There is good evidence that naltrexone, an opioid antagonist, has a strong neuroprotective role and may be a potential drug for the treatment of fibromyalgia. In previous work, some of the authors used experimental clinical data to identify input-output linear time invariant models that were used to extract useful information about the effect of this drug on fibromyalgia symptoms. Additional factors such as anxiety, stress, mood, and headache, were considered as additive disturbances. However, it seems reasonable to think that these factors do not affect the drug actuation, but only the way in which a participant perceives how the drug actuates on herself. Under this hypothesis the linear time invariant models can be replaced by State-Space Affine Linear Parameter Varying models where the disturbances are seen as a scheduling signal signal only acting at the parameters of the output equation. In this paper a new algorithm for identifying such a model is proposed. This algorithm minimizes a quadratic criterion of the output error. Since the output error is a linear function of some parameters, the Affine Linear Parameter Varying system identification is formulated as a separable nonlinear least squares problem. Likewise other identification algorithms using gradient optimization methods several parameter derivatives are dynamical systems that must be simulated. In order to increase time efficiency a canonical parametrization that minimizes the number of systems to be simulated is chosen. The effectiveness of the algorithm is assessed in a case study where an Affine Parameter Varying Model is identified from the experimental data used in the previous study and compared with the time-invariant model.