linnil1
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 探索式多變量 HW1 ###### tags: `multivariate` ## URL https://hackmd.io/q20Hza-cQZCGyfHSiWxgnw ## 1 請畫出下列兩組數據組的盒鬚圖(5分) 需標示清楚(內籬[即為`Q1 - 1.5*IQR`, `Q3 + 1.5*IQR`], Q1 ,Q2, Q3, Max, min) > 我這裡是用 https://zh.wikipedia.org/wiki/%E5%9B%9B%E5%88%86%E4%BD%8D%E6%95%B0#%E8%BF%90%E7%AE%97%E8%BF%87%E7%A8%8B 來計算四分位 * a: 6,47,49,15,42,41,7,39,43,40,36 * b: 4,3,1,2 > ![](https://user-images.githubusercontent.com/14067508/64906416-d61b4400-d6d5-11e9-8674-703bd9ba9dba.png) > Please see python code https://gist.github.com/linnil1/e61426e345675712ea18038d824b6b73 ## 2 請計算下列分配的期望值與變異數,但其一表格被咖啡汙染(5分) | x | 0 | 1 | 2 | 3 | |:---:| --- | --- | --- | --- | | f(x) <br> probability mass function| 0.2 | 0.45| 0.3 | 咖啡漬 | > $咖啡漬 = 1 - 0.2 - 0.45 - 0.3 = 0.05$ > $E(X) = 0 * 0.2 + 1 * .45 + 2 * .3 + 3 * .3 = 1.95$ > $Var(X)= E(X^2) - (E(X))^2 = 0^2 * 0.2 + 1^2 * .45 + 2^2 * .3 + 3^2 * .3 - 1.95^2 = 0.5475$ ## 3 請計算一次投擲4顆骰子,出現2個5點的機率為何? (5分) > 其實就是分成 出現 5 跟 沒出現 5。 > 出現5機率 $p=1/6$ 此試驗服從 **Binomial** 分配且其參數為 **就是骰子數 $n = 4$** 如題機率為? > $$ > C^{4}_{2}(1/6)^2(1 - 1/6)^2 = 0.116 > $$ ## 重複投三次,兩次結果為出現2個5點的機率為何? 此時 三次 $n=3$ 然後出現 兩個五點 $p=0.116$ ,一樣是 binomial distribution > $$ > C^{3}_{2}(0.116)^2(1 - 0.116)^1 = 0.036 > $$ ## 4 Poisson 題 X是服從Poisson分配,每15分鐘平均有2人進入超商,每30分鐘平均有4人進入超商 ,所以 𝜆=___,而9:00~9:30間,有5位顧客進入超商之機率為?(5分) > 所求區間為 30min,所以 $\lambda=4$,而 $x = 5$,帶入 poisson distribution > $$ > P = \frac{e^{-4}(4)^5}{5!} = 0.156 > $$ ## 5 是非題 所謂的 $\bar{x}$ 抽樣分配,就是抽樣出來之樣本的平均所呈現的分布(5分) > Yes, 而且這個分布根據中央極限定理,是常態分布。 ## 6 填空 假設檢定列式,等號一定要放在 **Null hypothesis(虛無假設)** ,且錯誤決策會有重大損失的會放在 **Alternative Hypothesis(對立假設)** (5分) ## 7 知名統計學家費雪曾說過一段經典故事,有位女士宣稱她可以分辨一杯奶茶是先加牛奶在加茶還是先加茶在加牛奶.如今日我們用假設檢定來做檢驗, 虛無假說=該女士實際無法分辨 在信心水準0.05下,端出5杯奶茶給女士品嘗且5杯全數答對, 其p值為__________,故我們__(拒絕/不拒絕)____虛無假設 (5分) > 先假設亂猜,也就是 $p = 0.5$,所以全部答對 $P = 0.5 ^ 5 = 0.03125 < 0.05$,所以我們 reject null hypothesis ## 8 一組回歸數據 其 $\sum_{i=1}^{n} (\hat{y_i}-\bar{y})^2=800$, $\sum_{i=1}^{n} (\hat{y_i}-y_i)^2=200$ 請問其判別係數為何? (5分) > 原來在問 coefficient of determination($R^2$) > Total loss = 800 + 200 > error loss = 200 > $R^2 = 可解釋 / 全部 = (Total - error) / Total = 0.8$ ## 9 Assume that IQ scores for a certain population are approximately N(µ,100). To test H0: $µ=110$ against the one-sided alternative hypothesis H1: $µ>110$, we take a random sample of size n = 16 from this population and observe $\bar{x}=113.5$. (a) Do we accept or reject H0 at the 5% significance level? (10 points) > $H_0: \mu <= 110$ > $\sigma = \sqrt{100} = 10$ > 因為樣本數少於30所以使用 t-distribution 而非 normal-distribution > $\frac{\bar{x} - \mu}{\sigma \ \sqrt{n}} = 1.4$ > `pt(1.4, 16)` > 0.9096975 < 0.95 > 所以我們 fail to reject H0 ## Bonus (是非題) 因子分析與主成分皆為降維的工具,且使用目的也相同(3分) > 是,都是降維工具 > 目的不一樣,我們可以從計算方式來看 > * PCA 是盡量把重要的東西取出來,但是都是orthogonal > * FA 則可以刻意 oblique,畢竟每個成分可能是有關連的 > > 解答 > 錯。因子分析在於找出影響各變項的背後之幾個共同因子, 主成分則是找出相近的變項並合併。

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully