If we can't get the previous data, how could we calculate the factor value of the first day?

You cannot. There are different topics in your question. You can adopt a factor decomposition approach but you don’t have to.

About data, prior to a stock IPO, it has no history. You need to be able to handle this. You may also decide that you need 1 year of data to compute some indicators and your first allocation will start in 2008. You payout function should handle this.