how to add confidence intervals (bounds) to Logistic function
8 views (last 30 days)
Show older comments
Dear guys,
I want to add confidence intervals to logistic function.
Logistic function which is defined as : y = exp(z) / (1+exp(z)), also z = a+b*x.
For the convenience I provide the code:
a=-5;
b=38;
x=0.01:0.01:0.5;
z=a+b.*x;
y = exp(z)./(1+exp(z));
figure(1);plot(x,y);hold on;
Could anyone tell me how to calculate confidence intervals for y in the plot of fig1 (x&y plot).
Let's start with 95% two-tail.
Thank you in advance.
David
0 Comments
Answers (1)
Walter Roberson
on 19 Apr 2011
That's a tricky one: If you declare that x is to be uniformly randomly generated over [0,1/2] then the upper bound of the 95% two-tailed confidence interval is substantially above the upper limit of that range, near 1.105512795.
If x is held to be uniformly randomly generated over [0,T] then the upper bound of the 95% two-tailed confidence interval is larger than T until T reaches slightly more than 1.16 .
I proceeded with these calculations by finding the mean and standard deviation over U[0,T] of y with symbolic x. 95% confidence corresponds to 1.96 standard deviations, so for the upper bound calculate Mean + 1.96 * Std / 2, with the division by 2 being because the 95% range was being split evenly above and below the mean. Then evaluate for T=1/2 for U[0,1/2]
If you do the calculations with x in U(-T,T) then at T=1/2 the beginning of the upper tail is still above 1/2; in the U(-T,T) situation, the upper tail does not get smaller than the limit of the range until about T = 0.5808041659 . Note: for U(-T,T) the mean of y is exactly 1/2 .
0 Comments
See Also
Categories
Find more on Random Number Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!