How to find the probability density function of a function of normal distribution and draw a graph of it - math

I know the pdf of standard normal distribution, but what's the pdf of a function of it?
For example: standard normal distribution + 1, how should I find the pdf? I think the graph for this one is easier, just move the graph up by 1.

Related

continues density plot seaborn with lower limit

I have been using this code for my continues parameters to plot the probability distributions. However, my parameter now is price that cant be below zero, I have been reading to see if I can customize the density function so it dsnt go into negative numbers but havnt really found an answer. Does anyone know if there is a way to bound the density function?
fig = plt.figure(figsize=(6,4))
sns.distplot(data2018[ 'price'], hist=False)
sns.distplot(data2020[ 'price'], hist=False)
fig.legend(labels=['2018','2020'], bbox_to_anchor=(0.9,0.85))

Confidence ellipse formula in JS or R

What I have: A scatter chart(plot) of PCA. Plotted in JS. I have Rtools that Ive used to push PCA data to the client side.
What I'm trying to do: Plot a confidence ellipse formula.
I can't seem to find a straight forward formula for the CI ellipse. I came across a lot of theory and a lot of examples in R which give you the end result - an ellipse (One can use ggplot or CRAN to plot it).
But Im looking for a formula that I could use in the client side to plug my scatter chart points and calculate the ellipse or even better a function in R that would give me a formula for the ellipse.
I have the covariance matrix and Eigen vectors as well (calculated in R).
All suggestions much appreciated.
Haven't found a formula but after using Momocs:::conf_ell library I managed to get the vertices and the x,y points of an ellipse.
I will update this answer once I find the second part to my answer - a straight forward formula.

Ilnumeric Plotcube custom axis scaling

I am very new to Ilnumeric. I see two scaling modes for the axis in a plot: log and linear.
Is there any easy (or complicated) way to get the axis and data) to be displayed in an arbitrary way (in 2D)?
For example, I want to display the data on a nonlinear axis like a normal probability plot (where the y-axis is scaled with the error function = inverted cumulative distribution function). This is one example, I can think of various other transformations, like the Weibull plot.
I am familiar with matplotlib in python. In matplotlib it is possible to define custom axis transformations as discussed above. Do i need to set up my own "plot scene graph" or is there any way to do it with the Plotcube class?

How to implement histfit in r?

There is histfit function in Matlab would plot histogram and fit the distribution by bin values.
The distribution's parameters have to be estimated.
How to implement histfit in r? I searched for a long time, but it has no lucky.
This post have mentioned this before, but there is no preferable solution. The sn package seems support several distribution, not so much.
I explore the data with hist function, the histogram shows gamma distribution in gerneral.
But if I add up bins and show it again, the graph will show more details, and gamma distribution fails.
fitdistr would fail to find parameters also.
so I want to fit the data just using the coarse data from histogram. This is the question, thank you for your help.
The fitdistr function in the MASS package can be used to find parameters for a given distribution (including gamma). The function density and the logspline package (and others) can be used to estimate the density function of the data without assuming a specific distribution.
The lines and curve functions can be used to add an estimated density curve to a plotted histogram (use prob=TRUE when creating the histogram).
If you want to compare your data to a specific distribution then tools like qqplots (qqplot function or others) or visual tests (vis.test in the TeachingDemos package) will probably be better than a histogram and density plot.
I have to answer it myself, package 'bda' could fit the binned data in several distributions, however it could only binning data by rounding.

Measuring the limit of a point on a smooth.spline in R

I'm not sure if that's the right terminology.
I've entered some data into R, and I've put a smooth.spline through it using the following command.
smoothingSpline = smooth.spline(year, rate, spar=0.35)
plot(x,y)
lines(smoothingSpline)
Now I'd like to measure some limits (or where the curve is at a given x point), and maybe do some predictive analysis on points that extend beyond the graph.
Are there commands in R for measuring (or predicting) the points along a curve?
Is ?predict.smooth.spline what you are looking for?

Resources