Inverse cdf method for Bates distribution [closed] - math

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 months ago.
Improve this question
The probability density function of a Bates distribution random variable X is
To get cdf you need to integrate pdf
I got the following cdf function:
And Inverse function:
But this function generates wrong variates.
What am I doing wrong?
Thanks.

The inverse of a sum is not the sum of the inverses.
The Bates distribution with parameter n is the distribution of the average of n random numbers distributed according to the uniform distribution on (0, 1). So you can simply simulate the uniform distribution and take the average.

Related

How to make poisson noise from uniform random numbers using central limit theorem? [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last month.
Improve this question
Using the fact that Gaussian(λ=σ) is an approximation of Poisson(λ), I want to compute an approximation of Poisson noise using only uniform random numbers without using factorials.
There are two things I have no clue.
How to approximate gaussian noise from uniform noise.
How to approximate Poisson noise with Gaussian noise when λ is small.

How can I use R to get confidence intervals in Azure ML? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I came across this question which asks if Azure ML can calculate confidence - or probabilities - for row data prediction. However, given that the answer to that question is No, and suggests to use R, I am trying to figure out how to use R to do exactly this for a regression model.
Does anyone have any suggestions for references on where to look for this?
My scenario is that I have used Azure ML to build a boosted decision tree regression model, which outputs a Scored Label column. But I don't know regression analysis well enough to write R code to use the outputted model to get confidence intervals.
I am looking for any references that can help me understand how to do this in R (in conjuncture with Azure ML).
There isn't a straight forward way to compute the confidence interval from the results of the Boosted Decision Tree model in Azure ML.
Here are some alternate suggestions:
Rebuild the model using the library(gbm) http://artax.karlin.mff.cuni.cz/r-help/library/gbm/html/gbm.html or the library(glm) https://stat.ethz.ch/R-manual/R-devel/library/stats/html/glm.html
Then build the confidence interval using confint function: https://stat.ethz.ch/R-manual/R-devel/library/stats/html/confint.html
For a linear model, the confidence interval computation is simpler: http://www.r-tutor.com/elementary-statistics/simple-linear-regression/confidence-interval-linear-regression

spline approximation with specified number of intervals [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
So - edited because some of us thought that this question is off-topic.
I need to build spline (approximation) on 100 points in one of environments listed in tags. But I need it with exact number of intervals (maximum of 6 intervals - separate equations - in whole domain). Packages / libraries in R and Maxima which I know let me for building spline on this points but with 25-30 intervals (separate equations). Does anyone know how to build spline with set number of intervals without coding whole algorithm all over again?
What you're looking for might be described as "local regression" or "localized regression"; searching for those terms might turn up some hits.
I don't know if you can find exactly what you've described. But implementing it doesn't seem too complicated: (1) Split the domain into N intervals (say N=10). For each interval, (2) make a list of the data in the interval, (3) fit a low-order polynomial (e.g. cubic) to the data in the interval using least squares.
If that sounds interesting to you, I can go into details, or maybe you can work it out yourself.

Mathematica: Variance[] definition [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
The section on the help system tells me the Variance[] function is equalvalent to:
Total[(list-Mean[list])^2]/(Length[list]-1)
But I think the right definition should be:
Total[(list-Mean[list])^2]/(Length[list])
I can't figure this out.
Both definitions are correct:
The first formula gives an unbiased estimator of the population variance when the population mean is unknown.
The second formula gives an unbiased estimator of the population variance when the population mean is known.
When the true mean is unknown and has to be estimated from the data, the second formula would systematically underestimate the variance. The intuition is that a given sample would tend to have lower dispersion around the estimated mean than around the true mean. The -1 in the denominator corrects for that.
See Point estimation of the variance.

How to calculate Total least squares in R? (Orthogonal regression) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I didn't find a function to calculate the orthogonal regression (TLS - Total Least Squares).
Is there a package with this kind of function?
Update: I mean calculate the distance of each point symmetrically and not asymmetrically as lm() does.
You might want to consider the Deming() function in package MethComp [function info]. The package also contains a detailed derivation of the theory behind Deming regression.
The following search of the R Archives also provide plenty of options:
Total Least Squares
Deming regression
Your multiple questions on CrossValidated, here and R-Help imply that you need to do a bit more work to describe exactly what you want to do, as the terms "Total least squares" and "orthogonal regression" carry some degree of ambiguity about the actual technique wanted.
Two answers:
gx.rma in the rgr package appears to do this.
Brian Ripley has given a succinct answer on this thread. Basically, you're looking for PCA, and he suggests princomp. I do, too.
I got the following solution from this url:
https://www.inkling.com/read/r-cookbook-paul-teetor-1st/chapter-13/recipe-13-5
r <- prcomp( ~ x + y )
slope <- r$rotation[2,1] / r$rotation[1,1]
intercept <- r$center[2] - slope*r$center[1]
Basically you performa PCA that will fit a line between x and y minimizing the orthogonal residuals. Then you can retrieve the intercept and slope for the first component.
For anyone coming across this question again, there exists a dedicated package 'onls' by now for that purpose. It is similar handled as the nls package (which implements ordinary least square algorithms)

Resources