Skip to content

Instantly share code, notes, and snippets.

% BEGIN of HW3
% psilotum 2010/03/13
% for GNU Octave
%% 1. Compute the mean and SE(mean) for the fish and copepod densities respectively,
% using both normal theory and non-parametric bootstrap
% import data first, and select the fish density
% and copepod density
enviANDdensity=xlsread("enviANDdensity.csv");
% mybootstrap function
% psilotum 2010/03/13
% for GNU Octave
%% obj is the object, n is the final number
% and i is the bootstrapping repeat time
function[bootstrp] = mybootstrap(obj,n,i)
if columns(obj)==1
#!/usr/bin/env bash
# # create target database
# psql -d bird -q -c "
# DROP TABLE grid;
# CREATE TABLE grid
# (
# gid integer
# ) WITH (OIDS=FALSE);
# "
#!/usr/bin/env python
import random
pres=[2,3,4,6,8,10,11]
result=[]
for i in range(1,12):
if i not in pres:
result.append(i)
else:
continue
%% 2. Randomization test whether significant difference exists between
% the density of Oncaea Venusta and Canthocalanus pauper. (Assume all
% data are independent and use all 34 stations.) Report your p-value.
% sp1 is Oncaea venusta, sp2 is canthocalanus pauper
sp1=copepod_comp(169,:);
sp2=copepod_comp(15,:);
mu_sp12=mean(sp1-sp2);
% Classification using multilayer perceptron
% Use the data provided (modeldata.txt). The first
% two columns are x1 and x2, the column 3 to 5 represent
% coding for three class (y).
% Write your own MLP. Use off-line learning, learning
% rate=0.001, learning time=1000 step, # of hidden neuron=5,
% use tanh as your activation function. Plot MSE vs learning
% steps. Calculate the min(MSE) and associated optimal weights.
% (NOTE: you should try different initial conditions several times
% to check whether you get trapped in the local minimum.)
rcetacean=load("cetaceancorrect.dat.txt");
n=size(rcetacean)(:,1);
entangle=rcetacean(rcetacean(:,4)==1,:);
calm=rcetacean(rcetacean(:,2)<=3);
rough=rcetacean(rcetacean(:,2)>=4);
% calculate the dimension of calm or rough
cs=size(calm)(:,1);
rs=size(rough)(:,1);
% if calm seas=0 (value 0 to 3) else rough seas=1
% (value >= 4)
% Q1: Fit a maximum likelihood model to cetacean entanglement
% problem in homework 14 and use AIC to determine the most
% appropriate model (i.e. compare models:
% 1. Full model (with beta0 beta1 beta2 beta3)
% 2. Model without beta1,
% 3. Model without beta2,
% 4. Model without beta3
% 5. Full model adding interaction term: x*y.
clear;clc;
#!/usr/bin/env bash
# Lin, Cheng-Tao 2010
# School of Forestry and Resource Conservation, National Taiwan University
# For GRASS GIS
# Variable explanations, derived from http://www.worldclim.org/bioclim-aml
# BIO1 = Annual Mean Temperature
# BIO2 = Mean Diurnal Range (Mean of monthly (max temp - min temp))
# BIO3 = Isothermality (P2/P7) (* 100)
Dansk Botanisk Arkiv 9(3): 30, t. 3, f. 7-8. 1937. (Dansk Bot. Ark.)
Icones plantarum formosanarum nec non et contributiones ad floram formosanam. 5: 256. 1915. (Icon. Pl. Formosan.)
Botanical Magazine 26(304): 112-113. 1912. (Bot. Mag. (Tokyo))
Bulletin du Jardin Botanique de Buitenzorg, ser. 2, 2(7): 39, pl. 5, f. 1-2. 1912. (Bull. Jard. Bot. Buitenzorg, ser. 2,)
以上是我想處理的文字,主要分成四個部分:
1. 最前面文字的部份(期刊、書名) 2. 卷/期/頁數等資訊 3. 年份 4. 縮寫
規則如下:
A. 最前面文字的部份擷取出來,當成一個欄位(用 pipeline 分隔)
A1. 例外:若有期刊書名為 Sometext text, ser. 4, 時,連同", ser. 4"擷取此部份