DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
// Copyright John Maddock 2007. // Copyright Paul A. Bristow 2007. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_STATS_FIND_LOCATION_HPP #define BOOST_STATS_FIND_LOCATION_HPP #include
// for all distribution signatures. #include
#include
#include
#include
#include
#include
// using boost::math::policies::policy; // using boost::math::complement; // will be needed by users who want complement, // but NOT placed here to avoid putting it in global scope. namespace boost { namespace math { // Function to find location of random variable z // to give probability p (given scale) // Applies to normal, lognormal, extreme value, Cauchy, (and symmetrical triangular), // enforced by BOOST_STATIC_ASSERT below. template
inline typename Dist::value_type find_location( // For example, normal mean. typename Dist::value_type z, // location of random variable z to give probability, P(X > z) == p. // For example, a nominal minimum acceptable z, so that p * 100 % are > z typename Dist::value_type p, // probability value desired at x, say 0.95 for 95% > z. typename Dist::value_type scale, // scale parameter, for example, normal standard deviation. const Policy& pol ) { #if !defined(BOOST_NO_SFINAE) && !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) // Will fail to compile here if try to use with a distribution without scale & location, // for example pareto, and many others. These tests are disabled by the pp-logic // above if the compiler doesn't support the SFINAE tricks used in the traits class. BOOST_STATIC_ASSERT(::boost::math::tools::is_distribution
::value); BOOST_STATIC_ASSERT(::boost::math::tools::is_scaled_distribution
::value); #endif static const char* function = "boost::math::find_location
&, %1%)"; if(!(boost::math::isfinite)(p) || (p < 0) || (p > 1)) { return policies::raise_domain_error
( function, "Probability parameter was %1%, but must be >= 0 and <= 1!", p, pol); } if(!(boost::math::isfinite)(z)) { return policies::raise_domain_error
( function, "z parameter was %1%, but must be finite!", z, pol); } if(!(boost::math::isfinite)(scale)) { return policies::raise_domain_error
( function, "scale parameter was %1%, but must be finite!", scale, pol); } //cout << "z " << z << ", p " << p << ", quantile(Dist(), p) " // << quantile(Dist(), p) << ", quan * scale " << quantile(Dist(), p) * scale << endl; return z - (quantile(Dist(), p) * scale); } // find_location template
inline // with default policy. typename Dist::value_type find_location( // For example, normal mean. typename Dist::value_type z, // location of random variable z to give probability, P(X > z) == p. // For example, a nominal minimum acceptable z, so that p * 100 % are > z typename Dist::value_type p, // probability value desired at x, say 0.95 for 95% > z. typename Dist::value_type scale) // scale parameter, for example, normal standard deviation. { // Forward to find_location with default policy. return (find_location
(z, p, scale, policies::policy<>())); } // find_location // So the user can start from the complement q = (1 - p) of the probability p, // for example, l = find_location
(complement(z, q, sd)); template
inline typename Dist::value_type find_location( // Default policy. complemented3_type
const& c) { static const char* function = "boost::math::find_location
&, %1%)"; typename Dist::value_type p = c.param1; if(!(boost::math::isfinite)(p) || (p < 0) || (p > 1)) { return policies::raise_domain_error
( function, "Probability parameter was %1%, but must be >= 0 and <= 1!", p, policies::policy<>()); } typename Dist::value_type z = c.dist; if(!(boost::math::isfinite)(z)) { return policies::raise_domain_error
( function, "z parameter was %1%, but must be finite!", z, policies::policy<>()); } typename Dist::value_type scale = c.param2; if(!(boost::math::isfinite)(scale)) { return policies::raise_domain_error
( function, "scale parameter was %1%, but must be finite!", scale, policies::policy<>()); } // cout << "z " << c.dist << ", quantile (Dist(), " << c.param1 << ") * scale " << c.param2 << endl; return z - quantile(Dist(), p) * scale; } // find_location complement template
inline typename Dist::value_type find_location( // Explicit policy. complemented4_type
const& c) { static const char* function = "boost::math::find_location
&, %1%)"; typename Dist::value_type p = c.param1; if(!(boost::math::isfinite)(p) || (p < 0) || (p > 1)) { return policies::raise_domain_error
( function, "Probability parameter was %1%, but must be >= 0 and <= 1!", p, c.param3); } typename Dist::value_type z = c.dist; if(!(boost::math::isfinite)(z)) { return policies::raise_domain_error
( function, "z parameter was %1%, but must be finite!", z, c.param3); } typename Dist::value_type scale = c.param2; if(!(boost::math::isfinite)(scale)) { return policies::raise_domain_error
( function, "scale parameter was %1%, but must be finite!", scale, c.param3); } // cout << "z " << c.dist << ", quantile (Dist(), " << c.param1 << ") * scale " << c.param2 << endl; return z - quantile(Dist(), p) * scale; } // find_location complement } // namespace boost } // namespace math #endif // BOOST_STATS_FIND_LOCATION_HPP
find_location.hpp
Page URL
File URL
Prev
9/23
Next
Download
( 6 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.