If diagnosed with Unipolar or Bipolar Type II treatment resistant depression:
Inclusion Criteria:
* Participant must be able to provide written informed consent.
* Participant has a diagnosis of major depressive episode that is chronic or recurrent as defined by DSM-5 criteria
* Participant has not had an adequate response to four or more adequate antidepressant treatments from at least two different antidepressant treatment categories in the current depressive episode according to the Antidepressant Treatment History Form (ATHF)
* Participant must have had ECT (Electroconvulsive Therapy) or refused to undergo ECT if clinically indicated to them
* Participant must have HRSD greater than or equal to 20 at study entry
* Participant must be able to complete the evaluations needed for this study including the functional imaging scans and the EEG Bayesian optimization sessions
* Participant must be under the care of a licensed psychiatrist, undergoing regular care evaluations, and inform study team of any change to care team during study participation
* Participant must agree to allow all forms of communication between investigators and study staff and any health care provider (current or having provided service within two years of enrollment)
* Participant must provide name and contact information for at least two people greater than or equal to 22 in age who reside within a 30 minute drive of the participant's residents and whom staff may contact as necessary during study participation
* Participant must be enrolled in a Medicare program
Exclusion Criteria:
* The PCS would (in the investigator's judgment) pose an unacceptable surgical or medical risk for the participant
* Participant is unable to undergo required full body magnetic resonance imaging (MRI) during the clinical study
* Participant is judged by the investigator to be acutely suicidal (e.g. within the 30 days prior to the PCS implant the participant has made a suicide attempt or gesture or has made specific plans or preparation to commit suicide or scores 21 or higher on the MSSI)
* In addition to the acute suicidal risks mentioned above, participant meets any of the following:
1. Has made a suicide attempt within the previous 12 months that required medical treatment
2. Has made greater than or equal to two suicide attempts in the past 12 months
3. Has a clear-cut plan for suicide that states that she/he cannot guarantee that she/he will call her/his regular psychiatrist or the Investigator if the impulse to implement the plan becomes substantial during the study
4. Is likely to attempt suicide within the next six months, in the Investigator's opinion
* Participant has a history of schizophrenia, schizoaffective disorder, or other psychotic disorder, or a current major depressive episode that includes psychotic features (commonly referred to as psychotic depression) according to the DSM V criteria
* Participant with a diagnosis of dementia with a Mini-Mental State Exam (MMSE) less than or equal to 23
* Participant with a positive urine pregnancy test
* Participant with a positive urine drug screen
* Participant with DBS (Deep Brain Stimulator)
* Participant with VNS (Vagus Nerve Stimulator) if the device was active in the last 6 months prior to study enrollment
* Participant with history of seizures
* Participant determined by surgical safety committee to have cerebral atrophy, neurodegenerative or neurovascular disease due to age or medical condition that would prohibit optimal surgical safety, per clinical MRI
If diagnosed with Bipolar Type I treatment resistant depression:
Inclusion Criteria:
* Participant must be able to provide written informed consent.
* Participant has a diagnosis of major depressive episode that is chronic or recurrent as defined by DSM-5 criteria
* Participant has not had an adequate response to four or more adequate antidepressant treatments from at least two different antidepressant treatment categories in the current depressive episode according to the Antidepressant Treatment History Form (ATHF)
* Participant must have had ECT (Electroconvulsive Therapy) or refused to undergo ECT if clinically indicated to them
* Participant must have HRSD greater than or equal to 20 at study entry
* Participant must be able to complete the evaluations needed for this study including the functional imaging scans and the EEG Bayesian optimization sessions
* Participant must be under the care of a licensed psychiatrist, undergoing regular care evaluations, and inform study team of any change to care team during study participation
* Participant must agree to allow all forms of communication between investigators and study staff and any health care provider (current or having provided service within two years of enrollment)
* Participant must provide name and contact information for at least two people greater than or equal to 22 in age who reside within a 30 minute drive of the participant's residents and whom staff may contact as necessary during study participation
* Participant must be enrolled in an active health insurance plan that will cover the costs associated with standard health care services and injuries
Exclusion Criteria:
* The PCS would (in the investigator's judgment) pose an unacceptable surgical or medical risk for the participant
* Participant is unable to undergo required full body magnetic resonance imaging (MRI) during the clinical study
* Participant is judged by the investigator to be acutely suicidal (e.g. within the 30 days prior to the PCS implant the participant has made a suicide attempt or gesture or has made specific plans or preparation to commit suicide or scores 21 or higher on the MSSI)
* In addition to the acute suicidal risks mentioned above, participant meets any of the following:
1. Has made a suicide attempt within the previous 12 months that required medical treatment
2. Has made greater than or equal to two suicide attempts in the past 12 months
3. Has a clear-cut plan for suicide that states that she/he cannot guarantee that she/he will call her/his regular psychiatrist or the Investigator if the impulse to implement the plan becomes substantial during the study
4. Is likely to attempt suicide within the next six months, in the Investigator's opinion
* Participant has a history of schizophrenia, schizoaffective disorder, or other psychotic disorder, or a current major depressive episode that includes psychotic features (commonly referred to as psychotic depression) according to the DSM V criteria
* Participant with a diagnosis of dementia with a Mini-Mental State Exam (MMSE) less than or equal to 23
* Participant with a positive urine pregnancy test
* Participant with a positive urine drug screen
* Participant with DBS (Deep Brain Stimulator)
* Participant with VNS (Vagus Nerve Stimulator) if the device was active in the last 6 months prior to study enrollment
* Participant with history of seizures
* Participant determined by surgical safety committee to have cerebral atrophy, neurodegenerative or neurovascular disease due to age or medical condition that would prohibit optimal surgical safety, per clinical MRI