ACF at lag 0 is not equal to 1 - time-series

I am working on a xts object with all mondays in a year (excluding holidays). However, when I tried to create the acf and pacf plot, all the values are within the lines, even at lag 0. I thought that the acf at lag 0 is always equal to 1 since it is the correlation with itself. Can someone please explain to me why this is not the case in my acf and pacf? Thank you!

Related

space proportional between points in x-axis

Is it possible in high-charts to show your X axis proportional to your data points.
Lets say my x axis data is [1,2,5,8,30,50] and these are say years.
I would like the chart to distance the points proportionally so the chart looks more reasonable to view. In this example while point 1, 2 would be closer but distance between 2 and 5 should be roughly three times distance between 1 and 2 and so on.
Basic idea is when you see how the values are changing between year 8 and 30 than visually it conveys right message to your brain.
Thanks
You can use the tickPositions feature and pass a wanted array of the xAxis values to achieve your requirements.
Demo: https://jsfiddle.net/BlackLabel/vm1eh4su/
API: https://api.highcharts.com/highcharts/xAxis.tickPositions

How can I sum negative and positive value separately in Google Sheets

In the google sheets, I have a bunch of negative and positive amounts in the same vertical rows. Now in a particular cell, I want to show all the sum of positive values and in another cell, I want to show the sum of all negative values. I want to calculate the total debit and credit amount actually.
Here are some sample data I wanna calculate
Sample data
Any help will ve appreciated ^_^
for negative values
=sumif(range, "<0")
for positive values
=sumif(range, ">0")
For data in column A from A1 to A100, try:
sumproduct((A1:A100)*(A1:A100>0))
and for the negatives:
sumproduct((A1:A100)*(A1:A100<0))
(the second formula will yield a negative value)(will also work for Excel)

Calculating the equation of a zig zag line on a graph

I have plotted a time v/s some hardware sensor value graph. I have many readings and want to calculate a mean or any possible value (may be equation of a zig zag line, may be oscillatory motion or harmonic motion) to compare multiple readings.
I am recording data at the interval of 0.01 seconds.
Here is the graph plot of a single reading:
Here is the graph plot of multiple readings:
Also, equation of a curve can also be calculated. The data can be divided into time (2 second blocks), to calculate the equation of curve at that time.
Add each value to a buffer when you plot it, then you can calculate whatever you want.
For the mean sum the buffer contents and then divide by the number of entries in the buffer.
To find equations for curves, this page should help.

Extracting only peaks in a distribution

I have a table that has frame numbers in one column and corresponding color moments in the other column. I found them using openCV.
Some of the frames have extremely high values and rest very low. How can I extract the frames with very high peaks ?
This is the plot of the distribution, I tried to use Gaussian smoothing and then thresholding on the plot below.
I got this result.
Now how should I proceed ?
Basically you are looking for a peakfinder...MATLAB has a peakfinder function to find peaks...
I did not find any ready made API in OpenCV for this so I implemented the peakfinder of MATLAB...the algorithm goes this way...
Initial assumptions or prior knowledge can be a) you can have 'n' peaks in your distribution b) your peaks are separated by a minimum window 'w' i.e no two peak are closer than 'w'.
I can tel you the window implementation. Start at a data point . Mark its position as current index and check in its left and right neighbourhood of length 'w' whether a value more than the value at current index exists or not.
If yes move to the point. Make the point the current index and repeat 2.
If no then its your local maxima. Move ur current index by 'w' length and repeat 2 till you reach data set end.
try to implement this and check MATLAB help for peakfinder. If no luck I can post the code..
EDIT after seeing your edited graph it seems the graph has well defined maximum peaks and hence what you can do is track the sign of the dy/dx of the graph. Maximum peaks are points where sign of dy/dx changes from positive to negative...in code language
vector<double> array_of_max_peak;
if (sign( x(n+1) - x(n) ) ) > 0
array_of_max_peak.push(x(n));

Adjustable sharpen color matrix

I am using .NET AForge libraries to sharpen and image. The "Sharpen" filter uses the following matrix.
0 -1 0
-1 5 -1
0 -1 0
This in fact does sharpen the image, but I need to sharpen the image more aggressively and based on a numeric range, lets say 1-100.
Using AForge, how do I transform this matrix with numbers 1 through 100 where 1 is almost not noticeable and 100 is very noticeable.
Thanks in advance!
The one property of a filter like this that must be maintained is that all the values sum to 1. You can subtract 1 from the middle value, multiple by some constant, then add 1 back to the middle and it will be scaled properly. Play around with the range (100 is almost certainly too large) until you find something that works.
You might also try using a larger filter matrix, or one that has values in the corners as well.
I would also suggest looking at the GaussianSharpen class and adjusting the sigma value.

Resources