I've just started to use MongoDB Charts to plot incoming data from a series of IoT devices that send at regular intervals. Each device sends a package with a timestamp and some data (JSON to our NoSQL db), and I would like to plot several devices on the same chart.
To visually check the continuity of the data flowing in (i.e. if a device fails to upload data) I want to plot each data-point over a continuous time-series x-axis. Does anyone know if MongoDB Charts has a feature to make the x-axis continuous? Currently, the chart plots one point per observation and space these equally no matter the time-in between.
Example of data: Point 1-2-3 all have 6 minutes in between, but visually appear to be non-uniform, since the x-axis is not continuous:
Yes, MongoDB Charts has a "Continuous Line" chart type that should do what you want. As you discovered, the discrete chart always aggregates values over binned time periods, but the continuous version plots a point for each document. Please see the following screenshot as an example.
Related
I am doing a two-channel data acquisition to read out the voltages of two diodes. I am using LabVIEW to do this. Below you can see the part of the code relevant for my question.
The voltages are converted to temperatures by 1D interpolation, as shown in the above code. 0.9755 V corresponds to 2 degrees, 1.68786 V to 100 degrees. For this simple example, I expected the waveform chart to display two constant curves, one at 2 and one at 100. However, it plots only one curve that zigzags between the two values. How can I get two separate plots?
Add "Index Array" at the "yi" output of the "Interpolate 1D VI" function and expand it to two elements. Then put "Bundle" function with two inputs. Connect "Index Array" outputs to them. The resulting cluster connect to the chart.
That's it :)
Explanation: to display multiple plots in the chart, you need to feed it with a cluster, not an array. Your "Interpolate 1D VI" output gives you 2-element array (result of interpolation for 0.9755 and 1.68786), so you need to convert it to a cluster using Bundle function.
The general answer to this question is that if you open the context help and hover over the BD terminal of a graph or chart, you will see the various data types it supports:
This will help if you want to get it right every time, as the various charts and graphs can each take different types of data to display different types of graphs and remembering them can be tricky.
I am using InfluxDB as the backend source which stores OHLC data for stocks.
Now the market is not open all the time and hence when I am plotting the data there are missing areas.
I want to have a continuous graph, something like where I can define the market timings so that the graph is one continuous line.
Here is what is currently rendered:
Q: I want to have a continuous graph, something like where I can define the market timings so that the graph is one continuous line.
A: As discussed in the comment. Use fill(linear) operation to substitute the missing points with interpolated points. In this case linear means linear interpolation.
That is, when influxdb encounters a missing point, it will perform linear interpolation to draw a straight line to the next available point. So you get one of the three lines - '/', '-' or '\'.
I have certain movement data acquired from motion capture system which I want to automatically choose which 5 signals are more alike.
Picture shows example of the particular data, all normalized to 100 samples due to the difference in speed.
Data set for knee flexion/extension
What I am looking for is some idea to actually compare the shapes of the curves.
The easiest solution is just to substract the "raw" curves and check which one has the smallest RMSE.
But looking at your data (which are smooth curves), another option is to use PLS or GMM to describe them. Then you can use RMSE to compute the error between your input curve and your database of curves and take the one with lowest error.
I am reading about applications of clustering in human motion analysis. I started out with random numbers and applied k-means clustering algorithm but I wanted to have some graphs that circle the clusters as shown in the picture. Basically, the lines represent the motion trajectory. I will appreciate ideas on how to obtain motion trajectory of a person. Application is patient monitoring where the trajectory will be used in abnormal behavior activity.
I will be using a kinect and recording the motion trajectory based on skeleton tracking. So, I will be recording the 4 quaternion values of Head, Shoulder and Torso joints and the RGBD (Red green blue Depth) that is combined as 1 value for these joints. So, a total of 4*3 + 3 = 15 time series. So, there are 15 variables. How do I convert them to represent the trajectories shown below and then apply clustering to cluster trajectories. The clusters will allow in classification.
Can somebody please show how to obtain the diagram similar to the one attached? and how do I fuse and convert the 15 time series from each person into a single trajectory.
The picture illustrates the number of clusters that are generated for the time series. Thank you in advance.
K-means is a bad fit for trajectories.
It needs to be able to compute the mean (which is why it is called "k-means"). Having a stable, sensible mean is important. But how meaningful is the mean of some time series, even if you could define it (and the series weren't e.g. of different length, and different movement speed)?
Try hierarchical clustering, and multivariate dynamic time warping.
I want to make a matrix in which data is in a matrix and I can pull out each grid in the matrix as a certain long, lat point. The data lasts over 3 years so I would also need a 3rd dimension as time.
What I have now is three 1437x159 doubles of lat, long, and sea ice data. How do I combine them into a 3d matrix that fits the criteria I mentioned above? Basically, I want to be able to say, I want data at -50S lat and 50W lon at day 47 and be able to index into the array and find that answer.
Thanks!
Yes- this can be done without too much difficulty. I have done analogous work in analyzing atmospheric data across time.
The fundamental problem is that you have data organized by hour, with grids varying dynamically over time, and you need to analyze data over time. I would recommend one of two approaches.
Approach 1: Grid Resampling
This involves resampling the grid data over a uniform, standardized grid. Define the grid using the Matlab ndgrid() function, then resample each point using interp2(), and concatonate into a uniform 3D matrix. You can then directly interpolate within this resampled data using interp3(). This approach involves minimal programming, with the trade-off of losing some of the original data in the resampling process.
Approach 2: Dynamic Interpolation
Define a custom class wrapper around your data object, say 'SeaIce', and write your own SeaIce.interp3() method. This method would load the grid information for each hour, perform the interpolation first in the lateral dimension, and subsequently in the time dimension. This ensures that no information is lost via interpolation, with the tradeoff of more coding involved.
The second approach is described in detail (for the wind domain) in my publication "Wind Analysis in Aviation Applications". Slides available here.