This project is a linear regression tool to get pseudo-susceptibility. This pseudo-susceptibility
Here,
More strictly, in discrete time, pseudo-susceptibility
where,
First, make arrays for each physical quantities. Here, I prepare 3 quantities : total_flow, coldtip_temp, head_temp. Note that these quantities array should have same length (this is the time_length).
suscept_length = 10
data_seq = SingleDataSeq(torch.tensor([total_flow, coldtip_temp, head_temp], suscept_length)
By definition the SingleDataSeq object, susceptibility calculation is finished.
susceptibility_tensor = data_seq.susceptibility_tensor
If you want to change suscept_length, use "self.change_suscept_length(new_suscept_length)". In fact, this method is just same with re-definition of SingleDataSeq.
Also, you can make the data for future by using "self.guess_next_data(base_last_index, guess_length)".
base_last_index = data_seq.time_length - 1
guess_length = 100
future_tensor = data_seq.guess_next_data(base_last_index, guess_length)
concat_tensor = torch.concat(data_seq.data_seq, future_tensor, dim=1)
If you have multiple data sequences with variable time_length's, then you can use MultipleDataSeq.
data_seq1 = SingleDataSeq(torch.tensor([total_flow1, coldtip_temp1, head_temp1], suscept_length)
...
data_seq5 = SingleDataSeq(torch.tensor([total_flow5, coldtip_temp5, head_temp5], suscept_length)
multi_data_seq = MultipleDataSeq([data_seq1, ... , data_seq5], suscept_length)
susceptibility_tensor = multi_data_seq.susceptibility_tensor
Define the loss as following
where,
Find minimum by using derivative:
Therefore,
Here, define new tensors: D-tensor and Y_tensor
Then, the final linear equation is the following:
Therefore, the pseudo-susceptibility is
If you have multiple time sequences for same system, then you need to change the equations a little bit.
Here,