Image source: Micron Technology.

Memory chip manufacturer Micron Technology (MU -4.71%) has taken investors on quite the ride over the past few years. Huge gains in 2013 and 2014, driven by record profits, were completely wiped out in 2015 as memory prices sank and profits turned into losses. The stock has partially recovered this year, with investors betting that DRAM and NAND prices will begin to improve. But the stock is still far below its peak.

MU Chart

MU data by YCharts.

Micron manufactures and sells commodity products, meaning that supply and demand are the main determinants of price. During periods where demand outstrips supply, prices rise and Micron earns exceptional profits. During periods where supply outpaces demand, prices sink, knocking down profitability and potentially leading to losses. While trying to predict how DRAM and NAND prices will evolve is a fool's errand, what is predictable is that these cycles will continue, barring a fundamental change in the industry.

The biggest risk

The biggest risk involved with investing in Micron is the potential of overpaying for the stock. The PE ratio can be deceptive, with the stock appearing cheap during the good times when profits are at their highest, and expensive during the bad times, when profits are low or nonexistent. Micron stock peaked in late 2014 around $36 per share, about 14 times earnings for that year. Investors who believed that the stock was a good deal at that price were sorely mistaken, as those profits were unsustainable.

Likewise, Micron earned just $0.32 per share in net income over the past year, putting the current PE ratio at about 50, what looks like an astronomical valuation. But DRAM and NAND prices will eventually stabilize, ending the string of losses that has plagued Micron in recent quarters. On average, Micron's earnings will be somewhere in between its record profits of 2014 and its middling profits of the past year.

One way to get a sense of whether Micron's stock price is in the ballpark of its fair value is to look at its price to book value over time. For a company like Micron, which manufacturers commodity products, price to book value is a useful metric for investors.

MU Price to Book Value Chart

MU Price to Book Value data by YCharts.

Micron currently trades for a little less than 1.4 times its book value. The large spike in 2013 and 2014 should have been a red flag for investors -- the last time Micron was valued at such a high multiple of its book value was during the dot-com bubble. There's no "correct" price-to-book ratio for Micron, but 1.4 looks to be within the typical range of the past decade.

I think Micron is roughly fairly valued at this point -- it's not obviously cheap, and it's not obviously expensive. The stock may fluctuate wildly going forward, but for long-term investors, I'd say that Micron stock doesn't carry an above-average amount of risk.

There are some other risks related to the business itself that are worth mentioning. Micron has made a big deal about 3D XPoint, a new type of memory that it developed along with Intel. But it's still not clear how big of an impact 3D XPoint will have. If 3D XPoint turns out to be a dud, either due to high prices or another factor, investors may become less optimistic about Micron's recovery.

China is also a wild card that could have long-term effects on Micron's business. The Chinese government, through a state-owned contract chip manufacturer, is pouring $24 billion into building a domestic semiconductor industry, according to The Wall Street Journal. The Chinese company expects to eventually produce both NAND and DRAM chips, potentially introducing additional competition that could drive down profits for Micron and the industry.

If higher DRAM and NAND prices fail to boost the company's profitability soon, Micron stock could get knocked down. That's a risk for investors with shorter time horizons, but not so much for long-term investors willing to wait out this rough patch. Given its valuation, Micron looks like an average investment at the moment, with an average amount of risk. Nothing more, nothing less.