The effect of vitamin D deficiency on mental health
The importance of vitamin D in mental health
Vitamin D is not just a nutrient; It is a hormone that has receptors in almost every cell and tissue of the body. It is estimated that about 3% of the human genome is regulated by the endocrine system by vitamin D and more than 1,000 genes are affected in the human body. Vitamin D has a wide range of effects on system health and has been shown to support the functions of the physical, mental and immune systems.
Correlative scientific evidence consistently indicates that vitamin D status is inversely related to mental health issues, including depression and anxiety, in all age groups. Research suggests that vitamin D can affect mood and mental disorders. Some studies have suggested that vitamin D deficiency may worsen psychological symptoms in individuals with depression and bipolar disorder. Given this evidence, it appears that raising the level of vitamin D through autologous methods is beneficial in improving multiple markers of mental health. However, taking oral vitamin D supplements does not show similar results with any consistency. This is likely due to the different way the body uses sunlight to produce endogenous hormones, such as vitamin D, compared to exogenous forms.
Can Vitamin D Deficiency Cause Mental Health Problems?
Several published reviews indicate that vitamin D plays a role in causing
mental health disorders, particularly mood disorders. When looking at the general population, lower levels of vitamin D are found in people with depression as well as in those with anxiety disorders, regardless of age or gender.  Vitamin D in the blood also appears to be associated with the severity of depression symptoms. While there are other factors that may contribute to how the sun may benefit mental health, the evidence for a particular effect of vitamin D is compelling. Vitamin D is a neurohormone in the brain that exercises its biological function not only by affecting cellular processes directly, but also by affecting gene expression through elements of the vitamin D response.
The results of one meta-analysis reviewing 14 studies (a total of 31,424 participants) showed a significantly higher risk of depression in the lowest vitamin D category than in the highest category. 
One study that investigated 1,472 factors found that poor sleep quality, a mood-related symptom, was more likely in those with a vitamin D deficiency.
Another study showed an inverse relationship between vitamin D level and emotional problems, peer relationship problems, and overall difficulties in young adults.
A study of 7,970 subjects found the odds ratio for depressive episodes in those with serum vitamin D ≤ 20 ng/ml is significantly higher compared with those ≥ 30 ng/ml. 
Can Vitamin D Deficiency Cause Mental Confusion?
Vitamin D receptors are found throughout the brain. Vitamin D deficiency is associated with mental health symptoms and low vitamin D affects mental health through a variety of mechanisms. Vitamin D can affect mood and psychiatric disorders, and research suggests that a lack of vitamin D may exacerbate psychiatric symptoms. Vitamin D supports mental focus and vitamin D deficiency can alter the state of mental health. Research suggests that low levels of vitamin D can lead to mental confusion and that some people with a vitamin D deficiency experience mental fog.
What does vitamin D do for mental health?
The full effect of sunlight exposure on mental health cannot be replicated by exogenous vitamin D supplementation. The mental health benefits of sunlight go beyond vitamin D3 production alone.
Measurement of vitamin D in the blood is often just a biomarker of UV exposure,
so while researchers try to correlate vitamin D levels with different outcomes, they often rule out other UV-related factors that may be relevant. In particular, evidence shows that exposure of the skin to the ultraviolet portion of the sun’s spectrum affects the hypothalamic-pituitary-adrenal (HPA) axis leading to the production of mood-enhancing hormones such as beta-endorphins.
One study found that after a 12-week behavioral activation program focused on safe sun exposure, subjects in the intervention group had significantly higher serum vitamin D and significantly lower depression scores compared to controls.
A placebo-controlled trial found significant improvement in scores for depressive symptoms and cognition in dermatological patients and an unobserved tendency toward improvement in healthy volunteers after exposure to UV light.
A study of 20 healthy, non-depressed women found that healthy moods improved after three whole-body exposures to UV rays during the winter.
A study measuring mood variables in people with fibromyalgia found that six exposures to UV rays had a positive effect on well-being, relaxation, and reduced pain levels.
Mental health benefits of UVB and Vitamin D
Studies have shown that increased vitamin D is beneficial for mental health and mood disorders. Intervention by controlled exposure to ultraviolet (UVB) light can be used to stimulate multiple mechanisms of action that have a systemic effect on mental health.
The hypothalamic-pituitary (HPA) axis is a dynamic synapse of the central nervous system and the endocrine system in response to stress. Stressful life events and a dysfunctional HPA axis cause mental health conditions, including mood and anxiety disorders. The hypothalamus plays a major role in depressive symptoms, such as day and night arrhythmias, a lack of sense of reward as well as disturbances in eating, sex, and cognitive functions. The skin has a systemic effect on the HPA axis when exposed to the UVA-UVB region, but not the UVA region. [11, 12] In vitro and animal studies have shown that exposure of the skin to UVB light expresses all components of the HPA axis including corticotropin-releasing hormone, propiomelanocortin, adrenocorticotropic hormone, beta-endorphins with corresponding receptors,
Beta-endorphins are primarily used in the body to reduce stress and pain. This peptide hormone is at least 17 times more powerful than morphine, which means that even small increases in the body can have a profound effect. Research links beta-endorphins to major depressive disorder and theorizes that dysregulation of the HPA axis may explain depressive symptoms in some individuals. One study found that depressed patients showed significantly lower plasma beta-endorphin levels than controls at baseline and after two tests designed to measure adrenocorticotropic hormone dysfunction. In addition, the data indicate that after two weeks of treatment,
It has been documented in vitro and in vivo that the UV spectrum of sunlight causes the production of beta-endorphins in the skin. It has been suggested that the release of beta-endorphins after UV exposure may be an evolutionary reward system for sunlight exposure that is potent enough to be a biochemical mechanism responsible for tanning’s “addiction”. In vivo studies have demonstrated that, similar to the production of vitamin D, the ultraviolet spectrum does not lead to an increase in beta-endorphins in the blood.
Serotonin affects a large number of brain cells associated with mood, sexual desire, appetite, sleep, memory, learning, temperature regulation, and social behavior. Many researchers believe that an imbalance in serotonin may lead to depression. An imbalance of serotonin may result from decreased production of serotonin in brain cells, a deficiency of receptor sites able to receive the serotonin that is synthesized, an inability of serotonin to reach receptor sites, or a deficiency of tryptophan, the amino acid that makes up serotonin. This is why selective serotonin reuptake inhibitors (SSRIs) are widely prescribed to treat depression.
Experiments have shown that calcitriol, the active form of vitamin D, mediates gene transcription in the brain that not only stimulates serotonin synthesis, but also prevents its re-uptake, potentially raising serotonin in the central nervous system. [19, 20] Some researchers believe that improving vitamin D may help prevent and modify the severity of brain impairment. The literature suggests a link between sunlight and serotonin due to synchronized seasonal fluctuations. A study of 101 people showed that brain turnover of serotonin was lowest in the winter and the rate of serotonin production was directly related to duration of exposure to bright sunlight. Another study in 36 healthy people found that low exposure to sunlight was associated with a 20-30% decrease in serotonin-1a receptor binding in the limbic regions of the brain.