Compare study using smoothed value spy dia and qqq, and then plot the smoothed value - comparison

I wanna compare spy, dia and qqq, but before ploting the price, i wanna do a 10 bar simple moving average smoothing, and then plot the lines. THis sounds very simple but i am totally new to pine script, may i know if some great minds can offer some help? greatly appreaciate!

Related

How does Skimage's Hough_Ellipse work exactly?

I am currently working on a Bachelor Thesis to recognize & count eggs in a hen nest using Computer Vision methods. The eggs can be (partially) occluded by hens for a while and can be positioned in different rotations. My current ideas are using an Elliptic Hough Transform and an AI solution using YOLO - For tracking, I am currently researching :)
However, reading through skimage's tutorial about Hough_Ellipse() and trying to find resources, I am currently at a dead end which results in the following questions:
What is an accumulator threshold value exactly?
What is the accuracy and bin size on the minor axis?
How do all these parameters work together to find ellipses along with min_size & max_size
(min_size is minimal major axis length & max_size is maximal minor axis length)
Isn't it that the major & minor axis can change?
For the transform, I currently am using Grayscaling -> Gaussian Blurring -> Canny Detection.
The result of the preprocessing looks like this at the moment:
Preprocessed Image
The preprocessing shows that there is - indeed - an ellipse. I am unsure whether FitEllipse() from OpenCV will end up helping me detecting Ellipses, especially when partially occluded by hens and having different possible rotations of an egg.
Furthermore, how do I figure out the individual parameters for Hough_Transform()?
PS: If anyone has better ideas aside from AI to test out, I'd be happy to try out more things :)

plotly.js "pseudo" histogram for time-series data?

I am trying to figure out how to create this overlaid plot of time-series data, where one of the series should "look" like a histogram.
The problem is I could not figure out how to combine/overlay a histogram with time series data and line/scatter plot and get the histogram xbins to work with the date time data, etc.
So I was also trying to use a bar chart, and create a "pseudo histogram" by removing the gaps between bars, adding outlines, and so forth but that seems fruitless as I don't see a way to control all the borders/lines to that level of control.
The result I am looking for is roughly like so;
Which to me looks like the best match for a plot type should be a histogram, but again I could not figure out how to make that work overlaid with the same x axis as the line/scatter time-series data.
Can anyone offer ideas or point me to an example that might help me understand how to do this ?
I guess I also need to figure out how to align the y-axis scales of the two series also, but that I expect is a different topic...
I am specifically using plotly.js / Javascript

Hard time finding SARIMA parameters from ACF and PACF

Im a beginner in time series analyses.
I need help finding the SARIIMA(p,d,q,P,D,Q,S) parameters.
This is my dataset. Sampletime 1 hour. Season 24 hour.
S=24
Using the adfuller test I get p = 6.202463523469663e-16. Therefor stationary.
d=0 and D=0
Plotting ACF and PACF:
Using this post:
https://arauto.readthedocs.io/en/latest/how_to_choose_terms.html
I learn to "start counting how many “lollipop” are above or below the confidence interval before the next one enter the blue area."
So looking at PACF I can see maybe 5 before one is below the confidence interval. Therefor non seasonal p=5 (AR).
But I having a hard time finding the q - MA parameter from the ACF.
"To estimate the amount of MA terms, this time you will look at ACF plot. The same logic is applied here: how much lollipops are above or below the confidence interval before the next lollipop enters the blue area?"
But in the ACF plot not a single lollipop is inside the blue area.
Any tips?
There are many different rules of thumb and everyone has own views. I would say, in your case you probably do not need the MA component at all. The rule with the lollipop refers to ACF/PACF plots that have a sharp cut-off after a certain lag, for example in your PACF after the second or third lag. Your ACF is trailing off which can be an indicator for not using the MA component. You do not have to necessarily use it and sometimes the data is not suited for an MA model. A good tip is to always check what pmdarima’s auto_arima() function returns for your data:
https://alkaline-ml.com/pmdarima/tips_and_tricks.html
https://alkaline-ml.com/pmdarima/modules/generated/pmdarima.arima.auto_arima.html
Looking at you autocorrelation plot you can clearly see the seasonality. Just because the ADF test tells you it is stationary does not mean it necessarily is. You should at least check if you model works better with seasonal differencing (D).

Find linear trend as single number google sheets

I have 20 years of data. I want to find the linear trend of the %s as a single number. EG if you were to plot the linear trend, there would be a coefficient by which the line increases/ decreases over time.
Google sheets has a trend function, but it's used for creating new data based on predicting trends.
Your question is too vague to answer clearly and precisely for what you want. Are you looking for the formula for the trend line? Just the correlation coefficient? Or a future value based on the info? The slope of the trend line?
What you have described is linear regression. I would suggest browsing the Insert drop down menu for formulas > statistics. There are formulas for each piece of info you want to draw (except creating the formula for you).
An easy and superficial way of obtaining the correlation coefficient and actual formula (and thus slope for linear trend lines), is to use excel. Copy your data table into excel and then create a scatterplot with the table. Go into the settings for the scatter plot and check the box for “trendline”. Then go into the trendline settings for the plot, and you can select which type of regression you want excel to use. You want linear. Towards the bottom of that menu, you want to check the boxes that say “show formula on chart” and “show R coefficient” or something along those lines. Excel will then print out your formula and coefficient in a text box on the chart. Your slope will be the coefficient of the x variable.
Hope this helps! Regression is a wormhole. I’d love to get more in depth if you’re interested!
NOTE: The outlier for year 2003 will have a significant impact on a linear regression line. Consider removing it from the data to create a line that will be more accurate for future predictions.

Stereo-Processing, Census Based

Hi I'm currently trying to implement a stereo matching algorithm in c and I'm having trouble to understand a part in the
paper.
My Problem is the part after the subpixel calculation on page 17. I don't understand it how to get the subpixel disparity map for both directions. Also I'm a little bit confused if my cost aggregation is correct. It's recommended to use a 5x5 windows and sum the values over this block. Do I sum all values in this 5x5 block or do I add every second in every second row, like I did for the census transformation? Thanks for the help!

Resources