How to obtain new data from the given starting point?

64 Views Asked by At

I am new in Neural network and matlab. My problem -> I have some XYgraphs (X-data, Y-Time). All graphs have same time, but different X values. Also I have a starting point Z. I want to get the actual graph which start from Z, based on above said XY graphs. I tried it by using "nntool" which was available in matlab. I tried few algorithms like TRAINBR, TRAINLM, TRAINB etc. But the output of the trained network never starts from Z. I tried arranging my data, changed input ranges, tried with higher number of layers, epochs, neurons etc. Nothing worked. Please tell me how to solve this problem. No need to use nntool itself.You can suggest any better options... Please help me... A example picture is here...

1

There are 1 best solutions below

2
On

From what I can infer, you are trying to interpolate. Naively one can do it by shifting the mean of the data to Z. I don't have MATLAB, but it shouldn't be difficult to read the Python code.

import matplotlib.pyplot as plt
import numpy as np

Z = 250

# Creating some fake data
y = np.zeros((1000,3))
y[:,0] = np.arange(1000)-500
y[:,1] = np.arange(1000)
y[:,2] = np.arange(1000)+500

x = np.arange(1000)

# Plotting fake data
plt.plot(x,y)

#Take mean along Y axis
ymean = np.mean(y,axis=1)

# Shift the mean to the desired Z after shifting it to origin
Zdash = ymean + (Z - ymean[0]) 

Plot

plt.plot(x,y)
plt.plot(x,Zdash)

Plot2